X-Git-Url: http://git.osdn.jp/view?a=blobdiff_plain;ds=sidebyside;f=libhb%2Fsync.c;h=9c36ee30a72eaf4df45d411e392825fd84909b5f;hb=4f0019f03c2e85e8634150ff0c9a31bee6d35ce5;hp=a36b37b5b7763b5991369ca5586e3b9a8ac4f0ee;hpb=08332419f62cd37f02e6cf03f227c75c8107c9f4;p=handbrake-jp%2Fhandbrake-jp-git.git diff --git a/libhb/sync.c b/libhb/sync.c index a36b37b5..9c36ee30 100644 --- a/libhb/sync.c +++ b/libhb/sync.c @@ -116,7 +116,7 @@ hb_work_object_t * hb_sync_init( hb_job_t * job ) pv->common = calloc( 1, sizeof( hb_sync_common_t ) ); pv->common->ref++; pv->common->mutex = hb_lock_init(); - pv->common->audio_pts_thresh = 0; + pv->common->audio_pts_thresh = -1; pv->common->next_frame = hb_cond_init(); pv->common->pts_count = 1; if ( job->frame_to_start || job->pts_to_start ) @@ -564,7 +564,10 @@ int syncVideoWork( hb_work_object_t * w, hb_buffer_t ** buf_in, */ if( subtitle->source == CC608SUB || subtitle->source == CC708SUB || - subtitle->source == SRTSUB ) + subtitle->source == SRTSUB || + subtitle->source == UTF8SUB || + subtitle->source == TX3GSUB || + subtitle->source == SSASUB) { /* * Rewrite timestamps on subtitles that came from Closed Captions @@ -928,6 +931,13 @@ static int syncAudioWork( hb_work_object_t * w, hb_buffer_t ** buf_in, hb_lock( pv->common->mutex ); while ( !pv->common->start_found ) { + if ( pv->common->audio_pts_thresh < 0 ) + { + // I would initialize this in hb_sync_init, but + // job->pts_to_start can be modified by reader + // after hb_sync_init is called. + pv->common->audio_pts_thresh = job->pts_to_start; + } if ( buf->start < pv->common->audio_pts_thresh ) { hb_buffer_close( &buf );