diff options
author | van <[email protected]> | 2008-06-30 05:01:01 +0000 |
---|---|---|
committer | van <[email protected]> | 2008-06-30 05:01:01 +0000 |
commit | 9c5ffcd12957fcf93c4addd7ccc478c85304d047 (patch) | |
tree | 077a4794221f0705ddae3f3879e13e0b3ad95a08 /libhb/sync.c | |
parent | da80bb8d441e3c12260f2f1bc0fff218112cb42d (diff) |
- fix an error in the SCR calculation that would cause an extra frame to be dropped at an SCR discontinuity.
- fix a rounding error in the encx264 init_delay computation that would underestimate the delay for progressive content and cause spurious "init_delay too small" messages.
- clean up the sync.c "video time didn't advance" logic and try to make the error mgs more useful for debugging frame duration problems.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1543 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'libhb/sync.c')
-rw-r--r-- | libhb/sync.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/libhb/sync.c b/libhb/sync.c index 0b0852bc5..58812a7ad 100644 --- a/libhb/sync.c +++ b/libhb/sync.c @@ -346,7 +346,7 @@ static int SyncVideo( hb_work_object_t * w ) * can deal with overlaps of up to a frame time but anything larger * we handle by dropping frames here. */ - if ( (int64_t)( next->start - pv->next_pts ) <= 0 ) + if ( (int64_t)( next->start - cur->start ) <= 0 ) { if ( pv->first_drop == 0 ) { @@ -365,9 +365,9 @@ static int SyncVideo( hb_work_object_t * w ) if ( pv->first_drop ) { hb_log( "sync: video time didn't advance - dropped %d frames " - "(delta %d ms, current %lld, next %lld)", - pv->drop_count, (int)( pv->next_pts - pv->first_drop ) / 90, - pv->next_pts, pv->first_drop ); + "(delta %d ms, current %lld, next %lld, dur %d)", + pv->drop_count, (int)( cur->start - pv->first_drop ) / 90, + cur->start, next->start, (int)( next->start - cur->start ) ); pv->first_drop = 0; pv->drop_count = 0; } @@ -583,8 +583,8 @@ static int SyncVideo( hb_work_object_t * w ) */ buf_tmp = cur; pv->cur = cur = hb_fifo_get( job->fifo_raw ); - pv->next_pts = next->start; - duration = next->start - buf_tmp->start; + pv->next_pts = cur->start; + duration = cur->start - buf_tmp->start; if ( duration <= 0 ) { hb_log( "sync: invalid video duration %lld, start %lld, next %lld", |