summaryrefslogtreecommitdiffstats
path: root/libhb
diff options
context:
space:
mode:
authorjstebbins <[email protected]>2010-01-10 17:05:11 +0000
committerjstebbins <[email protected]>2010-01-10 17:05:11 +0000
commit3a849b5e81cd5fed2af56f5b74eeaeca6d6e76bb (patch)
tree56db856edba3e7db430a46863a24b5e060543dc3 /libhb
parentd79226267d254143685d21ad35e5695181fefc4a (diff)
prevent hang during foreign audio search
was waiting for an audio pts during the indepth scan when there is no audio being processed git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3065 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'libhb')
-rw-r--r--libhb/sync.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/libhb/sync.c b/libhb/sync.c
index 1501ea02b..58fba19dc 100644
--- a/libhb/sync.c
+++ b/libhb/sync.c
@@ -117,10 +117,7 @@ int hb_sync_init( hb_job_t * job )
pv->common->mutex = hb_lock_init();
pv->common->audio_pts_thresh = 0;
pv->common->next_frame = hb_cond_init();
- pv->common->pts_count = 1 + hb_list_count( title->list_audio );
- pv->common->first_pts = malloc( sizeof(int64_t) * pv->common->pts_count );
- for ( i = 0; i < pv->common->pts_count; i++ )
- pv->common->first_pts[i] = INT64_MAX;
+ pv->common->pts_count = 1;
if ( job->frame_to_start || job->pts_to_start )
{
pv->common->start_found = 0;
@@ -182,6 +179,9 @@ int hb_sync_init( hb_job_t * job )
InitAudio( job, pv->common, i );
}
}
+ pv->common->first_pts = malloc( sizeof(int64_t) * pv->common->pts_count );
+ for ( i = 0; i < pv->common->pts_count; i++ )
+ pv->common->first_pts[i] = INT64_MAX;
return 0;
}
@@ -1047,6 +1047,7 @@ static void InitAudio( hb_job_t * job, hb_sync_common_t * common, int i )
pv->job = job;
pv->common = common;
pv->common->ref++;
+ pv->common->pts_count++;
w = hb_get_work( WORK_SYNC_AUDIO );
w->private_data = pv;