[FFmpeg-devel] [PATCH] lavf/adtsenc: Add support for APE tags

James Almer jamrial at gmail.com
Thu Jul 11 21:24:01 CEST 2013


Should fix ticket #2269

Signed-off-by: James Almer <jamrial at gmail.com>
---
 libavformat/Makefile  | 2 +-
 libavformat/adtsenc.c | 9 +++++++++
 2 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/libavformat/Makefile b/libavformat/Makefile
index 3c4a3c8..2d246bf 100644
--- a/libavformat/Makefile
+++ b/libavformat/Makefile
@@ -60,7 +60,7 @@ OBJS-$(CONFIG_ADF_DEMUXER)               += bintext.o sauce.o
 OBJS-$(CONFIG_ADP_DEMUXER)               += adp.o
 OBJS-$(CONFIG_ADX_DEMUXER)               += adxdec.o
 OBJS-$(CONFIG_ADX_MUXER)                 += rawenc.o
-OBJS-$(CONFIG_ADTS_MUXER)                += adtsenc.o
+OBJS-$(CONFIG_ADTS_MUXER)                += adtsenc.o apetag.o
 OBJS-$(CONFIG_AEA_DEMUXER)               += aea.o pcm.o
 OBJS-$(CONFIG_AFC_DEMUXER)               += afc.o
 OBJS-$(CONFIG_AIFF_DEMUXER)              += aiffdec.o pcm.o isom.o \
diff --git a/libavformat/adtsenc.c b/libavformat/adtsenc.c
index 60d7b07..7118105 100644
--- a/libavformat/adtsenc.c
+++ b/libavformat/adtsenc.c
@@ -25,6 +25,7 @@
 #include "libavcodec/avcodec.h"
 #include "libavcodec/mpeg4audio.h"
 #include "avformat.h"
+#include "apetag.h"
 
 #define ADTS_HEADER_SIZE 7
 
@@ -162,6 +163,13 @@ static int adts_write_packet(AVFormatContext *s, AVPacket *pkt)
     return 0;
 }
 
+static int adts_write_trailer(AVFormatContext *s)
+{
+    ff_ape_write_tag(s);
+
+    return 0;
+}
+
 AVOutputFormat ff_adts_muxer = {
     .name              = "adts",
     .long_name         = NULL_IF_CONFIG_SMALL("ADTS AAC (Advanced Audio Coding)"),
@@ -172,4 +180,5 @@ AVOutputFormat ff_adts_muxer = {
     .video_codec       = AV_CODEC_ID_NONE,
     .write_header      = adts_write_header,
     .write_packet      = adts_write_packet,
+    .write_trailer     = adts_write_trailer,
 };
-- 
1.8.1.5



More information about the ffmpeg-devel mailing list