summaryrefslogtreecommitdiffstats
path: root/stream
diff options
context:
space:
mode:
authorOliver Freyermuth <o.freyermuth@googlemail.com>2016-01-20 00:29:47 +0100
committerwm4 <wm4@nowhere>2016-01-21 00:34:02 +0100
commitab59c5f5227ea1ea03169f24c99ca75fae80ad1a (patch)
tree3a34965249641190f8bc25baeea35a7bc15c4379 /stream
parente904129b79dffb0ac2c661b164157064d03b9095 (diff)
downloadmpv-ab59c5f5227ea1ea03169f24c99ca75fae80ad1a.tar.bz2
mpv-ab59c5f5227ea1ea03169f24c99ca75fae80ad1a.tar.xz
stream_dvb: don't requery tuner type, rely on initial query.
Saves one unnecessary additional ioctl per tuning by just reusing existing information. Should also fix the case of multiple supported delivery types since we now rely on the initial query from the chosen configuration after channel list parsing instead of requerying the device.
Diffstat (limited to 'stream')
-rw-r--r--stream/dvb_tune.c20
1 files changed, 9 insertions, 11 deletions
diff --git a/stream/dvb_tune.c b/stream/dvb_tune.c
index 1f982d6887..3c1095cc5d 100644
--- a/stream/dvb_tune.c
+++ b/stream/dvb_tune.c
@@ -442,8 +442,10 @@ static int tune_it(dvb_priv_t *priv, int fd_frontend,
int timeout)
{
int hi_lo = 0, dfd;
+
+ dvb_state_t* state = priv->state;
+
struct dvb_frontend_parameters feparams;
- struct dvb_frontend_info fe_info;
MP_VERBOSE(priv, "TUNE_IT, fd_frontend %d, freq %lu, srate %lu, "
"pol %c, tone %i, diseqc %u\n", fd_frontend,
@@ -451,12 +453,8 @@ static int tune_it(dvb_priv_t *priv, int fd_frontend,
tone, diseqc);
memset(&feparams, 0, sizeof(feparams));
- if (ioctl(fd_frontend, FE_GET_INFO, &fe_info) < 0) {
- MP_FATAL(priv, "FE_GET_INFO FAILED\n");
- return -1;
- }
- MP_VERBOSE(priv, "Using DVB card \"%s\"\n", fe_info.name);
+ MP_VERBOSE(priv, "Using DVB card \"%s\"\n", state->cards[state->card].name);
{
/* discard stale QPSK events */
@@ -467,8 +465,8 @@ static int tune_it(dvb_priv_t *priv, int fd_frontend,
}
}
- switch (fe_info.type) {
- case FE_OFDM:
+ switch (state->tuner_type) {
+ case TUNER_TER:
if (freq < 1000000)
freq *= 1000UL;
feparams.frequency = freq;
@@ -487,7 +485,7 @@ static int tune_it(dvb_priv_t *priv, int fd_frontend,
return -1;
}
break;
- case FE_QPSK:
+ case TUNER_SAT:
// DVB-S
if (freq > 2200000) {
// this must be an absolute frequency
@@ -565,7 +563,7 @@ static int tune_it(dvb_priv_t *priv, int fd_frontend,
}
#endif
break;
- case FE_QAM:
+ case TUNER_CBL:
feparams.frequency = freq;
feparams.inversion = specInv;
feparams.u.qam.symbol_rate = srate;
@@ -578,7 +576,7 @@ static int tune_it(dvb_priv_t *priv, int fd_frontend,
}
break;
#ifdef DVB_ATSC
- case FE_ATSC:
+ case TUNER_ATSC:
feparams.frequency = freq;
feparams.u.vsb.modulation = modulation;
MP_VERBOSE(priv, "tuning ATSC to %d, modulation=%d\n", freq, modulation);