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

Remove some OP_UNLIKELY macros.

These were unlikely when I originally expected applications to
 normally provide a decode buffer in the right format of sufficient
 size.
However, the decode filter API works by asking to decode into a
 0-byte buffer, which will trigger both of these tests on every
 packet.
Since this is how three of the four decoding APIs are implemented,
 this is not really that unlikely anymore.
parent a5a99116
......@@ -2638,10 +2638,8 @@ static int op_read_native(OggOpusFile *_of,
od_buffer_pos=_of->od_buffer_pos;
nsamples=_of->od_buffer_size-od_buffer_pos;
/*If we have buffered samples, return them.*/
if(OP_UNLIKELY(nsamples>0)){
if(OP_UNLIKELY(nsamples*nchannels>_buf_size)){
nsamples=_buf_size/nchannels;
}
if(nsamples>0){
if(nsamples*nchannels>_buf_size)nsamples=_buf_size/nchannels;
memcpy(_pcm,_of->od_buffer+nchannels*od_buffer_pos,
sizeof(*_pcm)*nchannels*nsamples);
od_buffer_pos+=nsamples;
......
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