X-Git-Url: http://research.m1stereo.tv/gitweb?a=blobdiff_plain;f=src%2Fmodules%2Fdv%2Fproducer_libdv.c;h=0ae1c39001e420e1403a51ca6b809111ab442361;hb=389f031298e2d0fbef8b3c4bcebc146ba42ae979;hp=f2cc38975a112802e04880bcc431054929850cf3;hpb=b6232c93db568b3becc00019ca18e31bd92e54b5;p=melted diff --git a/src/modules/dv/producer_libdv.c b/src/modules/dv/producer_libdv.c index f2cc389..0ae1c39 100644 --- a/src/modules/dv/producer_libdv.c +++ b/src/modules/dv/producer_libdv.c @@ -304,9 +304,8 @@ static int producer_get_image( mlt_frame this, uint8_t **buffer, mlt_image_forma *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 ); @@ -321,8 +320,9 @@ static int producer_get_image( mlt_frame this, uint8_t **buffer, mlt_image_forma // 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 ); @@ -337,6 +337,7 @@ static int producer_get_image( mlt_frame this, uint8_t **buffer, mlt_image_forma // Assign result *buffer = image; + *format = mlt_image_rgb24; } // Return the decoder @@ -476,8 +477,11 @@ static int producer_get_frame( mlt_producer producer, mlt_frame_ptr frame, int i //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 ? 118.0/81.0 : 40.0/33.0 ) : ( this->is_pal ? 59.0/54.0 : 10.0/11.0 ) ); - mlt_properties_set_double( properties, "dv_aspect_ratio", mlt_properties_get_double( properties, "aspect_ratio" ) ); + + 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 );