shithub: aacdec

Download patch

ref: 1b804dfaa0f31fe2b083b5f9df9e0aa156444be1
parent: e8edc600fe786cd49fe4a9bd0771f154ded463bd
author: ca5e <ca5e>
date: Fri Oct 10 08:23:43 EDT 2003

Fixed glitch in gapless mp4 decoding with certain broken files

--- a/frontend/main.c
+++ b/frontend/main.c
@@ -22,7 +22,7 @@
 ** Commercial non-GPL licensing of this software is possible.
 ** For more info contact Ahead Software through Mpeg4AAClicense@nero.com.
 **
-** $Id: main.c,v 1.49 2003/09/30 08:07:47 menno Exp $
+** $Id: main.c,v 1.50 2003/10/10 12:23:43 ca5e Exp $
 **/
 
 #ifdef _WIN32
@@ -842,10 +842,11 @@
                 {
                     fprintf(stderr, "MP4 seems to have incorrect frame duration, using values from AAC data.\n");
                     useAacLength = 1;
+                    sample_count = frameInfo.samples;
                 }
             }
 
-            if (initial && (sample_count < framesize*frameInfo.channels))
+            if (initial && (sample_count < framesize*frameInfo.channels) && (frameInfo.samples > sample_count))
                 delay = frameInfo.samples - sample_count;
         }
         else