All pastes #1227249 Raw Edit

AC3 sync

public diff v1 · immutable
#1227249 ·published 2008-10-14 21:55 UTC
rendered paste body
Index: libhb/deca52.c===================================================================--- libhb/deca52.c	(revision 1829)+++ libhb/deca52.c	(working copy)@@ -289,6 +289,7 @@                          hb_work_info_t *info ) {     int i, rate, bitrate, flags;+    int old_rate = 0, old_bitrate = 0;      memset( info, 0, sizeof(*info) ); @@ -298,7 +299,22 @@     {         if( a52_syncinfo( &b->data[i], &flags, &rate, &bitrate ) != 0 )         {-            break;+            /*+             * Got sync apparently, save these values and check that they+             * also match when we get sync again.+             */+            if( old_rate ) +            {+                if( rate == old_rate && bitrate == old_bitrate )+                {+                    break;+                } else {+                    hb_log( "AC3 sync didn't return the same values two times in a row, still looking" );+                }+            } +            +            old_rate = rate;+            old_bitrate = bitrate;         }     }     if ( i >= b->size - 7 )