]> git.sesse.net Git - mlt/commitdiff
Extend recent fix for samples-per-frame to the flush stage.
authorDan Dennedy <dan@dennedy.org>
Sat, 30 Mar 2013 04:31:06 +0000 (21:31 -0700)
committerDan Dennedy <dan@dennedy.org>
Sat, 30 Mar 2013 04:31:06 +0000 (21:31 -0700)
src/modules/avformat/consumer_avformat.c

index 2bde65bf4b1519b0a9c157df6a807b269c18ea7b..eb8101106df5c12292165d63767d4b6d0559606d 100644 (file)
@@ -1936,6 +1936,7 @@ static void *consumer_thread( void *arg )
 #endif
 #if LIBAVCODEC_VERSION_MAJOR >= 55
                                pkt.size = audio_outbuf_size;
+                               audio_avframe->nb_samples = audio_input_nb_samples;
                                avcodec_fill_audio_frame( audio_avframe, c->channels, c->sample_fmt,
                                        (const uint8_t*) p, AUDIO_ENCODE_BUFFER_SIZE, 0 );
                                int got_packet = 0;
@@ -1945,6 +1946,7 @@ static void *consumer_thread( void *arg )
                                else if ( !got_packet )
                                        pkt.size = 0;
 #else
+                               codec->frame_size = audio_input_nb_samples;
                                pkt.size = avcodec_encode_audio( c, audio_outbuf, audio_outbuf_size, p );
 #endif
 #if LIBAVUTIL_VERSION_INT >= ((51<<16)+(17<<8)+0)