diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-03-12 20:36:51 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-03-12 20:42:25 +0100 |
commit | b0a0e83aee01bfecd8b789789d8522750f6ce9de (patch) | |
tree | 93914df0e42a6b871a05b06160abd391bf0d58a9 | |
parent | 4fe544879006daea3db9a9d3e0d849187f86376b (diff) | |
download | ffmpeg-b0a0e83aee01bfecd8b789789d8522750f6ce9de.tar.gz |
Revert "flvenc: Remove apparently unneeded AAC check."
According to video_file_format_spec_v10_1.pdf flv stores AAC RAW
thanks to Baptiste Coudurier for pointing that out
thanks to Aℓex Converse for explaining:
This can't be at the start of a non-ADTS payload. 111 is the
EndOfFrame syntax element.
Together these proof that the check was correctly rejecting ADTS which
is not supposed to be in flv. Many players are able to play such ADTS
in flv though but its better if we conform to the spec as this should
ensure that not many but all players can play files generated by ffmpeg.
This reverts commit 3c9a86df0e20dd1c90a9b390a6555b22f87aa8cd.
-rw-r--r-- | libavformat/flvenc.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/libavformat/flvenc.c b/libavformat/flvenc.c index a6dab06875..d4820f4f58 100644 --- a/libavformat/flvenc.c +++ b/libavformat/flvenc.c @@ -445,6 +445,10 @@ static int flv_write_packet(AVFormatContext *s, AVPacket *pkt) if (ff_avc_parse_nal_units_buf(pkt->data, &data, &size) < 0) return -1; } + } else if (enc->codec_id == CODEC_ID_AAC && pkt->size > 2 && + (AV_RB16(pkt->data) & 0xfff0) == 0xfff0) { + av_log(s, AV_LOG_ERROR, "malformated aac bitstream, use -absf aac_adtstoasc\n"); + return -1; } if (flv->delay == AV_NOPTS_VALUE) flv->delay = -pkt->dts; |