diff options
author | John Stebbins <[email protected]> | 2016-03-11 13:57:59 -0700 |
---|---|---|
committer | John Stebbins <[email protected]> | 2016-03-11 13:57:59 -0700 |
commit | 2615c363516a5b29d7d02b73e6b5cf2842584e13 (patch) | |
tree | 4e9c8a6a7f3df9082b9b92af9bea42f4f96175eb /libhb/sync.c | |
parent | 97f73f55ad7e82b84c32deb6e31bac3324965822 (diff) |
sync: fix hang at end of p-to-p encoding with subtitles
If there are no more subtitles in a subtitle track after the stop time
of a p-to-p encoding, the encode would never finish.
Diffstat (limited to 'libhb/sync.c')
-rw-r--r-- | libhb/sync.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/libhb/sync.c b/libhb/sync.c index a7096c3fe..c1c8b7906 100644 --- a/libhb/sync.c +++ b/libhb/sync.c @@ -55,7 +55,7 @@ typedef struct int min_len; hb_cond_t * cond_full; hb_buffer_list_t out_queue; - int eof; + hb_fifo_t * fifo_in; // PTS synchronization hb_list_t * delta_list; @@ -673,6 +673,10 @@ static void sendEof( sync_common_t * common ) { hb_buffer_list_append(&common->streams[ii].out_queue, hb_buffer_eof_init()); + // Need to prime all input fifos to ensure that work threads wake up + // one final time to process the end. This is sometimes needed + // for sparse subtitle streeams. + hb_fifo_push(common->streams[ii].fifo_in, hb_buffer_eof_init()); } } @@ -1124,6 +1128,7 @@ static int InitAudio( sync_common_t * common, int index ) pv->stream->first_pts = AV_NOPTS_VALUE; pv->stream->next_pts = AV_NOPTS_VALUE; pv->stream->audio.audio = audio; + pv->stream->fifo_in = audio->priv.fifo_raw; w = hb_get_work(common->job->h, WORK_SYNC_AUDIO); w->private_data = pv; @@ -1207,6 +1212,7 @@ static int InitSubtitle( sync_common_t * common, int index ) pv->stream->first_pts = AV_NOPTS_VALUE; pv->stream->next_pts = AV_NOPTS_VALUE; pv->stream->subtitle.subtitle = subtitle; + pv->stream->fifo_in = subtitle->fifo_raw; w = hb_get_work(common->job->h, WORK_SYNC_SUBTITLE); w->private_data = pv; @@ -1300,6 +1306,7 @@ static int syncVideoInit( hb_work_object_t * w, hb_job_t * job) pv->stream->type = SYNC_TYPE_VIDEO; pv->stream->first_pts = AV_NOPTS_VALUE; pv->stream->next_pts = AV_NOPTS_VALUE; + pv->stream->fifo_in = job->fifo_raw; w->fifo_in = job->fifo_raw; // sync performs direct output to fifos |