From 9dd649c004f9dbb4ae818a7eef1fc4bfc2b9861e Mon Sep 17 00:00:00 2001 From: Clément Bœsch Date: Mon, 19 Mar 2012 14:49:04 +0100 Subject: flv: clarify use of video info/cmd frame. Also add generated key frame in the enum, and doxycomment the existing ones. Descriptions are directly taken from the public specifications. --- libavformat/flv.h | 8 +++++--- libavformat/flvdec.c | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/libavformat/flv.h b/libavformat/flv.h index ef8eaabb44..c9f7b83de0 100644 --- a/libavformat/flv.h +++ b/libavformat/flv.h @@ -110,9 +110,11 @@ enum { }; enum { - FLV_FRAME_KEY = 1 << FLV_VIDEO_FRAMETYPE_OFFSET, - FLV_FRAME_INTER = 2 << FLV_VIDEO_FRAMETYPE_OFFSET, - FLV_FRAME_DISP_INTER = 3 << FLV_VIDEO_FRAMETYPE_OFFSET, + FLV_FRAME_KEY = 1 << FLV_VIDEO_FRAMETYPE_OFFSET, ///< key frame (for AVC, a seekable frame) + FLV_FRAME_INTER = 2 << FLV_VIDEO_FRAMETYPE_OFFSET, ///< inter frame (for AVC, a non-seekable frame) + FLV_FRAME_DISP_INTER = 3 << FLV_VIDEO_FRAMETYPE_OFFSET, ///< disposable inter frame (H.263 only) + FLV_FRAME_GENERATED_KEY = 4 << FLV_VIDEO_FRAMETYPE_OFFSET, ///< generated key frame (reserved for server use only) + FLV_FRAME_VIDEO_INFO_CMD = 5 << FLV_VIDEO_FRAMETYPE_OFFSET, ///< video info/command frame }; typedef enum { diff --git a/libavformat/flvdec.c b/libavformat/flvdec.c index 8ae79501b4..94fd76d666 100644 --- a/libavformat/flvdec.c +++ b/libavformat/flvdec.c @@ -518,7 +518,7 @@ static int flv_read_packet(AVFormatContext *s, AVPacket *pkt) stream_type=FLV_STREAM_TYPE_VIDEO; flags = avio_r8(s->pb); size--; - if ((flags & 0xf0) == 0x50) /* video info / command frame */ + if ((flags & FLV_VIDEO_FRAMETYPE_MASK) == FLV_FRAME_VIDEO_INFO_CMD) goto skip; } else if (type == FLV_TAG_TYPE_META) { if (size > 13+1+4 && dts == 0) { // Header-type metadata stuff -- cgit v1.2.3