[FFmpeg-cvslog] mp3enc: write trailing padding

Anton Khirnov git at videolan.org
Fri Nov 18 11:52:19 EET 2016


ffmpeg | branch: master | Anton Khirnov <anton at khirnov.net> | Fri Jul  1 10:49:33 2016 +0200| [46278ec90ac5ad1dab5e85991f176afe49003fee] | committer: Anton Khirnov

mp3enc: write trailing padding

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=46278ec90ac5ad1dab5e85991f176afe49003fee
---

 libavformat/mp3enc.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/libavformat/mp3enc.c b/libavformat/mp3enc.c
index a62c7f6..1e2ff1a 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



More information about the ffmpeg-cvslog mailing list