aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/adtsenc.c
diff options
context:
space:
mode:
authorMarvin Scholz <epirat07@gmail.com>2020-08-29 13:57:13 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2020-08-30 16:18:37 +0200
commitff4cc8c65458eb4494a0a1a8ff136dcf85a0f4d0 (patch)
tree09b043c173622d6ca85b6ee43500d9648557729f /libavformat/adtsenc.c
parent2359656da2e5a8a191e49fdc667d04c16ff0ea7b (diff)
downloadffmpeg-ff4cc8c65458eb4494a0a1a8ff136dcf85a0f4d0.tar.gz
adtsenc: Add ability to write MPEG2 ID
Reviewed-by: Kieran Kunhya <kierank@obe.tv> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavformat/adtsenc.c')
-rw-r--r--libavformat/adtsenc.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libavformat/adtsenc.c b/libavformat/adtsenc.c
index 9e285752eb..44ff5a70ee 100644
--- a/libavformat/adtsenc.c
+++ b/libavformat/adtsenc.c
@@ -40,6 +40,7 @@ typedef struct ADTSContext {
int pce_size;
int apetag;
int id3v2tag;
+ int mpeg_id;
uint8_t pce_data[MAX_PCE_SIZE];
} ADTSContext;
@@ -136,7 +137,7 @@ static int adts_write_frame_header(ADTSContext *ctx,
/* adts_fixed_header */
put_bits(&pb, 12, 0xfff); /* syncword */
- put_bits(&pb, 1, 0); /* ID */
+ put_bits(&pb, 1, ctx->mpeg_id); /* ID */
put_bits(&pb, 2, 0); /* layer */
put_bits(&pb, 1, 1); /* protection_absent */
put_bits(&pb, 2, ctx->objecttype); /* profile_objecttype */
@@ -214,6 +215,7 @@ static int adts_write_trailer(AVFormatContext *s)
static const AVOption options[] = {
{ "write_id3v2", "Enable ID3v2 tag writing", OFFSET(id3v2tag), AV_OPT_TYPE_BOOL, {.i64 = 0}, 0, 1, ENC},
{ "write_apetag", "Enable APE tag writing", OFFSET(apetag), AV_OPT_TYPE_BOOL, {.i64 = 0}, 0, 1, ENC},
+ { "write_mpeg2", "Use MPE2 ID when writing", OFFSET(mpeg_id), AV_OPT_TYPE_BOOL, {.i64 = 0}, 0, 1, ENC, "mpeg_id"},
{ NULL },
};