From 811eeb437653dd4e6781343c3c032420990e4186 Mon Sep 17 00:00:00 2001 From: Jaroslav Kysela Date: Sun, 14 Dec 2014 13:32:25 +0100 Subject: [PATCH] linuxdvb diseqc: reset cache values when frontend is closed, fixes #2547 --- src/input/mpegts/linuxdvb/linuxdvb_frontend.c | 4 ++++ src/input/mpegts/linuxdvb/linuxdvb_private.h | 3 +++ src/input/mpegts/linuxdvb/linuxdvb_satconf.c | 12 ++++++++++++ 3 files changed, 19 insertions(+) diff --git a/src/input/mpegts/linuxdvb/linuxdvb_frontend.c b/src/input/mpegts/linuxdvb/linuxdvb_frontend.c index c3ed43f2..1d7a433f 100644 --- a/src/input/mpegts/linuxdvb/linuxdvb_frontend.c +++ b/src/input/mpegts/linuxdvb/linuxdvb_frontend.c @@ -209,6 +209,8 @@ linuxdvb_frontend_enabled_updated ( mpegts_input_t *mi ) if (lfe->lfe_fe_fd > 0) { close(lfe->lfe_fe_fd); lfe->lfe_fe_fd = -1; + if (lfe->lfe_satconf) + linuxdvb_satconf_reset(lfe->lfe_satconf); } gtimer_disarm(&lfe->lfe_monitor_timer); @@ -483,6 +485,8 @@ linuxdvb_frontend_monitor ( void *aux ) tvhtrace("linuxdvb", "%s - closing frontend", buf); close(lfe->lfe_fe_fd); lfe->lfe_fe_fd = -1; + if (lfe->lfe_satconf) + linuxdvb_satconf_reset(lfe->lfe_satconf); } /* Check accessibility */ diff --git a/src/input/mpegts/linuxdvb/linuxdvb_private.h b/src/input/mpegts/linuxdvb/linuxdvb_private.h index 292f0993..acb3b435 100644 --- a/src/input/mpegts/linuxdvb/linuxdvb_private.h +++ b/src/input/mpegts/linuxdvb/linuxdvb_private.h @@ -335,4 +335,7 @@ void linuxdvb_satconf_post_stop_mux( linuxdvb_satconf_t *ls ); int linuxdvb_satconf_start_mux ( linuxdvb_satconf_t *ls, mpegts_mux_instance_t *mmi ); +void linuxdvb_satconf_reset + ( linuxdvb_satconf_t *ls ); + #endif /* __TVH_LINUXDVB_PRIVATE_H__ */ diff --git a/src/input/mpegts/linuxdvb/linuxdvb_satconf.c b/src/input/mpegts/linuxdvb/linuxdvb_satconf.c index 86552a3f..38cb8704 100644 --- a/src/input/mpegts/linuxdvb/linuxdvb_satconf.c +++ b/src/input/mpegts/linuxdvb/linuxdvb_satconf.c @@ -776,6 +776,18 @@ linuxdvb_satconf_start_mux return linuxdvb_satconf_ele_tune(lse); } +/* + * + */ +void +linuxdvb_satconf_reset + ( linuxdvb_satconf_t *ls ) +{ + ls->ls_last_switch = NULL; + ls->ls_last_pol = 0; + ls->ls_last_toneburst = 0; +} + /* ************************************************************************** * Create/Delete satconf * *************************************************************************/