]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
mpegts: input - check the running flag in the global lock, too
authorJaroslav Kysela <perex@perex.cz>
Wed, 27 May 2015 12:34:31 +0000 (14:34 +0200)
committerJaroslav Kysela <perex@perex.cz>
Wed, 27 May 2015 12:34:31 +0000 (14:34 +0200)
src/input/mpegts/mpegts_input.c

index d7b4d06f2d2b7dd65d4cc96f2b5992fea6121126..4727bea4579165513310c14e3f522cd1613f8f06 100644 (file)
@@ -1329,13 +1329,15 @@ mpegts_input_table_thread ( void *aux )
     
     /* Process */
     pthread_mutex_lock(&global_lock);
-    if (mm != mtf->mtf_mux) {
-      mm = mtf->mtf_mux;
-      if (mm)
-        mpegts_mux_nice_name(mm, muxname, sizeof(muxname));
+    if (mi->mi_running) {
+      if (mm != mtf->mtf_mux) {
+        mm = mtf->mtf_mux;
+        if (mm)
+          mpegts_mux_nice_name(mm, muxname, sizeof(muxname));
+      }
+      if (mm && mm->mm_active)
+        mpegts_input_table_dispatch(mm, muxname, mtf->mtf_tsb, mtf->mtf_len);
     }
-    if (mm && mm->mm_active)
-      mpegts_input_table_dispatch(mm, muxname, mtf->mtf_tsb, mtf->mtf_len);
     pthread_mutex_unlock(&global_lock);
 
     /* Cleanup */