// Configure the decoder
this = dv_decoder_new( FALSE, FALSE, FALSE );
- this->quality = DV_QUALITY_COLOR | DV_QUALITY_AC_1;
+ this->quality = DV_QUALITY_COLOR | DV_QUALITY_AC_2;
this->audio->arg_audio_emphasis = 2;
dv_set_audio_correction( this, DV_AUDIO_CORRECT_AVERAGE );
+ dv_set_error_log( this, NULL );
// Register it with the properties to ensure clean up
sprintf( label, "%p", this );
if ( filename != NULL && this != NULL && mlt_producer_init( &this->parent, this ) == 0 )
{
mlt_producer producer = &this->parent;
- mlt_properties properties = mlt_producer_properties( producer );
+ mlt_properties properties = MLT_PRODUCER_PROPERTIES( producer );
// Register transport implementation with the producer
producer->close = ( mlt_destructor )producer_close;
if ( valid )
{
// Get the properties
- mlt_properties properties = mlt_producer_properties( &this->parent );
+ mlt_properties properties = MLT_PRODUCER_PROPERTIES( &this->parent );
// Get a dv_decoder
dv_decoder_t *dv_decoder = dv_decoder_alloc( );
double fps = this->is_pal ? 25 : 30000.0 / 1001.0;
if ( mlt_properties_get_double( properties, "fps" ) == fps )
{
- mlt_properties_set_position( properties, "length", this->frames_in_file );
- mlt_properties_set_position( properties, "in", 0 );
- mlt_properties_set_position( properties, "out", this->frames_in_file - 1 );
+ if ( this->frames_in_file > 0 )
+ {
+ mlt_properties_set_position( properties, "length", this->frames_in_file );
+ mlt_properties_set_position( properties, "in", 0 );
+ mlt_properties_set_position( properties, "out", this->frames_in_file - 1 );
+ }
}
else
{
// Parse the header for meta info
dv_parse_header( dv_decoder, dv_data );
mlt_properties_set_double( properties, "aspect_ratio",
- dv_format_wide( dv_decoder ) ? ( this->is_pal ? 512.0/351.0 : 96.0/79.0 ) : ( this->is_pal ? 128.0/117.0 : 72.0/79.0 ) );
+ dv_format_wide( dv_decoder ) ? ( this->is_pal ? 118.0/81.0 : 40.0/33.0 ) : ( this->is_pal ? 59.0/54.0 : 10.0/11.0 ) );
// Return the decoder
dv_decoder_return( dv_decoder );
uint8_t *pixels[3] = { NULL, NULL, NULL };
// Get the frames properties
- mlt_properties properties = mlt_frame_properties( this );
+ mlt_properties properties = MLT_FRAME_PROPERTIES( this );
// Get a dv_decoder
dv_decoder_t *decoder = dv_decoder_alloc( );
int16_t *audio_channels[ 4 ];
// Get the frames properties
- mlt_properties properties = mlt_frame_properties( this );
+ mlt_properties properties = MLT_FRAME_PROPERTIES( this );
// Get a dv_decoder
dv_decoder_t *decoder = dv_decoder_alloc( );
else
{
// No audio available on the frame, so get test audio (silence)
- this->get_audio = NULL;
mlt_frame_get_audio( this, buffer, format, frequency, channels, samples );
}
read_frame( this->fd, data, &this->is_pal ) )
{
// Get the frames properties
- mlt_properties properties = mlt_frame_properties( *frame );
+ mlt_properties properties = MLT_FRAME_PROPERTIES( *frame );
// Get a dv_decoder
dv_decoder_t *dv_decoder = dv_decoder_alloc( );
// Update other info on the frame
mlt_properties_set_int( properties, "width", 720 );
mlt_properties_set_int( properties, "height", this->is_pal ? 576 : 480 );
- mlt_properties_set_int( properties, "top_field_first", 0 );
+ mlt_properties_set_int( properties, "top_field_first", !this->is_pal ? 0 : ( data[ 5 ] & 0x07 ) == 0 ? 0 : 1 );
// Parse the header for meta info
dv_parse_header( dv_decoder, data );
- mlt_properties_set_int( properties, "progressive", dv_is_progressive( dv_decoder ) );
+ //mlt_properties_set_int( properties, "progressive", dv_is_progressive( dv_decoder ) );
mlt_properties_set_double( properties, "aspect_ratio",
- dv_format_wide( dv_decoder ) ? ( this->is_pal ? 512.0/351.0 : 96.0/79.0 ) : ( this->is_pal ? 128.0/117.0 : 72.0/79.0 ) );
+ dv_format_wide( dv_decoder ) ? ( this->is_pal ? 118.0/81.0 : 40.0/33.0 ) : ( this->is_pal ? 59.0/54.0 : 10.0/11.0 ) );
// Hmm - register audio callback
- ( *frame )->get_audio = producer_get_audio;
+ mlt_frame_push_audio( *frame, producer_get_audio );
// Push the quality string
- mlt_frame_push_service( *frame, mlt_properties_get( mlt_producer_properties( producer ), "quality" ) );
+ mlt_frame_push_service( *frame, mlt_properties_get( MLT_PRODUCER_PROPERTIES( producer ), "quality" ) );
// Push the get_image method on to the stack
mlt_frame_push_get_image( *frame, producer_get_image );