summaryrefslogtreecommitdiffstats
path: root/libhb/decavcodec.c
diff options
context:
space:
mode:
authorjstebbins <[email protected]>2012-04-01 15:34:47 +0000
committerjstebbins <[email protected]>2012-04-01 15:34:47 +0000
commit481a3a39d39479752442889dbde03598a0ae788c (patch)
treefd06a604a87c6cf5849e03523dd4b4155e255c8b /libhb/decavcodec.c
parent62f087933c51776ca60eb58262989acab2236fd0 (diff)
libhb: fix incorrect audio gaps
When the duratation of an audio packet is not evenly divisible by the 90khz clock, we were loosing a fraction of a tick per audio packet. This causes every packet to be tagged with a timestamp that is a little early and eventually a gap must be filled to maintain sync. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4574 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'libhb/decavcodec.c')
-rw-r--r--libhb/decavcodec.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libhb/decavcodec.c b/libhb/decavcodec.c
index 33b45fa12..bb7c4c3c3 100644
--- a/libhb/decavcodec.c
+++ b/libhb/decavcodec.c
@@ -1483,7 +1483,9 @@ static void decodeAudio( hb_audio_t * audio, hb_work_private_t *pv, uint8_t *dat
int pos = 0;
int loop_limit = 256;
- if ( pts != -1 )
+ // If we are givn a pts, use it.
+ // But don't loose partial ticks.
+ if ( pts != -1 && (int64_t)pv->pts_next != pts )
pv->pts_next = pts;
while ( pos < size )
{