[FFmpeg-devel] [PATCH] Treat FLV packets with AVCPacketType zero as extradata

Amarghosh Vadakkoot amarghosh at google.com
Wed Aug 21 08:16:29 CEST 2013


If the first byte of an FLV packet carrying AVC video is zero, that
packet carries AVCDecoderConfigurationRecord instead of NAL units.
Treat such packets as extra data instead of normal video data. This
is applicable for AAC packets as well, and is already handled as such.

Signed-off-by: Amarghosh Vadakkoot <amarghosh at google.com>
---
 libavformat/flvdec.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/libavformat/flvdec.c b/libavformat/flvdec.c
index e0b79bb..5d5f77b 100644
--- a/libavformat/flvdec.c
+++ b/libavformat/flvdec.c
@@ -895,7 +895,9 @@ retry_duration:
             if (flv->wrong_dts)
                 dts = AV_NOPTS_VALUE;
         }
-        if (type == 0 && (!st->codec->extradata || st->codec->codec_id == AV_CODEC_ID_AAC)) {
+        // type zero indicates AudioSpecificConfig for AAC and DecoderConfigurationRecord for AVC
+        if (type == 0 && (!st->codec->extradata || st->codec->codec_id == AV_CODEC_ID_AAC ||
+                st->codec->codec_id == AV_CODEC_ID_H264)) {
             if (st->codec->extradata) {
                 if ((ret = flv_queue_extradata(flv, s->pb, stream_type, size)) < 0)
                     return ret;
-- 
1.8.3



More information about the ffmpeg-devel mailing list