mirror of
https://github.com/mpv-player/mpv
synced 2025-03-20 18:28:01 +00:00
stream_dvb: Adapt to VDR channel config format.
While they accept the frequency field with MHz for DVB-S, for DVB-C and DVB-T, it may be in Hz, kHz or MHz. The official rule is to multiply whatever is in the channels.conf by 1000 until a value > 1000000 is reached to get correct units for tuning.
This commit is contained in:
parent
94c414bd1c
commit
66128dec82
@ -356,9 +356,14 @@ static dvb_channels_list_t *dvb_get_channels(struct mp_log *log,
|
||||
mod[0] = '\0';
|
||||
// It's a VDR-style config line.
|
||||
parse_vdr_par_string(vdr_par_str, ptr);
|
||||
// Units in VDR-style config files are divided by 1000.
|
||||
ptr->freq *= 1000UL;
|
||||
ptr->srate *= 1000UL;
|
||||
// Frequency in VDR-style config files is in MHz for DVB-S,
|
||||
// and may be in MHz, kHz or Hz for DVB-C and DVB-T.
|
||||
// General rule to get useful units is to multiply by 1000 until value is larger than 1000000.
|
||||
while (ptr->freq < 1000000UL) {
|
||||
ptr->freq *= 1000UL;
|
||||
}
|
||||
// Symbol rate in VDR-style config files is divided by 1000.
|
||||
ptr->srate *= 1000UL;
|
||||
switch (delsys) {
|
||||
case SYS_DVBT:
|
||||
case SYS_DVBT2:
|
||||
|
Loading…
Reference in New Issue
Block a user