diff options
author | Christoph Heinrich <christoph.heinrich@student.tugraz.at> | 2022-07-10 20:07:50 +0200 |
---|---|---|
committer | Dudemanguy <random342@airmail.cc> | 2022-08-12 14:31:59 +0000 |
commit | 813dfe19242bc7672470077cc37c373f92730e05 (patch) | |
tree | d6f3aa872ad93a69023e91c326e48fc612c16592 /options/parse_commandline.c | |
parent | a3b2d3f9308e763a100d0359749c3691dcb2ab0f (diff) | |
download | mpv-813dfe19242bc7672470077cc37c373f92730e05.tar.bz2 mpv-813dfe19242bc7672470077cc37c373f92730e05.tar.xz |
ytdl_hook: fix default track for single format
Tracks are marked as default tracks based on what yt-dlp/youtube-dl
returns in the field `requested_formats`. The problem is that this field
only exists when there is more then one requested format.
So `ytdl-format=bestvideo+bestaudio` would have that field,
but `ytdl-format=bestaudio` would not,
leading to no tracks being marked as default tracks.
The requested formats can also be found under `requested_downloads`,
which exists regardless of the number of requested formats.
However when there is more then one requested format,
`requested_downloads` doesn't contain those formats directly and instead
has a field `requested_formats` that is identical to the other
`requested_formats`. Therefore use `requested_downloads` as a fallback
for when `requested_formats` doesn't exist.
Diffstat (limited to 'options/parse_commandline.c')
0 files changed, 0 insertions, 0 deletions