[FFmpeg-cvslog] mp3dec: export replaygain tags from ID3v2

Anton Khirnov git at videolan.org
Mon Mar 24 15:15:45 CET 2014


ffmpeg | branch: master | Anton Khirnov <anton at khirnov.net> | Wed Feb 19 21:02:12 2014 +0100| [15c5a8d22d12d29a364ca2ab6438f1dee2fa08c7] | committer: Anton Khirnov

mp3dec: export replaygain tags from ID3v2

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

 Changelog            |    1 +
 libavformat/Makefile |    2 +-
 libavformat/mp3dec.c |    7 +++++++
 3 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/Changelog b/Changelog
index 5c67e11..76eca07 100644
--- a/Changelog
+++ b/Changelog
@@ -4,6 +4,7 @@ releases are sorted from youngest to oldest.
 version <next>:
 - libx265 encoder
 - shuffleplanes filter
+- replaygain data export
 
 
 version 10:
diff --git a/libavformat/Makefile b/libavformat/Makefile
index 5694314..7ab30aa 100644
--- a/libavformat/Makefile
+++ b/libavformat/Makefile
@@ -182,7 +182,7 @@ OBJS-$(CONFIG_MOV_DEMUXER)               += mov.o isom.o mov_chan.o
 OBJS-$(CONFIG_MOV_MUXER)                 += movenc.o isom.o avc.o hevc.o \
                                             movenchint.o mov_chan.o
 OBJS-$(CONFIG_MP2_MUXER)                 += mp3enc.o rawenc.o id3v2enc.o
-OBJS-$(CONFIG_MP3_DEMUXER)               += mp3dec.o
+OBJS-$(CONFIG_MP3_DEMUXER)               += mp3dec.o replaygain.o
 OBJS-$(CONFIG_MP3_MUXER)                 += mp3enc.o rawenc.o id3v2enc.o
 OBJS-$(CONFIG_MPC_DEMUXER)               += mpc.o apetag.o img2.o
 OBJS-$(CONFIG_MPC8_DEMUXER)              += mpc8.o apetag.o img2.o
diff --git a/libavformat/mp3dec.c b/libavformat/mp3dec.c
index 5c263ed..414c7e9 100644
--- a/libavformat/mp3dec.c
+++ b/libavformat/mp3dec.c
@@ -27,6 +27,8 @@
 #include "internal.h"
 #include "id3v2.h"
 #include "id3v1.h"
+#include "replaygain.h"
+
 #include "libavcodec/mpegaudiodecheader.h"
 
 #define XING_FLAG_FRAMES 0x01
@@ -194,6 +196,7 @@ static int mp3_read_header(AVFormatContext *s)
 {
     AVStream *st;
     int64_t off;
+    int ret;
 
     st = avformat_new_stream(s, NULL);
     if (!st)
@@ -215,6 +218,10 @@ static int mp3_read_header(AVFormatContext *s)
     if (mp3_parse_vbr_tags(s, st, off) < 0)
         avio_seek(s->pb, off, SEEK_SET);
 
+    ret = ff_replaygain_export(st, s->metadata);
+    if (ret < 0)
+        return ret;
+
     /* the parameters will be extracted from the compressed bitstream */
     return 0;
 }



More information about the ffmpeg-cvslog mailing list