Commit ee911775 authored by Timothy B. Terriberry's avatar Timothy B. Terriberry
Browse files

Fix header reading for non-Opus streams.

We were skipping the BOS page for non-Opus streams, but never read
 in the next page, causing setup to fail with a duplicate serial
 number validation error.
Thanks to Lithopsian for the report.
parent 773cd69e
...@@ -496,13 +496,14 @@ static int op_fetch_headers_impl(OggOpusFile *_of,OpusHead *_head, ...@@ -496,13 +496,14 @@ static int op_fetch_headers_impl(OggOpusFile *_of,OpusHead *_head,
ogg_stream_pagein(&_of->os,_og); ogg_stream_pagein(&_of->os,_og);
if(OP_LIKELY(ogg_stream_packetout(&_of->os,&op)>0)){ if(OP_LIKELY(ogg_stream_packetout(&_of->os,&op)>0)){
ret=opus_head_parse(_head,op.packet,op.bytes); ret=opus_head_parse(_head,op.packet,op.bytes);
/*If it's just a stream type we don't recognize, ignore it.*/ if(OP_UNLIKELY(ret<0)){
if(ret==OP_ENOTFORMAT)continue; /*If it's just a stream type we don't recognize, ignore it.
/*Everything else is fatal.*/ Everything else is fatal.*/
if(OP_UNLIKELY(ret<0))return ret; if(ret!=OP_ENOTFORMAT)return ret;
/*Found a valid Opus header. /*Found a valid Opus header.
Continue setup.*/ Continue setup.*/
_of->ready_state=OP_STREAMSET; else _of->ready_state=OP_STREAMSET;
} }
} }
/*Get the next page. /*Get the next page.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment