static void streamFlush( sync_stream_t * stream )
{
- hb_lock(stream->common->mutex);
-
while (hb_list_count(stream->in_queue) > 0)
{
hb_buffer_t * buf;
}
}
fifo_push(stream->fifo_out, hb_buffer_eof_init());
-
- hb_unlock(stream->common->mutex);
}
static void flushStreams( sync_common_t * common )
}
}
+static void flushStreamsLock( sync_common_t * common )
+{
+ hb_lock(common->mutex);
+ flushStreams(common);
+ hb_unlock(common->mutex);
+}
+
static void log_chapter( sync_common_t *common, int chap_num,
int nframes, int64_t pts )
{
out_stream->done = 1;
fifo_push(out_stream->fifo_out, hb_buffer_eof_init());
terminateSubtitleStreams(common);
+ flushStreams(common);
signalBuffer(out_stream);
continue;
}
out_stream->done = 1;
fifo_push(out_stream->fifo_out, hb_buffer_eof_init());
terminateSubtitleStreams(common);
+ flushStreams(common);
signalBuffer(out_stream);
continue;
}
if (in->s.flags & HB_BUF_FLAG_EOF)
{
pv->stream->flush = 1;
- flushStreams(pv->common);
+ flushStreamsLock(pv->common);
// Ideally, we would only do this subtitle scan check in
// syncSubtitleWork, but someone might try to do a subtitle
// scan on a source that has no subtitles :-(
if (in->s.flags & HB_BUF_FLAG_EOF)
{
pv->stream->flush = 1;
- flushStreams(pv->common);
+ flushStreamsLock(pv->common);
return HB_WORK_DONE;
}
// sanitizeSubtitle requires EOF buffer to recognize that
// it needs to flush all subtitles.
hb_list_add(pv->stream->in_queue, hb_buffer_eof_init());
- flushStreams(pv->common);
+ flushStreamsLock(pv->common);
if (pv->common->job->indepth_scan)
{
// When doing subtitle indepth scan, the pipeline ends at sync.