diff options
author | Dale Curtis <dalecurtis@chromium.org> | 2014-07-21 12:05:08 -0700 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2014-07-22 02:11:25 +0200 |
commit | 42f3bc40726593b309362853e1ef233b8efa50d5 (patch) | |
tree | 90f4b15f59e56977ff0d91033e0ad494ee96ce1a /libavformat | |
parent | c75c594e5a73a9e0368ff842bc837df3bfb866bd (diff) | |
download | ffmpeg-42f3bc40726593b309362853e1ef233b8efa50d5.tar.gz |
avformat/adtsenc: Optionally enable ID3 in ADTS.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat')
-rw-r--r-- | libavformat/adtsenc.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/libavformat/adtsenc.c b/libavformat/adtsenc.c index 58a7f2d89a..9ec1181177 100644 --- a/libavformat/adtsenc.c +++ b/libavformat/adtsenc.c @@ -27,6 +27,7 @@ #include "libavutil/opt.h" #include "avformat.h" #include "apetag.h" +#include "id3v2.h" #define ADTS_HEADER_SIZE 7 @@ -38,6 +39,7 @@ typedef struct { int channel_conf; int pce_size; int apetag; + int id3v2tag; uint8_t pce_data[MAX_PCE_SIZE]; } ADTSContext; @@ -97,6 +99,8 @@ static int adts_write_header(AVFormatContext *s) ADTSContext *adts = s->priv_data; AVCodecContext *avc = s->streams[0]->codec; + if (adts->id3v2tag) + ff_id3v2_write_simple(s, 4, ID3v2_DEFAULT_MAGIC); if (avc->extradata_size > 0 && adts_decode_extradata(s, adts, avc->extradata, avc->extradata_size) < 0) return -1; @@ -179,6 +183,7 @@ static int adts_write_trailer(AVFormatContext *s) #define ENC AV_OPT_FLAG_ENCODING_PARAM #define OFFSET(obj) offsetof(ADTSContext, obj) static const AVOption options[] = { + { "write_id3v2", "Enable ID3v2 tag writing", OFFSET(id3v2tag), AV_OPT_TYPE_INT, {.i64 = 0}, 0, 1, ENC}, { "write_apetag", "Enable APE tag writing", OFFSET(apetag), AV_OPT_TYPE_INT, {.i64 = 0}, 0, 1, ENC}, { NULL }, }; |