diff options
author | David Conrad <lessen42@gmail.com> | 2009-03-21 11:22:09 +0300 |
---|---|---|
committer | David Conrad <lessen42@gmail.com> | 2009-03-21 11:22:09 +0300 |
commit | 6e6abd0237dc669d9f35f151251e361031343c1e (patch) | |
tree | d3b8b27c02a4a2b0327024b5c8f11bcdd5b1a5d7 /libavformat | |
parent | 1fa9726cf6442879ebb61452d30d240d710e3580 (diff) |
Fix Speex header parsing in ogg demuxer
Originally committed as revision 18101 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat')
-rw-r--r-- | libavformat/oggparsespeex.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/libavformat/oggparsespeex.c b/libavformat/oggparsespeex.c index eb7709cddd..19789e0930 100644 --- a/libavformat/oggparsespeex.c +++ b/libavformat/oggparsespeex.c @@ -36,9 +36,10 @@ static int speex_header(AVFormatContext *s, int idx) { AVStream *st = s->streams[idx]; uint8_t *p = os->buf + os->pstart; - if (os->psize < 80) - return 1; + if (os->seq > 1) + return 0; + if (os->seq == 0) { st->codec->codec_type = CODEC_TYPE_AUDIO; st->codec->codec_id = CODEC_ID_SPEEX; @@ -50,8 +51,10 @@ static int speex_header(AVFormatContext *s, int idx) { st->time_base.num = 1; st->time_base.den = st->codec->sample_rate; + } else + vorbis_comment(s, p, os->psize); - return 0; + return 1; } const struct ogg_codec ff_speex_codec = { |