mirror of
https://github.com/mpv-player/mpv.git
synced 2026-05-07 20:02:49 +00:00
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:
@@ -5517,7 +5517,7 @@ DVB
|
||||
``channels.conf``, ``--dvbin-full-transponder`` or the magic PID
|
||||
``8192`` are recommended.
|
||||
|
||||
``--dvbin-timeout=<1-30>``
|
||||
``--dvbin-timeout=<seconds>``
|
||||
Maximum number of seconds to wait when trying to tune a frequency before
|
||||
giving up (default: 30).
|
||||
|
||||
|
||||
+4
-4
@@ -278,7 +278,7 @@ static void print_status(dvb_priv_t *priv, fe_status_t festatus)
|
||||
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;
|
||||
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)) {
|
||||
MP_ERR(priv, "Not able to lock to the signal on the given frequency, "
|
||||
"timeout: %d\n", tmout);
|
||||
"timeout: %g\n", tmout);
|
||||
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_bandwidth_t bandwidth,
|
||||
fe_code_rate_t LP_CodeRate, fe_hierarchy_t hier,
|
||||
int timeout)
|
||||
float timeout)
|
||||
{
|
||||
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_code_rate_t HP_CodeRate,
|
||||
fe_code_rate_t LP_CodeRate, fe_hierarchy_t hier,
|
||||
int timeout)
|
||||
float timeout)
|
||||
{
|
||||
MP_INFO(priv, "Tuning to %s frequency %lu Hz\n",
|
||||
get_dvb_delsys(delsys), (long unsigned int) freq);
|
||||
|
||||
+1
-1
@@ -36,6 +36,6 @@ int dvb_tune(dvb_priv_t *priv, unsigned int delsys,
|
||||
fe_modulation_t modulation, fe_guard_interval_t guardInterval,
|
||||
fe_transmit_mode_t TransmissionMode, fe_bandwidth_t bandWidth,
|
||||
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 */
|
||||
|
||||
+1
-1
@@ -89,7 +89,7 @@ typedef struct {
|
||||
typedef struct {
|
||||
char *cfg_prog;
|
||||
int cfg_devno;
|
||||
int cfg_timeout;
|
||||
float cfg_timeout;
|
||||
char *cfg_file;
|
||||
bool cfg_full_transponder;
|
||||
int cfg_channel_switch_offset;
|
||||
|
||||
+1
-1
@@ -74,7 +74,7 @@ const struct m_sub_options stream_dvb_conf = {
|
||||
.opts = (const m_option_t[]) {
|
||||
{"prog", OPT_STRING(cfg_prog), .flags = UPDATE_DVB_PROG},
|
||||
{"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},
|
||||
{"full-transponder", OPT_BOOL(cfg_full_transponder)},
|
||||
{"channel-switch-offset", OPT_INT(cfg_channel_switch_offset),
|
||||
|
||||
Reference in New Issue
Block a user