From: Jaroslav Kysela Date: Sat, 12 Jul 2014 19:55:42 +0000 (+0200) Subject: mpegts tables: add another mutex protection to fastswitch X-Git-Tag: v4.1~1757 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=4d8aee669ce8599f46982236e808fc71b738e828;p=thirdparty%2Ftvheadend.git mpegts tables: add another mutex protection to fastswitch --- diff --git a/src/input/mpegts/mpegts_table.c b/src/input/mpegts/mpegts_table.c index 793e8938e..89f100f57 100644 --- a/src/input/mpegts/mpegts_table.c +++ b/src/input/mpegts/mpegts_table.c @@ -30,11 +30,15 @@ mpegts_table_fastswitch ( mpegts_mux_t *mm ) if(mm->mm_scan_state != MM_SCAN_STATE_ACTIVE) return; + pthread_mutex_lock(&mm->mm_tables_lock); LIST_FOREACH(mt, &mm->mm_tables, mt_link) { if (!(mt->mt_flags & MT_QUICKREQ)) continue; - if(!mt->mt_complete) + if(!mt->mt_complete) { + pthread_mutex_unlock(&mm->mm_tables_lock); return; + } } + pthread_mutex_unlock(&mm->mm_tables_lock); mpegts_mux_nice_name(mm, buf, sizeof(buf)); tvhinfo("mpegts", "%s scan complete", buf);