From ef9556efff6298f6adaf59cb38cf0813dc91ad85 Mon Sep 17 00:00:00 2001 From: Jaroslav Kysela Date: Tue, 13 Jan 2015 16:38:20 +0100 Subject: [PATCH] SAT>IP: Remove double teardown workaround (wasn't working) --- src/input/mpegts/satip/satip.c | 7 ------ src/input/mpegts/satip/satip_frontend.c | 32 ++++++++++++++----------- src/input/mpegts/satip/satip_private.h | 1 - 3 files changed, 18 insertions(+), 22 deletions(-) diff --git a/src/input/mpegts/satip/satip.c b/src/input/mpegts/satip/satip.c index ef5c75fc..9962c424 100644 --- a/src/input/mpegts/satip/satip.c +++ b/src/input/mpegts/satip/satip.c @@ -180,13 +180,6 @@ 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 0f747852..ba8f5d09 100644 --- a/src/input/mpegts/satip/satip_frontend.c +++ b/src/input/mpegts/satip/satip_frontend.c @@ -1072,8 +1072,7 @@ done: } static void -satip_frontend_shutdown1 ( http_client_t *rtsp, tvhpoll_t *efd, - int shutdown2, int timeout ) +satip_frontend_shutdown ( http_client_t *rtsp, tvhpoll_t *efd ) { char b[32]; tvhpoll_event_t ev; @@ -1091,7 +1090,7 @@ satip_frontend_shutdown1 ( http_client_t *rtsp, tvhpoll_t *efd, r = http_client_run(rtsp); if (r != HTTP_CON_RECEIVING && r != HTTP_CON_SENDING) break; - nfds = tvhpoll_wait(efd, &ev, 1, timeout); + nfds = tvhpoll_wait(efd, &ev, 1, 400); if (nfds == 0) break; if (nfds < 0) { @@ -1105,15 +1104,6 @@ satip_frontend_shutdown1 ( http_client_t *rtsp, tvhpoll_t *efd, } } -static void -satip_frontend_shutdown - ( satip_frontend_t *lfe, http_client_t *rtsp, tvhpoll_t *efd, int shutdown2 ) -{ - satip_frontend_shutdown1(rtsp, efd, shutdown2, 250); - if (shutdown2) - satip_frontend_shutdown1(rtsp, efd, shutdown2, 50); -} - static void satip_frontend_tuning_error ( satip_frontend_t *lfe, satip_tune_req_t *tr ) { @@ -1188,7 +1178,21 @@ new_tune: if (!tvheadend_running) { exit_flag = 1; goto done; } if (rtsp && nfds == 0) { - satip_frontend_shutdown(lfe, rtsp, efd, lfe->sf_device->sd_shutdown2); + + memset(ev, 0, sizeof(ev)); + ev[0].events = TVHPOLL_IN; + ev[0].fd = lfe->sf_dvr_pipe.rd; + ev[0].data.ptr = NULL; + tvhpoll_rem(efd, ev, 1); + + satip_frontend_shutdown(rtsp, efd); + + memset(ev, 0, sizeof(ev)); + ev[0].events = TVHPOLL_IN; + ev[0].fd = lfe->sf_dvr_pipe.rd; + ev[0].data.ptr = NULL; + tvhpoll_add(efd, ev, 1); + http_client_close(rtsp); rtsp = NULL; } @@ -1604,7 +1608,7 @@ new_tune: tvhpoll_rem(efd, ev, 3); if (exit_flag) { - satip_frontend_shutdown(lfe, rtsp, efd, lfe->sf_device->sd_shutdown2); + satip_frontend_shutdown(rtsp, efd); http_client_close(rtsp); rtsp = NULL; } diff --git a/src/input/mpegts/satip/satip_private.h b/src/input/mpegts/satip/satip_private.h index b791ea38..43cc1ff6 100644 --- a/src/input/mpegts/satip/satip_private.h +++ b/src/input/mpegts/satip/satip_private.h @@ -82,7 +82,6 @@ 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; };