[FFmpeg-cvslog] lavf/mpegtsenc: Only fail aac muxing if the first frame is invalid.

Carl Eugen Hoyos git at videolan.org
Tue Jul 7 13:40:26 CEST 2015


ffmpeg | branch: master | Carl Eugen Hoyos <cehoyos at ag.or.at> | Tue Jul  7 10:44:46 2015 +0200| [1d5edad8ccfd1843bc8c60260a20ac37b738cb77] | committer: Carl Eugen Hoyos

lavf/mpegtsenc: Only fail aac muxing if the first frame is invalid.

Fixes ticket #3957.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=1d5edad8ccfd1843bc8c60260a20ac37b738cb77
---

 libavformat/mpegtsenc.c |    7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/libavformat/mpegtsenc.c b/libavformat/mpegtsenc.c
index 9efa9fc..09f62d6 100644
--- a/libavformat/mpegtsenc.c
+++ b/libavformat/mpegtsenc.c
@@ -1313,9 +1313,9 @@ static int mpegts_write_packet_internal(AVFormatContext *s, AVPacket *pkt)
             if (!ts_st->amux) {
                 av_log(s, AV_LOG_ERROR, "AAC bitstream not in ADTS format "
                                         "and extradata missing\n");
-                return AVERROR_INVALIDDATA;
-            }
-
+                if (!st->nb_frames)
+                    return AVERROR_INVALIDDATA;
+            } else {
             av_init_packet(&pkt2);
             pkt2.data = pkt->data;
             pkt2.size = pkt->size;
@@ -1334,6 +1334,7 @@ static int mpegts_write_packet_internal(AVFormatContext *s, AVPacket *pkt)
             size            = avio_close_dyn_buf(ts_st->amux->pb, &data);
             ts_st->amux->pb = NULL;
             buf             = data;
+            }
         }
     } else if (st->codec->codec_id == AV_CODEC_ID_HEVC) {
         int ret = check_hevc_startcode(s, st, pkt);



More information about the ffmpeg-cvslog mailing list