diff options
author | titer <[email protected]> | 2006-02-23 09:06:36 +0000 |
---|---|---|
committer | titer <[email protected]> | 2006-02-23 09:06:36 +0000 |
commit | df70394f44cafec40e756803cb9544757add4e17 (patch) | |
tree | 879a6084cd4376c65c5376f9c71f244cb1248249 /libhb/sync.c | |
parent | 59fdec6de410480ca0b9eb7bb9b7e37a6ddc1384 (diff) |
Quick fix for Madagascar: increased tolerance level for PTS discontinuities
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@29 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'libhb/sync.c')
-rw-r--r-- | libhb/sync.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/libhb/sync.c b/libhb/sync.c index 866f872b5..32ddb52b7 100644 --- a/libhb/sync.c +++ b/libhb/sync.c @@ -226,6 +226,8 @@ static int Work( hb_work_object_t * w, hb_buffer_t ** unused1, return SyncVideo( w ); } +#define PTS_DISCONTINUITY_TOLERANCE 90000 + /*********************************************************************** * SyncVideo *********************************************************************** @@ -278,8 +280,8 @@ static int SyncVideo( hb_work_object_t * w ) } /* Check for PTS jumps over 0.5 second */ - if( next->start < cur->start - 45000 || - next->start > cur->start + 45000 ) + if( next->start < cur->start - PTS_DISCONTINUITY_TOLERANCE || + next->start > cur->start + PTS_DISCONTINUITY_TOLERANCE ) { hb_log( "PTS discontinuity (%lld, %lld)", cur->start, next->start ); @@ -437,8 +439,8 @@ static void SyncAudio( hb_work_object_t * w, int i ) /* The PTS of the samples we are expecting now */ pts_expected = w->pts_offset + sync->count_frames * 90000 / rate; - if( ( buf->start > pts_expected + 45000 || - buf->start < pts_expected - 45000 ) && + if( ( buf->start > pts_expected + PTS_DISCONTINUITY_TOLERANCE || + buf->start < pts_expected - PTS_DISCONTINUITY_TOLERANCE ) && w->pts_offset_old > INT64_MIN ) { /* There has been a PTS discontinuity, and this frame might @@ -446,8 +448,8 @@ static void SyncAudio( hb_work_object_t * w, int i ) pts_expected = w->pts_offset_old + sync->count_frames * 90000 / rate; - if( buf->start > pts_expected + 45000 || - buf->start < pts_expected - 45000 ) + if( buf->start > pts_expected + PTS_DISCONTINUITY_TOLERANCE || + buf->start < pts_expected - PTS_DISCONTINUITY_TOLERANCE ) { /* There is really nothing we can do with it */ buf = hb_fifo_get( audio->fifo_raw ); |