Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
tvhdhomerun: fix full mux pid filter
  • Loading branch information
beralt authored and perexg committed Jun 4, 2016
1 parent ea57298 commit c1c5fa5
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions src/input/mpegts/tvhdhomerun/tvhdhomerun_frontend.c
Expand Up @@ -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);
Expand All @@ -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);

Expand Down

0 comments on commit c1c5fa5

Please sign in to comment.