diff mbox

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

Message ID 1474910019-13882-3-git-send-email-jtoohill@google.com
State Superseded
Headers show

Commit Message

Jon Toohill Sept. 26, 2016, 5:13 p.m. UTC
---
 libavcodec/libmp3lame.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Carl Eugen Hoyos Sept. 27, 2016, 8:04 a.m. UTC | #1
2016-09-26 19:13 GMT+02:00 Jon Toohill <jtoohill-at-google.com@ffmpeg.org>:

> +        avctx->trailing_padding = FFMAX(lame_get_encoder_padding(s->gfp) - 528 - 1, 0);

Can you confirm that this function exists in lame 3.98.3?

Thank you, Carl Eugen
Jon Toohill Sept. 28, 2016, 6:21 p.m. UTC | #2
On Tue, Sep 27, 2016 at 1:04 AM, Carl Eugen Hoyos <ceffmpeg@gmail.com>
wrote:

> 2016-09-26 19:13 GMT+02:00 Jon Toohill <jtoohill-at-google.com@ffmpeg.org
> >:
>
> > +        avctx->trailing_padding = FFMAX(lame_get_encoder_padding(s->gfp)
> - 528 - 1, 0);
>
> Can you confirm that this function exists in lame 3.98.3?
>

I downloaded the source tarball for lame 3.98 and found it exists there. Is
that sufficient?


>
> Thank you, Carl Eugen
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
Carl Eugen Hoyos Sept. 29, 2016, 1:06 p.m. UTC | #3
2016-09-28 20:21 GMT+02:00 Jon Toohill <jtoohill-at-google.com@ffmpeg.org>:
> On Tue, Sep 27, 2016 at 1:04 AM, Carl Eugen Hoyos <ceffmpeg@gmail.com>
> wrote:
>
>> 2016-09-26 19:13 GMT+02:00 Jon Toohill <jtoohill-at-google.com@ffmpeg.org
>> >:
>>
>> > +        avctx->trailing_padding = FFMAX(lame_get_encoder_padding(s->gfp)
>> - 528 - 1, 0);
>>
>> Can you confirm that this function exists in lame 3.98.3?
>>
>
> I downloaded the source tarball for lame 3.98 and found it exists there. Is
> that sufficient?

Definitely, I just wanted to make sure.

Thank you, Carl Eugen
diff mbox

Patch

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) {