diff options
author | jstebbins <[email protected]> | 2010-11-22 21:52:05 +0000 |
---|---|---|
committer | jstebbins <[email protected]> | 2010-11-22 21:52:05 +0000 |
commit | bdb3c747159ff77aa36feaeb9365c58c23d512b6 (patch) | |
tree | bc77628a40f6ea9c55b59e2939e875cb346a9bab /libhb/sync.c | |
parent | ffa6c17f19cf2e88d1de9858c10cf9925272001b (diff) |
fix sync of ssa subtitles when using point-to-point encoding
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3685 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 cfc0c2a20..b44765e08 100644 --- a/libhb/sync.c +++ b/libhb/sync.c @@ -317,7 +317,7 @@ int syncVideoWork( hb_work_object_t * w, hb_buffer_t ** buf_in, return HB_WORK_DONE; } if ( pv->common->count_frames < job->frame_to_start || - next_start < job->pts_to_start ) + next->start < job->pts_to_start ) { // Flush any subtitles that have pts prior to the // current frame @@ -334,7 +334,7 @@ int syncVideoWork( hb_work_object_t * w, hb_buffer_t ** buf_in, } hb_lock( pv->common->mutex ); // Tell the audio threads what must be dropped - pv->common->audio_pts_thresh = next_start; + pv->common->audio_pts_thresh = next_start + pv->common->video_pts_slip; hb_cond_broadcast( pv->common->next_frame ); hb_unlock( pv->common->mutex ); @@ -345,8 +345,8 @@ int syncVideoWork( hb_work_object_t * w, hb_buffer_t ** buf_in, } hb_lock( pv->common->mutex ); pv->common->audio_pts_thresh = 0; - pv->common->audio_pts_slip = next_start; - pv->common->video_pts_slip = next_start; + pv->common->audio_pts_slip += next_start; + pv->common->video_pts_slip += next_start; next_start = 0; pv->common->start_found = 1; pv->common->count_frames = 0; @@ -989,14 +989,14 @@ static int syncAudioWork( hb_work_object_t * w, hb_buffer_t ** buf_in, // after hb_sync_init is called. pv->common->audio_pts_thresh = job->pts_to_start; } - if ( start < pv->common->audio_pts_thresh ) + if ( buf->start < pv->common->audio_pts_thresh ) { hb_buffer_close( &buf ); hb_unlock( pv->common->mutex ); return HB_WORK_OK; } while ( !pv->common->start_found && - start >= pv->common->audio_pts_thresh ) + buf->start >= pv->common->audio_pts_thresh ) { hb_cond_timedwait( pv->common->next_frame, pv->common->mutex, 200 ); } |