mirror of
https://github.com/mpv-player/mpv
synced 2025-02-13 18:37:10 +00:00
stream_dvb: Correct range for dvbin-card option.
Adapt documentation accordingly and also, fix an off-by-one check in the code. closes #6371
This commit is contained in:
parent
5bcac8580d
commit
d6d6da4711
@ -4057,8 +4057,8 @@ Network
|
||||
DVB
|
||||
---
|
||||
|
||||
``--dvbin-card=<1-4>``
|
||||
Specifies using card number 1-4 (default: 1).
|
||||
``--dvbin-card=<0-15>``
|
||||
Specifies using card number 0-15 (default: 0).
|
||||
|
||||
``--dvbin-file=<filename>``
|
||||
Instructs mpv to read the channels list from ``<filename>``. The default is
|
||||
|
@ -73,7 +73,7 @@ static pthread_mutex_t global_dvb_state_lock = PTHREAD_MUTEX_INITIALIZER;
|
||||
const struct m_sub_options stream_dvb_conf = {
|
||||
.opts = (const m_option_t[]) {
|
||||
OPT_STRING("prog", cfg_prog, 0),
|
||||
OPT_INTRANGE("card", cfg_devno, 0, 1, 4),
|
||||
OPT_INTRANGE("card", cfg_devno, 0, 0, MAX_ADAPTERS-1),
|
||||
OPT_INTRANGE("timeout", cfg_timeout, 0, 1, 30),
|
||||
OPT_STRING("file", cfg_file, M_OPT_FILE),
|
||||
OPT_FLAG("full-transponder", cfg_full_transponder, 0),
|
||||
@ -1157,7 +1157,7 @@ dvb_state_t *dvb_get_state(stream_t *stream)
|
||||
if (devno.len) {
|
||||
bstr r;
|
||||
priv->cfg_devno = bstrtoll(devno, &r, 0);
|
||||
if (r.len || priv->cfg_devno < 0 || priv->cfg_devno > MAX_ADAPTERS) {
|
||||
if (r.len || priv->cfg_devno < 0 || priv->cfg_devno >= MAX_ADAPTERS) {
|
||||
MP_ERR(stream, "invalid devno: '%.*s'\n", BSTR_P(devno));
|
||||
return NULL;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user