summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjstebbins <[email protected]>2011-02-07 22:46:01 +0000
committerjstebbins <[email protected]>2011-02-07 22:46:01 +0000
commit98261f28003f39e63f481c22bdeace348fae1535 (patch)
tree6e585c9585d46bc560cba3e2b74c908c475eb753
parent19c97ddd16b4da9d7d7bf05cc1e91537227da526 (diff)
Fix a hang in sync
If one stream has no content and other streams have almost no content, we were hanging while waiting for the first pts in the streams. This could be reproduced by attempting to encode only the last 0-length chapter of a DVD. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3783 b64f7644-9d1e-0410-96f1-a4d463321fa5
-rw-r--r--libhb/sync.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libhb/sync.c b/libhb/sync.c
index 322dc783f..ad26fb656 100644
--- a/libhb/sync.c
+++ b/libhb/sync.c
@@ -297,6 +297,7 @@ int syncVideoWork( hb_work_object_t * w, hb_buffer_t ** buf_in,
{
*buf_out = next;
pv->common->start_found = 1;
+ pv->common->first_pts[0] = INT64_MAX - 1;
hb_cond_broadcast( pv->common->next_frame );
/*
@@ -366,6 +367,7 @@ int syncVideoWork( hb_work_object_t * w, hb_buffer_t ** buf_in,
*buf_out = hb_buffer_init( 0 );
pv->common->start_found = 1;
+ pv->common->first_pts[0] = INT64_MAX - 1;
hb_cond_broadcast( pv->common->next_frame );
/*
@@ -396,6 +398,7 @@ int syncVideoWork( hb_work_object_t * w, hb_buffer_t ** buf_in,
{
hb_buffer_close( &next );
+ pv->common->first_pts[0] = INT64_MAX - 1;
cur->start = sync->next_start;
cur->stop = cur->start + 90000. / ((double)job->vrate / (double)job->vrate_base);
@@ -952,6 +955,7 @@ static int syncAudioWork( hb_work_object_t * w, hb_buffer_t ** buf_in,
{
hb_buffer_close( &buf );
*buf_out = hb_buffer_init( 0 );
+ pv->common->first_pts[sync->index+1] = INT64_MAX - 1;
return HB_WORK_DONE;
}