X-Git-Url: http://research.m1stereo.tv/gitweb?a=blobdiff_plain;f=src%2Fmodules%2Favformat%2Fproducer_avformat.c;h=0648bde494984209c8baa8ff1afdf86d4d31221c;hb=6c11ad6f5bbb63d6c29baf78d8a3e9321a769361;hp=9491d64e00a643af16c772f64e1be94d8471bcd1;hpb=a37825205aa620f77dcedc7d8fab98b406ddd19f;p=melted diff --git a/src/modules/avformat/producer_avformat.c b/src/modules/avformat/producer_avformat.c index 9491d64..0648bde 100644 --- a/src/modules/avformat/producer_avformat.c +++ b/src/modules/avformat/producer_avformat.c @@ -572,7 +572,9 @@ static int producer_get_image( mlt_frame frame, uint8_t **buffer, mlt_image_form } // Duplicate the last image if necessary (see comment on rawvideo below) - if ( av_frame != NULL && ( paused || mlt_properties_get_int( properties, "_current_position" ) >= req_position ) && av_bypass == 0 ) + int current_position = mlt_properties_get_int( properties, "_current_position" ); + int got_picture = mlt_properties_get_int( properties, "_got_picture" ); + if ( av_frame != NULL && got_picture && ( paused || current_position >= req_position ) && av_bypass == 0 ) { // Duplicate it convert_image( av_frame, *buffer, codec_context->pix_fmt, *format, *width, *height ); @@ -583,8 +585,8 @@ static int producer_get_image( mlt_frame frame, uint8_t **buffer, mlt_image_form else { int ret = 0; - int got_picture = 0; int int_position = 0; + got_picture = 0; av_init_packet( &pkt ); @@ -653,6 +655,7 @@ static int producer_get_image( mlt_frame frame, uint8_t **buffer, mlt_image_form convert_image( av_frame, *buffer, codec_context->pix_fmt, *format, *width, *height ); mlt_properties_set_data( frame_properties, "image", *buffer, size, (mlt_destructor)mlt_pool_release, NULL ); mlt_properties_set_int( properties, "_current_position", int_position ); + mlt_properties_set_int( properties, "_got_picture", 1 ); } // We're finished with this packet regardless