Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
SAT>IP: Remove double teardown workaround (wasn't working)
  • Loading branch information
perexg committed Jan 13, 2015
1 parent d9b7817 commit ef9556e
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 22 deletions.
7 changes: 0 additions & 7 deletions src/input/mpegts/satip/satip.c
Expand Up @@ -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",
Expand Down
32 changes: 18 additions & 14 deletions src/input/mpegts/satip/satip_frontend.c
Expand Up @@ -1072,8 +1072,7 @@ satip_frontend_extra_shutdown
}

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;
Expand All @@ -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) {
Expand All @@ -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 )
{
Expand Down Expand Up @@ -1188,7 +1178,21 @@ satip_frontend_input_thread ( void *aux )

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;
}
Expand Down Expand Up @@ -1604,7 +1608,7 @@ satip_frontend_input_thread ( void *aux )
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;
}
Expand Down
1 change: 0 additions & 1 deletion src/input/mpegts/satip/satip_private.h
Expand Up @@ -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;
};
Expand Down

0 comments on commit ef9556e

Please sign in to comment.