diff options
author | Carl Eugen Hoyos <cehoyos@ag.or.at> | 2011-09-08 08:22:50 +0200 |
---|---|---|
committer | Carl Eugen Hoyos <cehoyos@ag.or.at> | 2011-09-08 08:22:50 +0200 |
commit | c1fcd7e1ab1d77b67e66d7b6a27c104613c0187a (patch) | |
tree | 543561f328f5d6441e4ab9ca3b7f63f58f2e3c73 | |
parent | 1da43f7e9927af8b0dede710adf68d3cc762df64 (diff) | |
download | ffmpeg-c1fcd7e1ab1d77b67e66d7b6a27c104613c0187a.tar.gz |
Support remuxing aac_latm.
-rw-r--r-- | libavformat/latmenc.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/libavformat/latmenc.c b/libavformat/latmenc.c index 8d67b5a615..9f5377cb37 100644 --- a/libavformat/latmenc.c +++ b/libavformat/latmenc.c @@ -25,6 +25,7 @@ #include "libavcodec/mpeg4audio.h" #include "libavutil/opt.h" #include "avformat.h" +#include "rawenc.h" typedef struct { int off; @@ -75,6 +76,9 @@ 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) + return 0; + if (avctx->extradata_size > 0 && latm_decode_extradata(ctx, avctx->extradata, avctx->extradata_size) < 0) return AVERROR_INVALIDDATA; @@ -135,6 +139,9 @@ static int latm_write_packet(AVFormatContext *s, AVPacket *pkt) uint8_t loas_header[] = "\x56\xe0\x00"; uint8_t *buf; + if (s->streams[0]->codec->codec_id == CODEC_ID_AAC_LATM) + return ff_raw_write_packet(s, pkt); + if (pkt->size > 2 && pkt->data[0] == 0xff && (pkt->data[1] >> 4) == 0xf) { av_log(s, AV_LOG_ERROR, "ADTS header detected - ADTS will not be incorrectly muxed into LATM\n"); return AVERROR_INVALIDDATA; |