[FFmpeg-cvslog] vorbis: parse out setup headers as well

Ben Boeckel git at videolan.org
Mon Feb 2 03:53:52 CET 2015


ffmpeg | branch: master | Ben Boeckel <mathstuf at gmail.com> | Sun Feb  1 20:00:02 2015 -0500| [1fe94ea79eb749ea4978596d34d76421272288ea] | committer: Michael Niedermayer

vorbis: parse out setup headers as well

Prevents an 'Invalid packet' message. Currently mid-stream setup packets
are ignored. Theoretically, they could, based on the specification, be used to
reinitialize the stream if parameters change, but I don't expect that to be
common (and no one seems to have asked for it).

Signed-off-by: Ben Boeckel <mathstuf at gmail.com>
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

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

 libavcodec/vorbis_parser.c |    2 ++
 libavcodec/vorbis_parser.h |    1 +
 2 files changed, 3 insertions(+)

diff --git a/libavcodec/vorbis_parser.c b/libavcodec/vorbis_parser.c
index 547fd47..8fa6d99 100644
--- a/libavcodec/vorbis_parser.c
+++ b/libavcodec/vorbis_parser.c
@@ -229,6 +229,8 @@ int av_vorbis_parse_frame_flags(AVVorbisParseContext *s, const uint8_t *buf,
                 *flags |= VORBIS_FLAG_HEADER;
             else if (buf[0] == 3)
                 *flags |= VORBIS_FLAG_COMMENT;
+            else if (buf[0] == 5)
+                *flags |= VORBIS_FLAG_SETUP;
             else
                 goto bad_packet;
 
diff --git a/libavcodec/vorbis_parser.h b/libavcodec/vorbis_parser.h
index 0f73537..06e48bd 100644
--- a/libavcodec/vorbis_parser.h
+++ b/libavcodec/vorbis_parser.h
@@ -47,6 +47,7 @@ void av_vorbis_parse_free(AVVorbisParseContext **s);
 
 #define VORBIS_FLAG_HEADER  0x00000001
 #define VORBIS_FLAG_COMMENT 0x00000002
+#define VORBIS_FLAG_SETUP   0x00000004
 
 /**
  * Get the duration for a Vorbis packet.



More information about the ffmpeg-cvslog mailing list