From: Jaroslav Kysela Date: Tue, 28 Apr 2015 07:07:29 +0000 (+0200) Subject: SAT>IP Client: fix close_pid callback X-Git-Tag: v4.1~98 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c79a41dbb2ad204e81692bc1dcef21c9378f1c60;p=thirdparty%2Ftvheadend.git SAT>IP Client: fix close_pid callback --- diff --git a/src/input/mpegts/satip/satip_frontend.c b/src/input/mpegts/satip/satip_frontend.c index 185f151d1..7087b48b5 100644 --- a/src/input/mpegts/satip/satip_frontend.c +++ b/src/input/mpegts/satip/satip_frontend.c @@ -596,8 +596,14 @@ satip_frontend_close_pid satip_tune_req_t *tr; int change = 0, r; + if (pid < MPEGTS_FULLMUX_PID) { + pthread_mutex_lock(&lfe->sf_dvr_lock); + change = mpegts_pid_del(&lfe->sf_req->sf_pids, pid, weight) >= 0; + pthread_mutex_unlock(&lfe->sf_dvr_lock); + } + if ((r = mpegts_input_close_pid(mi, mm, pid, type, weight, owner)) <= 0) - return r; + return r; /* return here even if change is nonzero - multiple PID subscribers */ /* Skip internal PIDs */ if (pid > MPEGTS_FULLMUX_PID) @@ -613,8 +619,6 @@ satip_frontend_close_pid change = 1; } } - } else { - change = mpegts_pid_del(&tr->sf_pids, pid, weight) >= 0; } if (change) tvh_write(lfe->sf_dvr_pipe.wr, "c", 1);