shithub: opus

Download patch

ref: f0cea0d23767cd1dab1dd902622aeb7efa53b669
parent: 2b249dda9a184188dc713043bdc9a367e9d1c034
author: Jean-Marc Valin <jmvalin@jmvalin.ca>
date: Mon Mar 26 09:48:39 EDT 2018

Misc assertion cleanup

--- a/src/opus_encoder.c
+++ b/src/opus_encoder.c
@@ -1737,7 +1737,7 @@
         } else if (curr_bandwidth == OPUS_BANDWIDTH_MEDIUMBAND) {
             st->silk_mode.desiredInternalSampleRate = 12000;
         } else {
-            silk_assert( st->mode == MODE_HYBRID || curr_bandwidth == OPUS_BANDWIDTH_WIDEBAND );
+            celt_assert( st->mode == MODE_HYBRID || curr_bandwidth == OPUS_BANDWIDTH_WIDEBAND );
             st->silk_mode.desiredInternalSampleRate = 16000;
         }
         if( st->mode == MODE_HYBRID ) {
@@ -1843,7 +1843,7 @@
                curr_bandwidth = OPUS_BANDWIDTH_WIDEBAND;
             }
         } else {
-            silk_assert( st->silk_mode.internalSampleRate == 16000 );
+            celt_assert( st->silk_mode.internalSampleRate == 16000 );
         }
 
         st->silk_mode.opusCanSwitch = st->silk_mode.switchReady && !st->nonfinal_frame;
--- a/src/repacketizer.c
+++ b/src/repacketizer.c
@@ -213,7 +213,8 @@
    {
       /* Using OPUS_MOVE() instead of OPUS_COPY() in case we're doing in-place
          padding from opus_packet_pad or opus_packet_unpad(). */
-      celt_assert(frames[i] + len[i] <= data || ptr <= frames[i]);
+      /* assert disabled because it's not valid in C. */
+      /* celt_assert(frames[i] + len[i] <= data || ptr <= frames[i]); */
       OPUS_MOVE(ptr, frames[i], len[i]);
       ptr += len[i];
    }