summaryrefslogtreecommitdiffstats
path: root/libhb/deca52.c
diff options
context:
space:
mode:
authoreddyg <[email protected]>2008-10-19 21:43:21 +0000
committereddyg <[email protected]>2008-10-19 21:43:21 +0000
commitd235fedfc43b5b736806b4e072c11c803c2804ca (patch)
tree0fc61022e53575d81a857051e13b349cc8ccdda6 /libhb/deca52.c
parent791df0ecad16f41ad3f7acfbfeac97ecb9bf5949 (diff)
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
Diffstat (limited to 'libhb/deca52.c')
-rw-r--r--libhb/deca52.c5
1 files changed, 3 insertions, 2 deletions
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;