[FFmpeg-devel,2/4] lavc/libmp3lame: set trailing_padding after flushing encoder

Submitted by Jon Toohill on Sept. 28, 2016, 6:29 p.m.

Details

Message ID 1475087343-29745-4-git-send-email-jtoohill@google.com
State New
Headers show

Commit Message

Jon Toohill Sept. 28, 2016, 6:29 p.m.
---
 libavcodec/libmp3lame.c | 1 +
 1 file changed, 1 insertion(+)

Patch hide | download patch | download mbox

diff --git a/libavcodec/libmp3lame.c b/libavcodec/libmp3lame.c
index 5642264..1566921 100644
--- a/libavcodec/libmp3lame.c
+++ b/libavcodec/libmp3lame.c
@@ -218,6 +218,7 @@  static int mp3lame_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
     } else {
         lame_result = lame_encode_flush(s->gfp, s->buffer + s->buffer_index,
                                         s->buffer_size - s->buffer_index);
+        avctx->trailing_padding = FFMAX(lame_get_encoder_padding(s->gfp) - 528 - 1, 0);
     }
     if (lame_result < 0) {
         if (lame_result == -1) {