mpegts_pid_add(&tr->sf_pids, mp->mp_pid, mps->mps_weight);
}
}
- if (lfe->sf_device->sd_pids0)
- mpegts_pid_add(&tr->sf_pids, 0, MPS_WEIGHT_PMT_SCAN);
+ mpegts_pid_add(&tr->sf_pids, 0, MPS_WEIGHT_PMT_SCAN);
if (lfe->sf_device->sd_pids21)
mpegts_pid_add(&tr->sf_pids, 21, MPS_WEIGHT_PMT_SCAN);
}
{
satip_tune_req_t *tr;
satip_device_t *sd = lfe->sf_device;
- char *add, *del;
- int i, j, r;
+ char *setup = NULL, *add = NULL, *del = NULL;
+ int i, j, r, pid;
int max_pids_len = sd->sd_pids_len;
int max_pids_count = sd->sd_pids_max;
mpegts_apids_t wpid, padd, pdel;
pthread_mutex_unlock(&lfe->sf_dvr_lock);
if (i)
goto skip;
-
- tr->sf_weight_tuned = tr->sf_weight;
- r = satip_rtsp_play(rtsp, "all", NULL, NULL, max_pids_len, tr->sf_weight);
- r = r == 0 ? 1 : r;
+ setup = (char *)"all";
} else if (!sd->sd_pids_deladd ||
tr->sf_pids_tuned.all ||
}
j = MIN(wpid.count, max_pids_count);
- add = alloca(1 + j * 5);
- add[0] = '\0';
+ setup = alloca(1 + j * 5);
+ setup[0] = '\0';
for (i = 0; i < j; i++)
- sprintf(add + strlen(add), ",%i", wpid.pids[i].pid);
+ sprintf(setup + strlen(setup), ",%i", wpid.pids[i].pid);
mpegts_pid_copy(&tr->sf_pids_tuned, &wpid);
tr->sf_pids_tuned.all = 0;
pthread_mutex_unlock(&lfe->sf_dvr_lock);
mpegts_pid_done(&wpid);
- if (!j || add[0] == '\0')
+ if (!j || setup[0] == '\0')
goto skip;
- tr->sf_weight_tuned = tr->sf_weight;
- r = satip_rtsp_play(rtsp, add, NULL, NULL, max_pids_len, tr->sf_weight);
- r = r == 0 ? 1 : r;
-
} else {
mpegts_pid_weighted(&wpid, &tr->sf_pids, max_pids_count);
add[0] = del[0] = '\0';
for (i = 0; i < pdel.count; i++) {
- sprintf(del + strlen(del), ",%i", pdel.pids[i].pid);
- mpegts_pid_del(&tr->sf_pids_tuned, pdel.pids[i].pid, pdel.pids[i].weight);
+ pid = pdel.pids[i].pid;
+ if (pid != DVB_PAT_PID)
+ sprintf(del + strlen(del), ",%i", pid);
}
j = MIN(padd.count, max_pids_count);
- for (i = 0; i < j; i++)
- sprintf(add + strlen(add), ",%i", padd.pids[i].pid);
+ for (i = 0; i < j; i++) {
+ pid = padd.pids[i].pid;
+ if (pid != DVB_PAT_PID)
+ sprintf(add + strlen(add), ",%i", pid);
+ }
mpegts_pid_copy(&tr->sf_pids_tuned, &wpid);
tr->sf_pids_tuned.all = 0;
if (add[0] == '\0' && del[0] == '\0')
goto skip;
-
- tr->sf_weight_tuned = tr->sf_weight;
- r = satip_rtsp_play(rtsp, NULL, add, del, max_pids_len, tr->sf_weight);
- r = r == 0 ? 1 : r;
}
+ tr->sf_weight_tuned = tr->sf_weight;
+ r = satip_rtsp_play(rtsp, setup, add, del, max_pids_len, tr->sf_weight);
+ r = r == 0 ? 1 : r;
+
if (r < 0)
tvherror(LS_SATIP, "%s - failed to modify pids: %s", name, strerror(-r));
return r;
rtsp->hc_efd = efd;
position = lfe_master->sf_position;
- if (lfe->sf_device->sd_pids0)
- rtsp_flags |= SATIP_SETUP_PIDS0;
if (lfe->sf_device->sd_pilot_on)
rtsp_flags |= SATIP_SETUP_PILOT_ON;
if (lfe->sf_device->sd_pids21)
}
if (weight > 0)
satip_rtsp_add_val("tvhweight", buf, (uint32_t)weight * 1000);
- if (flags & SATIP_SETUP_PIDS0) {
- strcat(buf, "&pids=0");
- if (flags & SATIP_SETUP_PIDS21)
- strcat(buf, ",21");
- } else if (flags & SATIP_SETUP_PIDS21)
- strcat(buf, "&pids=21");
- tvhtrace(LS_SATIP, "setup params - %s", buf);
+ strcat(buf, "&pids=0");
+ if (flags & SATIP_SETUP_PIDS21)
+ strcat(buf, ",21");
+ tvhtrace(LS_SATIP, "%04X: SETUP params - %s", hc->hc_id, buf);
if (hc->hc_rtsp_stream_id >= 0)
snprintf(stream = _stream, sizeof(_stream), "/stream=%li",
hc->hc_rtsp_stream_id);
snprintf(stream = _stream, sizeof(_stream), "/stream=%li",
hc->hc_rtsp_stream_id);
query = htsbuf_to_string(&q);
+ tvhtrace(LS_SATIP, "%04X: PLAY params - %s", hc->hc_id, query);
r = rtsp_play(hc, stream, query);
free(query);
if (r >= 0 && split) {