From: beralt Date: Fri, 3 Jun 2016 06:55:34 +0000 (+0200) Subject: tvhdhomerun: fix full mux pid filter X-Git-Tag: v4.2.1~439 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=c1c5fa5165c8fa4330e2b04bc9cfc20c9bfbbeb3;p=thirdparty%2Ftvheadend.git tvhdhomerun: fix full mux pid filter --- diff --git a/src/input/mpegts/tvhdhomerun/tvhdhomerun_frontend.c b/src/input/mpegts/tvhdhomerun/tvhdhomerun_frontend.c index 7c064dbab..28ceeeb18 100644 --- a/src/input/mpegts/tvhdhomerun/tvhdhomerun_frontend.c +++ b/src/input/mpegts/tvhdhomerun/tvhdhomerun_frontend.c @@ -308,11 +308,16 @@ static void tvhdhomerun_device_open_pid(tvhdhomerun_frontend_t *hfe, int pid) { char buf[1024]; int res; - //tvhdebug("tvhdhomerun", "adding PID 0x%x to pfilter", pid); - - /* Skip internal PIDs */ - if (pid > MPEGTS_FULLMUX_PID) + /* a full mux subscription should specificly set the filter */ + if (pid == MPEGTS_FULLMUX_PID) { + tvhdebug("tvhdhomerun", "setting PID filter full mux"); + pthread_mutex_lock(&hfe->hf_hdhomerun_device_mutex); + res = hdhomerun_device_set_tuner_filter(hfe->hf_hdhomerun_tuner, "0x0000-0x1FFF"); + pthread_mutex_unlock(&hfe->hf_hdhomerun_device_mutex); + if(res < 1) + tvhlog(LOG_ERR, "tvhdhomerun", "failed to set_tuner_filter to 0x0000 - 0x1FFF"); return; + } /* get the current filter */ pthread_mutex_lock(&hfe->hf_hdhomerun_device_mutex); @@ -325,6 +330,9 @@ static void tvhdhomerun_device_open_pid(tvhdhomerun_frontend_t *hfe, int pid) { tvhdebug("tvhdhomerun", "current pfilter: %s", pfilter); + /* make sure the pid maps to a max of 0x1FFF, API will reject the call otherwise */ + pid = (pid & 0x1FFF); + memset(buf, 0x00, sizeof(buf)); snprintf(buf, sizeof(buf), "0x%04x", pid);