[FFmpeg-cvslog] avformat/flvdec: read the correct bits into the tag type

Steven Liu git at videolan.org
Thu Sep 4 15:17:09 CEST 2014


ffmpeg | branch: master | Steven Liu <lingjiujianke at gmail.com> | Thu Sep  4 20:23:19 2014 +0800| [03efd7308289a57fd60df96b2f79e7522dfe844e] | committer: Michael Niedermayer

avformat/flvdec: read the correct bits into the tag type

from the flv spec, the flvtag define the tagtype as one byte,
the spec desc is:
Reserved  UB[2] Reserved for FMS, should be 0
Filter    UB[1] Indicates if packets are filtered.
                0 = No pre-processing required.
                1 = Pre-processing (such as decryption) of the packet is
                    required before it can be rendered.
                    Shall be 0 in unencrypted files, and 1 for encrypted
tags.
                    See Annex F. FLV Encryption for the use of filters.
TagType   UB[5] Type of contents in this tag. The following types are
                defined:
                        8 = audio
                        9 = video
                        18 = script data

Signed-off-by: Steven Liu <qi.liu at chinacache.com>
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

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

 libavformat/flvdec.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/flvdec.c b/libavformat/flvdec.c
index 8d9ed8b..12d25b2 100644
--- a/libavformat/flvdec.c
+++ b/libavformat/flvdec.c
@@ -777,7 +777,7 @@ static int flv_read_packet(AVFormatContext *s, AVPacket *pkt)
     /* pkt size is repeated at end. skip it */
     for (;; avio_skip(s->pb, 4)) {
         pos  = avio_tell(s->pb);
-        type = avio_r8(s->pb);
+        type = (avio_r8(s->pb) & 0x1F);
         size = avio_rb24(s->pb);
         dts  = avio_rb24(s->pb);
         dts |= avio_r8(s->pb) << 24;



More information about the ffmpeg-cvslog mailing list