Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
SAT>IP: Do not enable the second RTSP SHUTDOWN sequence by default
  • Loading branch information
perexg committed Dec 12, 2014
1 parent d760c4c commit 07a8f5f
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 17 deletions.
3 changes: 3 additions & 0 deletions docs/html/config_tvadapters.html
Expand Up @@ -85,6 +85,9 @@ <h3>The adapters and tuners are listed / edited in a tree</h3>
<p>
<dt><b>PIDs in setup</b></dt>
<dd>Enable, if the SAT>IP box requires pids=0 parameter in the SETUP RTSP command.</dd>
<p>
<dt><b>Double RTSP Shutdown</b></dt>
<dd>Enable, if the SAT>IP box might require to send twice the RTSP SHUTDOWN command.</dd>
<p>
<dt><b>Force pilot for DVB-S2</b></dt>
<dd>Enable, if the SAT>IP box requiest plts=on parameter in the SETUP RTSP
Expand Down
7 changes: 7 additions & 0 deletions src/input/mpegts/satip/satip.c
Expand Up @@ -180,6 +180,13 @@ const idclass_t satip_device_class =
.opts = PO_ADVANCED,
.off = offsetof(satip_device_t, sd_pids0),
},
{
.type = PT_BOOL,
.id = "shutdown2",
.name = "Double RTSP Shutdown",
.opts = PO_ADVANCED,
.off = offsetof(satip_device_t, sd_shutdown2),
},
{
.type = PT_BOOL,
.id = "piloton",
Expand Down
36 changes: 19 additions & 17 deletions src/input/mpegts/satip/satip_frontend.c
Expand Up @@ -1474,24 +1474,26 @@ satip_frontend_input_thread ( void *aux )
}
}
/* for sure - the second sequence */
r = rtsp_teardown(rtsp, (char *)b, NULL);
if (r < 0) {
tvhtrace("satip", "%s - bad teardown2", buf);
} else {
while (1) {
r = http_client_run(rtsp);
if (r != HTTP_CON_RECEIVING && r != HTTP_CON_SENDING)
break;
nfds = tvhpoll_wait(efd, ev, 1, 50); /* only small delay here */
if (nfds == 0)
break;
if (nfds < 0) {
if (ERRNO_AGAIN(errno))
continue;
break;
if (lfe->sf_device->sd_shutdown2) {
r = rtsp_teardown(rtsp, (char *)b, NULL);
if (r < 0) {
tvhtrace("satip", "%s - bad teardown2", buf);
} else {
while (1) {
r = http_client_run(rtsp);
if (r != HTTP_CON_RECEIVING && r != HTTP_CON_SENDING)
break;
nfds = tvhpoll_wait(efd, ev, 1, 50); /* only small delay here */
if (nfds == 0)
break;
if (nfds < 0) {
if (ERRNO_AGAIN(errno))
continue;
break;
}
if(ev[0].events & (TVHPOLL_ERR | TVHPOLL_HUP))
break;
}
if(ev[0].events & (TVHPOLL_ERR | TVHPOLL_HUP))
break;
}
}
}
Expand Down
1 change: 1 addition & 0 deletions src/input/mpegts/satip/satip_private.h
Expand Up @@ -82,6 +82,7 @@ struct satip_device
int sd_sig_scale;
int sd_pids0;
int sd_pilot_on;
int sd_shutdown2;
int sd_dbus_allow;
pthread_mutex_t sd_tune_mutex;
};
Expand Down

0 comments on commit 07a8f5f

Please sign in to comment.