aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/adtsenc.c
diff options
context:
space:
mode:
authorJames Almer <jamrial@gmail.com>2017-05-29 18:12:51 -0300
committerJames Almer <jamrial@gmail.com>2018-01-14 09:57:42 -0300
commit02dba49dd3f02c0b2d4f4740597a3062d6c4981c (patch)
treef19139ffc4cf491127f94e46c19d927ec28c1e03 /libavformat/adtsenc.c
parentc51301db14fe08bf9f5c3b4f9e588e04095f9ac1 (diff)
downloadffmpeg-02dba49dd3f02c0b2d4f4740597a3062d6c4981c.tar.gz
avformat/adtsenc: add adts_init()
Signed-off-by: James Almer <jamrial@gmail.com>
Diffstat (limited to 'libavformat/adtsenc.c')
-rw-r--r--libavformat/adtsenc.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/libavformat/adtsenc.c b/libavformat/adtsenc.c
index a24f99c447..c24572f160 100644
--- a/libavformat/adtsenc.c
+++ b/libavformat/adtsenc.c
@@ -94,13 +94,11 @@ static int adts_decode_extradata(AVFormatContext *s, ADTSContext *adts, const ui
return 0;
}
-static int adts_write_header(AVFormatContext *s)
+static int adts_init(AVFormatContext *s)
{
ADTSContext *adts = s->priv_data;
AVCodecParameters *par = s->streams[0]->codecpar;
- if (adts->id3v2tag)
- ff_id3v2_write_simple(s, 4, ID3v2_DEFAULT_MAGIC);
if (par->extradata_size > 0)
return adts_decode_extradata(s, adts, par->extradata,
par->extradata_size);
@@ -108,6 +106,16 @@ static int adts_write_header(AVFormatContext *s)
return 0;
}
+static int adts_write_header(AVFormatContext *s)
+{
+ ADTSContext *adts = s->priv_data;
+
+ if (adts->id3v2tag)
+ ff_id3v2_write_simple(s, 4, ID3v2_DEFAULT_MAGIC);
+
+ return 0;
+}
+
static int adts_write_frame_header(ADTSContext *ctx,
uint8_t *buf, int size, int pce_size)
{
@@ -220,6 +228,7 @@ AVOutputFormat ff_adts_muxer = {
.priv_data_size = sizeof(ADTSContext),
.audio_codec = AV_CODEC_ID_AAC,
.video_codec = AV_CODEC_ID_NONE,
+ .init = adts_init,
.write_header = adts_write_header,
.write_packet = adts_write_packet,
.write_trailer = adts_write_trailer,