From 46278ec90ac5ad1dab5e85991f176afe49003fee Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Fri, 1 Jul 2016 10:49:33 +0200 Subject: [PATCH] mp3enc: write trailing padding --- libavformat/mp3enc.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/libavformat/mp3enc.c b/libavformat/mp3enc.c index a62c7f6c8c..1e2ff1aa94 100644 --- a/libavformat/mp3enc.c +++ b/libavformat/mp3enc.c @@ -245,11 +245,12 @@ static void mp3_write_xing(AVFormatContext *s) avio_w8(dyn_ctx, 0); // unknown abr/minimal bitrate // encoder delay - if (par->initial_padding >= 1 << 12) { - av_log(s, AV_LOG_WARNING, "Too many samples of initial padding.\n"); + if (par->initial_padding >= 1 << 12 || + par->trailing_padding >= 1 << 12) { + av_log(s, AV_LOG_WARNING, "Too many samples of padding.\n"); avio_wb24(dyn_ctx, 0); } else { - avio_wb24(dyn_ctx, par->initial_padding << 12); + avio_wb24(dyn_ctx, par->initial_padding << 12 | par->trailing_padding); } avio_w8(dyn_ctx, 0); // misc