The LATM raw demuxer produces matching extradata through the LATM parser
but has still a LATM encapsulated bitstream.
---
 libavformat/latmenc.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/libavformat/latmenc.c b/libavformat/latmenc.c
index 8d67b5a..ea17870 100644
--- a/libavformat/latmenc.c
+++ b/libavformat/latmenc.c
@@ -75,6 +75,11 @@ static int latm_write_header(AVFormatContext *s)
     LATMContext *ctx = s->priv_data;
     AVCodecContext *avctx = s->streams[0]->codec;
 
+    if (avctx->codec_id == CODEC_ID_AAC_LATM) {
+        av_log(s, AV_LOG_ERROR, "Trying to mux LATM data into LATM.\n");
+        return AVERROR_INVALIDDATA;
+    }
+
     if (avctx->extradata_size > 0 &&
         latm_decode_extradata(ctx, avctx->extradata, avctx->extradata_size) < 
0)
         return AVERROR_INVALIDDATA;
-- 
1.7.6.1

_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to