Commit ebbc33a4 authored by Michael Niedermayer's avatar 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: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 6552e23d
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment