shithub: opus-tools

Download patch

ref: f456150b74e6a86ff8dc9bab2dd114a713ad6f14
parent: 18996cf9c2288c68309f6edec7fb8367f3742c88
author: Gregory Maxwell <greg@xiph.org>
date: Sat Jun 2 08:46:32 EDT 2012

Partial revert of d8e1592d— was erroneously rejecting files with
more than one page of pre-skip.

--- a/src/opusdec.c
+++ b/src/opusdec.c
@@ -794,12 +794,7 @@
                   fprintf (stderr, "Bitrate in use: %d bytes/packet     ", tmp);
                }
                maxout=((page_granule-gran_offset)*rate/48000)-link_out;
-               if (maxout<0)
-               {
-                  fprintf (stderr, "Decoding error: needed to write a negative number of samples. The input is probably corrupted.\n");
-                  exit(1);
-               }
-               outsamp=audio_write(output, channels, frame_size, fout, resampler, &preskip, dither?&shapemem:0, strlen(outFile)!=0,maxout);
+               outsamp=audio_write(output, channels, frame_size, fout, resampler, &preskip, dither?&shapemem:0, strlen(outFile)!=0,0>maxout?0:maxout);
                link_out+=outsamp;
                audio_size+=sizeof(short)*outsamp*channels;
             }