[FFmpeg-cvslog] avformat/adtsenc: add adts_init()
James Almer
git at videolan.org
Sun Jan 14 15:13:29 EET 2018
ffmpeg | branch: master | James Almer <jamrial at gmail.com> | Mon May 29 18:12:51 2017 -0300| [02dba49dd3f02c0b2d4f4740597a3062d6c4981c] | committer: James Almer
avformat/adtsenc: add adts_init()
Signed-off-by: James Almer <jamrial at gmail.com>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=02dba49dd3f02c0b2d4f4740597a3062d6c4981c
---
libavformat/adtsenc.c | 15 ++++++++++++---
1 file 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,
More information about the ffmpeg-cvslog
mailing list