From b9af4409bcdfb85a39fd08a25ed59e54a9c07283 Mon Sep 17 00:00:00 2001 From: Oliver Freyermuth Date: Wed, 4 Oct 2017 18:26:56 +0200 Subject: dvb: Explicitly clear via DVBv5 before reverting to DVBv3. Signed-off-by: Oliver Freyermuth --- stream/dvb_tune.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/stream/dvb_tune.c b/stream/dvb_tune.c index da4a8f5ad3..d3993ae65d 100644 --- a/stream/dvb_tune.c +++ b/stream/dvb_tune.c @@ -714,8 +714,18 @@ static int tune_it(dvb_priv_t *priv, int fd_frontend, unsigned int delsys, int tune_status = check_status(priv, fd_frontend, timeout); if (tune_status != 0) { - MP_ERR(priv, "ERROR locking to channel when tuning with S2API, falling back to DVBv3-tuning.\n"); - goto old_api; + MP_ERR(priv, "ERROR locking to channel when tuning with S2API, clearing and falling back to DVBv3-tuning.\n"); + struct dtv_property p_clear[] = { + { .cmd = DTV_CLEAR }, + }; + struct dtv_properties cmdseq_clear = { + .num = 1, + .props = p_clear + }; + if (ioctl(fd_frontend, FE_SET_PROPERTY, &cmdseq_clear) < 0) { + MP_ERR(priv, "FE_SET_PROPERTY DTV_CLEAR failed\n"); + } + goto old_api; } else { return tune_status; } -- cgit v1.2.3