]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
SAT>IP: fix the full mux streaming outside tvh
authorJaroslav Kysela <perex@perex.cz>
Wed, 14 May 2014 12:29:38 +0000 (14:29 +0200)
committerJaroslav Kysela <perex@perex.cz>
Wed, 14 May 2014 12:29:38 +0000 (14:29 +0200)
src/input/mpegts/satip/satip_frontend.c

index 386e477e39ac59cfc58b88432b00177f1c1bbdf7..5034c482bb8c4ec64a9e3611c74b280c9d189655 100644 (file)
@@ -508,7 +508,7 @@ satip_frontend_open_pid
   if (!(mp = mpegts_input_open_pid(mi, mm, pid, type, owner)))
     return NULL;
 
-  if (type == MPEGTS_FULLMUX_PID) {
+  if (pid == MPEGTS_FULLMUX_PID) {
     if (lfe->sf_device->sd_fullmux_ok) {
       if (!lfe->sf_pids_any)
         lfe->sf_pids_any = change = 1;
@@ -526,10 +526,13 @@ satip_frontend_open_pid
     change |= satip_frontend_add_pid(lfe, mp->mp_pid);
   }
 
-  pthread_mutex_lock(&lfe->sf_dvr_lock);
-  if (change && !lfe->sf_pids_any_tuned)
-    tvh_write(lfe->sf_dvr_pipe.wr, "c", 1);
-  pthread_mutex_unlock(&lfe->sf_dvr_lock);
+  if (change) {
+    pthread_mutex_lock(&lfe->sf_dvr_lock);
+    if (!lfe->sf_pids_any_tuned ||
+        lfe->sf_pids_any != lfe->sf_pids_any_tuned)
+      tvh_write(lfe->sf_dvr_pipe.wr, "c", 1);
+    pthread_mutex_unlock(&lfe->sf_dvr_lock);
+  }
 
   return mp;
 }