}
}
-static void
+static int
satip_frontend_pid_changed( http_client_t *rtsp,
satip_frontend_t *lfe, const char *name )
{
int max_pids_len = lfe->sf_device->sd_pids_len;
if (!lfe->sf_running || lfe->sf_shutdown)
- return;
+ return 0;
pthread_mutex_lock(&lfe->sf_dvr_lock);
if (lfe->sf_pids_any_tuned) {
pthread_mutex_unlock(&lfe->sf_dvr_lock);
- return;
+ return 0;
}
lfe->sf_pids_any_tuned = 1;
memcpy(lfe->sf_pids_tuned, lfe->sf_pids,
pthread_mutex_unlock(&lfe->sf_dvr_lock);
r = satip_rtsp_play(rtsp, "all", NULL, NULL, max_pids_len);
+ r = r == 0 ? 1 : r;
} else if (!lfe->sf_device->sd_pids_deladd ||
lfe->sf_pids_any_tuned ||
pthread_mutex_unlock(&lfe->sf_dvr_lock);
r = satip_rtsp_play(rtsp, add, NULL, NULL, max_pids_len);
+ r = r == 0 ? 1 : r;
} else {
lfe->sf_pids_tcount = lfe->sf_pids_count;
pthread_mutex_unlock(&lfe->sf_dvr_lock);
- if (add[0] != '\0' || del[0] != '\0')
- r = satip_rtsp_play(rtsp, NULL, add, del, max_pids_len);
- else
- r = 0;
+ if (add[0] == '\0' && del[0] == '\0')
+ return 0;
+
+ r = satip_rtsp_play(rtsp, NULL, add, del, max_pids_len);
+ r = r == 0 ? 1 : r;
}
if (r < 0)
tvherror("satip", "%s - failed to modify pids: %s", name, strerror(-r));
+ return r;
}
static void *
}
continue;
} else {
- satip_frontend_pid_changed(rtsp, lfe, buf);
+ if (satip_frontend_pid_changed(rtsp, lfe, buf) > 0)
+ continue;
}
}
break;
case RTSP_CMD_PLAY:
if (rtsp->hc_code == 200 && play2) {
- satip_frontend_pid_changed(rtsp, lfe, buf);
play2 = 0;
+ if (satip_frontend_pid_changed(rtsp, lfe, buf) > 0)
+ continue;
}
/* fall thru */
default: