[FFmpeg-cvslog] Revert "flvenc: Remove apparently unneeded AAC check."

Michael Niedermayer git at videolan.org
Mon Mar 12 21:15:45 CET 2012


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Mon Mar 12 20:36:51 2012 +0100| [b0a0e83aee01bfecd8b789789d8522750f6ce9de] | committer: Michael Niedermayer

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.

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

 libavformat/flvenc.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/libavformat/flvenc.c b/libavformat/flvenc.c
index a6dab06..d4820f4 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;



More information about the ffmpeg-cvslog mailing list