summaryrefslogtreecommitdiffstats
path: root/libhb/internal.h
diff options
context:
space:
mode:
authorvan <[email protected]>2008-12-04 09:24:33 +0000
committervan <[email protected]>2008-12-04 09:24:33 +0000
commit0e2fd926adeb33506fa71c454616ca373f15f131 (patch)
tree5453d8a104bbf05ae437b27461436e5dbb4f4f0f /libhb/internal.h
parentb95bb9176e97f4a74c11048432475977524d9a7f (diff)
- validate frame sync the way the standard suggests (via checking the frame crc) rather than looking at multiple frames. This should reduce the probability of mis-identifying random junk as AC-3 to less than 1 in 2^32.
- check the crc on every frame so we don't let corrupted data into the decoder. - interpret the PTS as per the standard (it's the time of the first frame that starts in the packet, not the time of the first byte of the packet). Incorrect interpretation was resulting in an average 15ms timing error (worse case 31ms). - do all the PTS calculations in doubles so we don't get round-off error that will desync the audio & video with 44.1KHz audio sources (these can't appear on DVDs but do show up in avi/mkv/... files). - don't rely on the container to give us large enough frame fragments to validate the sync (some containers split audio frames into really small pieces). Instead use the 8K of unused space in the esconfig of the audio object as an accumulation buffer. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2002 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'libhb/internal.h')
-rw-r--r--libhb/internal.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/libhb/internal.h b/libhb/internal.h
index 29a88dca6..19a3bd2b3 100644
--- a/libhb/internal.h
+++ b/libhb/internal.h
@@ -233,7 +233,11 @@ union hb_esconfig_u
struct
{
/* ac3flags stores the flags from the AC3 source, as found in scan.c */
- int ac3flags;
+ int ac3flags;
+ // next two items are used by the bsinfo routine to accumulate small
+ // frames until we have enough to validate the crc.
+ int len; // space currently used in 'buf'
+ uint8_t buf[HB_CONFIG_MAX_SIZE-sizeof(int)];
} a52;
struct