summaryrefslogtreecommitdiffstats
path: root/libhb/sync.c
diff options
context:
space:
mode:
Diffstat (limited to 'libhb/sync.c')
-rw-r--r--libhb/sync.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libhb/sync.c b/libhb/sync.c
index 69e6d18e4..4e5f7662e 100644
--- a/libhb/sync.c
+++ b/libhb/sync.c
@@ -684,6 +684,8 @@ static void sendEof( sync_common_t * common )
static void streamFlush( sync_stream_t * stream )
{
+ hb_lock(stream->common->mutex);
+
while (hb_list_count(stream->in_queue) > 0)
{
if (!stream->common->found_first_pts)
@@ -777,6 +779,8 @@ static void streamFlush( sync_stream_t * stream )
}
}
hb_buffer_list_append(&stream->out_queue, hb_buffer_eof_init());
+
+ hb_unlock(stream->common->mutex);
}
static void log_chapter( sync_common_t *common, int chap_num,