From d235fedfc43b5b736806b4e072c11c803c2804ca Mon Sep 17 00:00:00 2001 From: eddyg Date: Sun, 19 Oct 2008 21:43:21 +0000 Subject: Fix bug which prevented AC3 sync when only one AC3 packet was located in the buffer. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1850 b64f7644-9d1e-0410-96f1-a4d463321fa5 --- libhb/deca52.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'libhb/deca52.c') diff --git a/libhb/deca52.c b/libhb/deca52.c index 26f5603d7..55a3a1ed5 100644 --- a/libhb/deca52.c +++ b/libhb/deca52.c @@ -288,7 +288,8 @@ static hb_buffer_t * Decode( hb_work_object_t * w ) static int deca52BSInfo( hb_work_object_t *w, const hb_buffer_t *b, hb_work_info_t *info ) { - int i, rate, bitrate, flags; + int i; + int rate = 0, bitrate = 0, flags = 0; int old_rate = 0, old_bitrate = 0; memset( info, 0, sizeof(*info) ); @@ -315,7 +316,7 @@ static int deca52BSInfo( hb_work_object_t *w, const hb_buffer_t *b, old_bitrate = bitrate; } } - if ( i >= b->size - 7 ) + if ( rate == 0 || bitrate == 0 ) { /* didn't find AC3 sync */ return 0; -- cgit v1.2.3