Mercurial > libavformat.hg
changeset 4765:6ab95f681099 libavformat
Fix Speex header parsing in ogg demuxer
author | conrad |
---|---|
date | Sat, 21 Mar 2009 08:22:09 +0000 |
parents | c6abeafbec30 |
children | 6567b8869917 |
files | oggparsespeex.c |
diffstat | 1 files changed, 6 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/oggparsespeex.c Sat Mar 21 08:03:30 2009 +0000 +++ b/oggparsespeex.c Sat Mar 21 08:22:09 2009 +0000 @@ -36,9 +36,10 @@ 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 @@ 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 = {