]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
mpegts tables: add another mutex protection to fastswitch
authorJaroslav Kysela <perex@perex.cz>
Sat, 12 Jul 2014 19:55:42 +0000 (21:55 +0200)
committerJaroslav Kysela <perex@perex.cz>
Sat, 12 Jul 2014 20:05:28 +0000 (22:05 +0200)
src/input/mpegts/mpegts_table.c

index 793e8938ea867fd5ec1b377ca5a747bd5ad9ce02..89f100f5755d8402245d8fd46ae1e13ee29880c2 100644 (file)
@@ -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);