Remove some OP_UNLIKELY macros.
authorTimothy B. Terriberry <tterribe@xiph.org>
Thu, 29 Aug 2013 06:58:40 +0000 (23:58 -0700)
committerTimothy B. Terriberry <tterribe@xiph.org>
Tue, 3 Sep 2013 22:03:03 +0000 (15:03 -0700)
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.

src/opusfile.c

index 7eda14a..62aa1d5 100644 (file)
@@ -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;