From: Jaroslav Kysela Date: Tue, 17 Mar 2015 13:02:53 +0000 (+0100) Subject: SAT>IP Client: maintain session also in the idle mode X-Git-Tag: v4.1~267 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=74adbe8f7d82bb4899cead89340acbf397404981;p=thirdparty%2Ftvheadend.git SAT>IP Client: maintain session also in the idle mode --- diff --git a/src/input/mpegts/satip/satip_frontend.c b/src/input/mpegts/satip/satip_frontend.c index c5e7d1246..fdad41c76 100644 --- a/src/input/mpegts/satip/satip_frontend.c +++ b/src/input/mpegts/satip/satip_frontend.c @@ -1207,10 +1207,16 @@ satip_frontend_input_thread ( void *aux ) efd = tvhpoll_create(4); rtsp = NULL; + /* Setup buffers */ + sbuf_init(&sb); + udp_multirecv_init(&um, 0, 0); + /* * New tune */ new_tune: + sbuf_free(&sb); + udp_multirecv_free(&um); udp_close(rtcp); udp_close(rtp); rtcp = rtp = NULL; @@ -1246,11 +1252,22 @@ new_tune: } } - if (ev[0].data.ptr == rtsp) { + if (rtsp && ev[0].data.ptr == rtsp) { r = http_client_run(rtsp); if (r < 0) { http_client_close(rtsp); rtsp = NULL; + } else { + switch (rtsp->hc_cmd) { + case RTSP_CMD_OPTIONS: + rtsp_options_decode(rtsp); + break; + case RTSP_CMD_SETUP: + rtsp_setup_decode(rtsp, 1); + break; + default: + break; + } } }