// 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 );
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
{
// 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 ) );