.name = "UDP RTP Port Number (2 ports)",
.off = offsetof(satip_frontend_t, sf_udp_rtp_port),
},
+ {
+ .type = PT_BOOL,
+ .id = "play2",
+ .name = "Send full PLAY cmd",
+ .opts = PO_ADVANCED,
+ .off = offsetof(satip_frontend_t, sf_play2),
+ },
{}
}
};
int changing = 0, ms = -1, fatal = 0;
uint32_t seq = -1, nseq;
udp_multirecv_t um;
+ int play2 = 1, position, rtsp_flags = 0;
lfe->mi_display_name((mpegts_input_t*)lfe, buf, sizeof(buf));
tvhpoll_add(efd, ev, 4);
rtsp->hc_efd = efd;
- pos = lfe->sf_position;
+ position = lfe->sf_position;
if (lfe->sf_master) {
lfe2 = satip_frontend_find_by_number(lfe->sf_device, lfe->sf_master);
if (lfe2)
- pos = lfe2->sf_position;
+ position = lfe2->sf_position;
}
+ if (lfe->sf_device->sd_pids0)
+ rtsp_flags |= SATIP_SETUP_PIDS0;
r = satip_rtsp_setup(rtsp,
- pos, lfe->sf_number,
+ position, lfe->sf_number,
lfe->sf_rtp_port, &lm->lm_tuning,
- lfe->sf_device->sd_pids0);
+ rtsp_flags);
if (r < 0) {
tvherror("satip", "%s - failed to tune", buf);
- return NULL;
+ goto done;
}
udp_multirecv_init(&um, RTP_PKTS, RTP_PKT_SIZE);
pthread_mutex_lock(&global_lock);
satip_frontend_default_tables(lfe, mmi->mmi_mux);
pthread_mutex_unlock(&global_lock);
- satip_frontend_pid_changed(rtsp, lfe, buf);
+ if (lfe->sf_play2) {
+ r = satip_rtsp_setup(rtsp, position, lfe->sf_number,
+ lfe->sf_rtp_port, &lm->lm_tuning,
+ rtsp_flags | SATIP_SETUP_PLAY);
+ if (r < 0) {
+ tvherror("satip", "%s - failed to tune2", buf);
+ fatal = 1;
+ }
+ continue;
+ } else {
+ satip_frontend_pid_changed(rtsp, lfe, buf);
+ }
}
break;
+ case RTSP_CMD_PLAY:
+ if (rtsp->hc_code == 200 && play2) {
+ satip_frontend_pid_changed(rtsp, lfe, buf);
+ play2 = 0;
+ }
+ /* fall thru */
default:
if (rtsp->hc_code >= 400) {
tvhlog(LOG_ERR, "satip", "%s - RTSP cmd error %d (%s) [%i-%i]",
}
}
}
- http_client_close(rtsp);
+done:
+ http_client_close(rtsp);
tvhpoll_destroy(efd);
return NULL;
#undef PKTS
* Creation/Config
* *************************************************************************/
+static void
+satip_frontend_hacks( satip_frontend_t *lfe )
+{
+ if (strstr(lfe->sf_device->sd_info.location, ":8888/octonet.xml")) {
+ if (lfe->sf_type == DVB_TYPE_S)
+ lfe->sf_play2 = 1;
+ }
+}
+
satip_frontend_t *
satip_frontend_create
( htsmsg_t *conf, satip_device_t *sd, dvb_fe_type_t type, int t2, int num )
lfe->sf_type_t2 = t2;
lfe->sf_master = master;
lfe->sf_type_override = override ? strdup(override) : NULL;
+ satip_frontend_hacks(lfe);
TAILQ_INIT(&lfe->sf_satconf);
pthread_mutex_init(&lfe->sf_dvr_lock, NULL);
lfe = (satip_frontend_t*)mpegts_input_create0((mpegts_input_t*)lfe, idc, uuid, conf);
int
satip_rtsp_setup( http_client_t *hc, int src, int fe,
- int udp_port, const dvb_mux_conf_t *dmc, int pids0 )
+ int udp_port, const dvb_mux_conf_t *dmc, int flags )
{
static tvh2satip_t msys[] = {
{ .t = DVB_SYS_DVBT, "dvbt" },
dmc->u.dmc_fe_ofdm.guard_interval != DVB_GUARD_INTERVAL_NONE)
ADD(u.dmc_fe_ofdm.guard_interval, gi, "18");
}
- if (pids0)
+ if (flags & SATIP_SETUP_PIDS0)
strcat(buf, "&pids=0");
tvhtrace("satip", "setup params - %s", buf);
if (hc->hc_rtsp_stream_id >= 0)
snprintf(stream = _stream, sizeof(_stream), "/stream=%li",
hc->hc_rtsp_stream_id);
+ if (flags & SATIP_SETUP_PLAY)
+ return rtsp_play(hc, stream, buf);
return rtsp_setup(hc, stream, buf, NULL, udp_port, udp_port + 1);
}