// Parse the header for meta info
dv_parse_header( decoder, dv_data );
- // Assign width and height from properties
- *width = mlt_properties_get_int( properties, "width" );
- *height = mlt_properties_get_int( properties, "height" );
+ // Assign width and height according to the frame
+ *width = 720;
+ *height = dv_data[ 3 ] & 0x80 ? 576 : 480;
// Extract an image of the format requested
- if ( *format == mlt_image_yuv422 )
+ if ( *format == mlt_image_yuv422 || *format == mlt_image_yuv420p )
{
// Allocate an image
uint8_t *image = mlt_pool_alloc( *width * ( *height + 1 ) * 2 );
// Assign result
*buffer = image;
+ *format = mlt_image_yuv422;
}
- else if ( *format == mlt_image_rgb24 )
+ else
{
// Allocate an image
uint8_t *image = mlt_pool_alloc( *width * ( *height + 1 ) * 3 );
// Assign result
*buffer = image;
+ *format = mlt_image_rgb24;
}
// Return the decoder
mlt_properties_set_double( properties, "aspect_ratio",
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 ) );
+
+ mlt_properties_set_int( properties, "frequency", dv_decoder->audio->frequency );
+ mlt_properties_set_int( properties, "channels", dv_decoder->audio->num_channels );
+
// Hmm - register audio callback
mlt_frame_push_audio( *frame, producer_get_audio );