[FFmpeg-cvslog] avcodec/libmp3lame: do not attempt to flush lame if no data was input

Michael Niedermayer git at videolan.org
Mon May 19 18:33:57 CEST 2014


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Mon May 19 16:56:55 2014 +0200| [ebbc33a42d1d2f3a9b43444d66416284630bf2f4] | committer: Michael Niedermayer

avcodec/libmp3lame: do not attempt to flush lame if no data was input

this prevents the creation of a packet even though no single sample has ever
been input, which some confusion in the timestamp generation

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=ebbc33a42d1d2f3a9b43444d66416284630bf2f4
---

 libavcodec/libmp3lame.c |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavcodec/libmp3lame.c b/libavcodec/libmp3lame.c
index e6cb64b..a8c39cc 100644
--- a/libavcodec/libmp3lame.c
+++ b/libavcodec/libmp3lame.c
@@ -208,6 +208,8 @@ static int mp3lame_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
         default:
             return AVERROR_BUG;
         }
+    } else if (!s->afq.frame_alloc) {
+        lame_result = 0;
     } else {
         lame_result = lame_encode_flush(s->gfp, s->buffer + s->buffer_index,
                                         s->buffer_size - s->buffer_index);



More information about the ffmpeg-cvslog mailing list