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>
pull/68/head
Michael Niedermayer 11 years ago
parent 6552e23d56
commit ebbc33a42d
  1. 2
      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);

Loading…
Cancel
Save