mirror of
https://github.com/mpv-player/mpv
synced 2025-01-13 18:45:25 +00:00
parent
0d35c78a6c
commit
57efe9089c
@ -3192,7 +3192,7 @@ Network
|
||||
network transport when playing ``rtsp://...`` URLs. The value ``lavf``
|
||||
leaves the decision to libavformat.
|
||||
|
||||
``--hls-bitrate=<no|min|max>``
|
||||
``--hls-bitrate=<no|min|max|<rate>>``
|
||||
If HLS streams are played, this option controls what streams are selected
|
||||
by default. The option allows the following parameters:
|
||||
|
||||
@ -3201,6 +3201,9 @@ Network
|
||||
:min: Pick the streams with the lowest bitrate.
|
||||
:max: Same, but highest bitrate. (Default.)
|
||||
|
||||
Additionally, if the option is a number, the stream with the highest rate
|
||||
equal or below the option value is selected.
|
||||
|
||||
The bitrate as used is sent by the server, and there's no guarantee it's
|
||||
actually meaningful.
|
||||
|
||||
|
@ -223,8 +223,8 @@ const m_option_t mp_opts[] = {
|
||||
OPT_CHOICE("audio-display", audio_display, 0,
|
||||
({"no", 0}, {"attachment", 1})),
|
||||
|
||||
OPT_CHOICE("hls-bitrate", hls_bitrate, 0,
|
||||
({"no", 0}, {"min", 1}, {"max", 2})),
|
||||
OPT_CHOICE_OR_INT("hls-bitrate", hls_bitrate, 0, 0, INT_MAX,
|
||||
({"no", -1}, {"min", 0}, {"max", INT_MAX})),
|
||||
|
||||
OPT_STRINGLIST("display-tags*", display_tags, 0),
|
||||
|
||||
@ -722,7 +722,7 @@ const struct MPOpts mp_default_opts = {
|
||||
.demuxer_min_secs = 1.0,
|
||||
.network_rtsp_transport = 2,
|
||||
.network_timeout = 0.0,
|
||||
.hls_bitrate = 2,
|
||||
.hls_bitrate = INT_MAX,
|
||||
.demuxer_min_secs_cache = 10.0,
|
||||
.cache_pausing = 1,
|
||||
.chapterrange = {-1, -1},
|
||||
|
@ -454,10 +454,16 @@ static bool compare_track(struct track *t1, struct track *t2, char **langs,
|
||||
return t1->default_track;
|
||||
if (t1->attached_picture != t2->attached_picture)
|
||||
return !t1->attached_picture;
|
||||
if (t1->stream && t2->stream && opts->hls_bitrate) {
|
||||
int d = t1->stream->hls_bitrate - t2->stream->hls_bitrate;
|
||||
if (d)
|
||||
return opts->hls_bitrate == 1 ? d < 0 : d > 0;
|
||||
if (t1->stream && t2->stream && opts->hls_bitrate >= 0 &&
|
||||
t1->stream->hls_bitrate != t2->stream->hls_bitrate)
|
||||
{
|
||||
bool t1_ok = t1->stream->hls_bitrate <= opts->hls_bitrate;
|
||||
bool t2_ok = t2->stream->hls_bitrate <= opts->hls_bitrate;
|
||||
if (t1_ok != t2_ok)
|
||||
return t1_ok;
|
||||
if (t1_ok && t2_ok)
|
||||
return t1->stream->hls_bitrate > t2->stream->hls_bitrate;
|
||||
return t1->stream->hls_bitrate < t2->stream->hls_bitrate;
|
||||
}
|
||||
return t1->user_tid <= t2->user_tid;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user