From: Dan Dennedy Date: Sat, 8 Oct 2011 17:52:08 +0000 (-0700) Subject: Merge branch 'master' of git://github.com/pez4brian/mlt into pez X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=dabc1da7aff8f1e4b305a4f9d88c1b36fb9df745;hp=05850adcdb704377ad50ca6b039a175f41dbaff9;p=mlt Merge branch 'master' of git://github.com/pez4brian/mlt into pez --- diff --git a/src/modules/avformat/producer_avformat.c b/src/modules/avformat/producer_avformat.c index 3829d202..49439f8c 100644 --- a/src/modules/avformat/producer_avformat.c +++ b/src/modules/avformat/producer_avformat.c @@ -2079,10 +2079,10 @@ static int decode_audio( producer_avformat self, int *ignore, AVPacket pkt, int // We are behind, so skip some *ignore = req_position - int_position; - // We use nb_streams in this test because the tolerance is dependent + // We use total_channels in this test because the tolerance is dependent // on the interleaving of all streams esp. when there is more than // one audio stream. - else if ( int_position > req_position + context->nb_streams ) + else if ( int_position > req_position + self->total_channels ) // We are ahead, so seek backwards some more seek_audio( self, req_position, timecode - 1.0, ignore ); } @@ -2552,9 +2552,11 @@ static void producer_avformat_close( producer_avformat self ) av_free( self->decode_buffer[i] ); if ( self->audio_codec[i] ) avcodec_close( self->audio_codec[i] ); + self->audio_codec[i] = NULL; } if ( self->video_codec ) avcodec_close( self->video_codec ); + self->video_codec = NULL; // Close the file if ( self->dummy_context ) av_close_input_file( self->dummy_context ); diff --git a/src/modules/kdenlive/producer_framebuffer.c b/src/modules/kdenlive/producer_framebuffer.c index 867a082e..e60c81d2 100644 --- a/src/modules/kdenlive/producer_framebuffer.c +++ b/src/modules/kdenlive/producer_framebuffer.c @@ -52,6 +52,7 @@ static int framebuffer_get_image( mlt_frame frame, uint8_t **image, mlt_image_fo int freeze = mlt_properties_get_int( properties, "freeze" ); int freeze_after = mlt_properties_get_int( properties, "freeze_after" ); int freeze_before = mlt_properties_get_int( properties, "freeze_before" ); + int in = mlt_properties_get_position( properties, "in" ); // Determine the position mlt_position first_position = (first_frame != NULL) ? mlt_frame_get_position( first_frame ) : -1; @@ -60,7 +61,7 @@ static int framebuffer_get_image( mlt_frame frame, uint8_t **image, mlt_image_fo if ( !freeze || freeze_after || freeze_before ) { double prod_speed = mlt_properties_get_double( properties, "_speed" ); - double actual_position = prod_speed * (double) mlt_producer_position( producer ); + double actual_position = in + prod_speed * (double) mlt_producer_position( producer ); if ( mlt_properties_get_int( properties, "reverse" ) ) actual_position = mlt_producer_get_playtime( producer ) - actual_position;