aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/libmp3lame.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-05-19 16:56:55 +0200
committerMichael Niedermayer <michaelni@gmx.at>2014-05-19 17:37:26 +0200
commitebbc33a42d1d2f3a9b43444d66416284630bf2f4 (patch)
tree22d3dc50864d2c17804d41c8cf99e95441013f36 /libavcodec/libmp3lame.c
parent6552e23d560c099d4a79976327432ae0a1b997dc (diff)
downloadffmpeg-ebbc33a42d1d2f3a9b43444d66416284630bf2f4.tar.gz
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@gmx.at>
Diffstat (limited to 'libavcodec/libmp3lame.c')
-rw-r--r--libavcodec/libmp3lame.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libavcodec/libmp3lame.c b/libavcodec/libmp3lame.c
index e6cb64b876..a8c39cc6c7 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);