From 07a8f5ff0658d95196ae196baf1c7f88e3c17ca2 Mon Sep 17 00:00:00 2001 From: Jaroslav Kysela Date: Fri, 12 Dec 2014 11:28:04 +0100 Subject: [PATCH] SAT>IP: Do not enable the second RTSP SHUTDOWN sequence by default --- docs/html/config_tvadapters.html | 3 +++ src/input/mpegts/satip/satip.c | 7 +++++ src/input/mpegts/satip/satip_frontend.c | 36 +++++++++++++------------ src/input/mpegts/satip/satip_private.h | 1 + 4 files changed, 30 insertions(+), 17 deletions(-) diff --git a/docs/html/config_tvadapters.html b/docs/html/config_tvadapters.html index fc5e82a6..c1a4e3a6 100644 --- a/docs/html/config_tvadapters.html +++ b/docs/html/config_tvadapters.html @@ -85,6 +85,9 @@ setting this to 100.

PIDs in setup
Enable, if the SAT>IP box requires pids=0 parameter in the SETUP RTSP command.
+

+

Double RTSP Shutdown
+
Enable, if the SAT>IP box might require to send twice the RTSP SHUTDOWN command.

Force pilot for DVB-S2
Enable, if the SAT>IP box requiest plts=on parameter in the SETUP RTSP diff --git a/src/input/mpegts/satip/satip.c b/src/input/mpegts/satip/satip.c index 9962c424..ef5c75fc 100644 --- a/src/input/mpegts/satip/satip.c +++ b/src/input/mpegts/satip/satip.c @@ -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", diff --git a/src/input/mpegts/satip/satip_frontend.c b/src/input/mpegts/satip/satip_frontend.c index b910b58e..d15af32d 100644 --- a/src/input/mpegts/satip/satip_frontend.c +++ b/src/input/mpegts/satip/satip_frontend.c @@ -1474,24 +1474,26 @@ new_tune: } } /* 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; } } } diff --git a/src/input/mpegts/satip/satip_private.h b/src/input/mpegts/satip/satip_private.h index 43cc1ff6..b791ea38 100644 --- a/src/input/mpegts/satip/satip_private.h +++ b/src/input/mpegts/satip/satip_private.h @@ -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; };