[FFmpeg-devel] [PATCH] mpegtsenc: Support AAC packet which does not contain extradata

Hagen Schmidt schmidthagen at googlemail.com
Sun Nov 22 00:55:29 CET 2015


extradata_size is checked by adts_write_header().
Fixes ticket 279.
---
 libavformat/mpegtsenc.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/libavformat/mpegtsenc.c b/libavformat/mpegtsenc.c
index 468bad4..b1ac627 100644
--- a/libavformat/mpegtsenc.c
+++ b/libavformat/mpegtsenc.c
@@ -809,8 +809,7 @@ static int mpegts_write_header(AVFormatContext *s)
             service->pcr_pid = ts_st->pid;
             pcr_st           = st;
         }
-        if (st->codec->codec_id == AV_CODEC_ID_AAC &&
-            st->codec->extradata_size > 0) {
+        if (st->codec->codec_id == AV_CODEC_ID_AAC) {
             AVStream *ast;
             ts_st->amux = avformat_alloc_context();
             if (!ts_st->amux) {
@@ -1490,8 +1489,7 @@ static int mpegts_write_packet_internal(AVFormatContext *s, AVPacket *pkt)
             AVPacket pkt2;
 
             if (!ts_st->amux) {
-                av_log(s, AV_LOG_ERROR, "AAC bitstream not in ADTS format "
-                                        "and extradata missing\n");
+                av_log(s, AV_LOG_ERROR, "AAC bitstream not in ADTS format\n");
                 if (!st->nb_frames)
                     return AVERROR_INVALIDDATA;
             } else {
-- 
2.6.2



More information about the ffmpeg-devel mailing list