From c79a41dbb2ad204e81692bc1dcef21c9378f1c60 Mon Sep 17 00:00:00 2001 From: Jaroslav Kysela Date: Tue, 28 Apr 2015 09:07:29 +0200 Subject: [PATCH] SAT>IP Client: fix close_pid callback --- src/input/mpegts/satip/satip_frontend.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) 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); -- 2.47.3