stream_dvb: accept float timeout

Change the --dvbin-timeout type to float so that it
can now be set to less than 1 second.
This commit is contained in:
nanahi authored and Kacper Michajłow committed 2025-01-26 22:15:30 +01:00
1 parent c776f5f2c9
commit 964017c06c
5 files changed
+8 -8

No files matched your search

+1 -1
View File
@@ -5517,7 +5517,7 @@ DVB
``channels.conf``, ``--dvbin-full-transponder`` or the magic PID ``channels.conf``, ``--dvbin-full-transponder`` or the magic PID
``8192`` are recommended. ``8192`` are recommended.
``--dvbin-timeout=<1-30>`` ``--dvbin-timeout=<seconds>``
Maximum number of seconds to wait when trying to tune a frequency before Maximum number of seconds to wait when trying to tune a frequency before
giving up (default: 30). giving up (default: 30).
+4 -4
View File
@@ -278,7 +278,7 @@ static void print_status(dvb_priv_t *priv, fe_status_t festatus)
MP_VERBOSE(priv, "\n"); MP_VERBOSE(priv, "\n");
} }
static int check_status(dvb_priv_t *priv, int fd_frontend, int tmout) static int check_status(dvb_priv_t *priv, int fd_frontend, float tmout)
{ {
fe_status_t festatus; fe_status_t festatus;
bool ok = false; bool ok = false;
@@ -308,7 +308,7 @@ static int check_status(dvb_priv_t *priv, int fd_frontend, int tmout)
if (!(festatus & FE_HAS_LOCK)) { if (!(festatus & FE_HAS_LOCK)) {
MP_ERR(priv, "Not able to lock to the signal on the given frequency, " MP_ERR(priv, "Not able to lock to the signal on the given frequency, "
"timeout: %d\n", tmout); "timeout: %g\n", tmout);
return -1; return -1;
} }
@@ -403,7 +403,7 @@ static int tune_it(dvb_priv_t *priv, int fd_frontend, unsigned int delsys,
fe_guard_interval_t guardInterval, fe_guard_interval_t guardInterval,
fe_bandwidth_t bandwidth, fe_bandwidth_t bandwidth,
fe_code_rate_t LP_CodeRate, fe_hierarchy_t hier, fe_code_rate_t LP_CodeRate, fe_hierarchy_t hier,
int timeout) float timeout)
{ {
dvb_state_t *state = priv->state; dvb_state_t *state = priv->state;
@@ -634,7 +634,7 @@ int dvb_tune(dvb_priv_t *priv, unsigned int delsys,
fe_transmit_mode_t TransmissionMode, fe_bandwidth_t bandWidth, fe_transmit_mode_t TransmissionMode, fe_bandwidth_t bandWidth,
fe_code_rate_t HP_CodeRate, fe_code_rate_t HP_CodeRate,
fe_code_rate_t LP_CodeRate, fe_hierarchy_t hier, fe_code_rate_t LP_CodeRate, fe_hierarchy_t hier,
int timeout) float timeout)
{ {
MP_INFO(priv, "Tuning to %s frequency %lu Hz\n", MP_INFO(priv, "Tuning to %s frequency %lu Hz\n",
get_dvb_delsys(delsys), (long unsigned int) freq); get_dvb_delsys(delsys), (long unsigned int) freq);
+1 -1
View File
@@ -36,6 +36,6 @@ int dvb_tune(dvb_priv_t *priv, unsigned int delsys,
fe_modulation_t modulation, fe_guard_interval_t guardInterval, fe_modulation_t modulation, fe_guard_interval_t guardInterval,
fe_transmit_mode_t TransmissionMode, fe_bandwidth_t bandWidth, fe_transmit_mode_t TransmissionMode, fe_bandwidth_t bandWidth,
fe_code_rate_t HP_CodeRate, fe_code_rate_t LP_CodeRate, fe_code_rate_t HP_CodeRate, fe_code_rate_t LP_CodeRate,
fe_hierarchy_t hier, int timeout); fe_hierarchy_t hier, float timeout);
#endif /* MPLAYER_DVB_TUNE_H */ #endif /* MPLAYER_DVB_TUNE_H */
+1 -1
View File
@@ -89,7 +89,7 @@ typedef struct {
typedef struct { typedef struct {
char *cfg_prog; char *cfg_prog;
int cfg_devno; int cfg_devno;
int cfg_timeout; float cfg_timeout;
char *cfg_file; char *cfg_file;
bool cfg_full_transponder; bool cfg_full_transponder;
int cfg_channel_switch_offset; int cfg_channel_switch_offset;
+1 -1
View File
@@ -74,7 +74,7 @@ const struct m_sub_options stream_dvb_conf = {
.opts = (const m_option_t[]) { .opts = (const m_option_t[]) {
{"prog", OPT_STRING(cfg_prog), .flags = UPDATE_DVB_PROG}, {"prog", OPT_STRING(cfg_prog), .flags = UPDATE_DVB_PROG},
{"card", OPT_INT(cfg_devno), M_RANGE(0, MAX_ADAPTERS-1)}, {"card", OPT_INT(cfg_devno), M_RANGE(0, MAX_ADAPTERS-1)},
{"timeout", OPT_INT(cfg_timeout), M_RANGE(1, 30)}, {"timeout", OPT_FLOAT(cfg_timeout), M_RANGE(0, FLT_MAX)},
{"file", OPT_STRING(cfg_file), .flags = M_OPT_FILE}, {"file", OPT_STRING(cfg_file), .flags = M_OPT_FILE},
{"full-transponder", OPT_BOOL(cfg_full_transponder)}, {"full-transponder", OPT_BOOL(cfg_full_transponder)},
{"channel-switch-offset", OPT_INT(cfg_channel_switch_offset), {"channel-switch-offset", OPT_INT(cfg_channel_switch_offset),