0
0
mirror of https://github.com/mpv-player/mpv.git synced 2024-09-20 20:03:10 +02:00
Commit Graph

13 Commits

Author SHA1 Message Date
Guido Cella
dc998560aa options: add --osd-playlist-entry
Allow configuring whether to print the media-title, the filename or both
(as `<title> (<filename>)`) in show-text ${playlist}, the OSC playlist
and in the playlist selector.

Showing only titles hides information when files are badly tagged, or
when it hides the track numbers of album songs. But showing filenames is
not as useful as titles e.g. when playing URLs with media titles. This
option lets the user choose which one to show, or show both if switching
is inconvenient.

The OSC's playlist_media_title script-opt is removed because this option
is better since it works everywhere after configuring it once.

Closes #11653.

Also show the full URLs of playlist entries instead of their basenames
in osc.lua and select.lua, consistently with mp_property_playlist().

For simplicity, this just checks if entries contain :// instead of
replicating all of mp_is_url().

Co-authored-by: Kacper Michajłow <kasper93@gmail.com>
2024-06-08 01:43:15 +02:00
Guido Cella
75645263dd select.lua: support extracting ytdl_hook subtitles
They don't work because they have EDL URLs, but we can attempt to
extract their real URLs.
2024-06-07 22:45:41 +02:00
Guido Cella
5657cd65b7 select.lua: hide the hour when it's 0
Omit the hour in the chapter and subtitle line selectors when the file
is shorter than an hour.
2024-06-07 22:45:41 +02:00
Guido Cella
8939bfc3ef select.lua: seek to the currect subtitle line when paused without video
Add an offset to sub seek correctly like in b35e34ae2f. The extra 0.01
offset apparently isn't necessary in this case.
2024-06-07 22:45:41 +02:00
Guido Cella
4059d1832b select.lua: preselect the correct sub line with duration >= 100 minutes
ffmpeg outputs timestamps like '100:00.00' in LRCs instead of adding
hours, and timestamps like '100:00' are < '10:00', so since these
strings are being compared, if there is no current subtitle line, there
are subtitle lines at >= 100 minutes, and time-pos is between 10 minutes
and 100 minutes, one of the last subtitle lines gets preselected.

Fix this by converting the timestamps to numbers before comparing them.

Also simplify the logic by merging the 2 loops to determine the default
line, and reformat the timestamps by adding hours to not print minutes >
60 in the selector, and by removing the hundredths of seconds. This
requires storing the accurate timestamps in a table to seek to them on
submit.
2024-06-07 22:45:41 +02:00
Kacper Michajłow
c3bf2c72a6 select.lua: allow ffmpeg to print errors if it fails
Also don't print subprocess result to OSD, as it is not comprehensible.
2024-05-20 18:32:22 +02:00
Guido Cella
b82d437ea4 select.lua: strip trailing zeros from FPS values
Show e.g. "30 fps" instead of "30.000 fps".

Also switch to %.4f for consistency with pretty_print_double().
2024-05-20 17:54:57 +02:00
Guido Cella
78b2de677b select.lua: handle sub-start being earlier than ffmpeg's timestamps 2024-05-20 17:54:40 +02:00
Guido Cella
8f596b44be select.lua: don't needlessly initialize default_item 2024-05-20 17:54:40 +02:00
Guido Cella
99fd55ad75 select.lua: preselect the previous sub line without a current line 2024-05-20 17:54:40 +02:00
Guido Cella
ce2f501c23 select.lua: fix preselecting the current subtitle line
Fixes 4d32db21c5.
2024-05-20 17:54:40 +02:00
Guido Cella
4d32db21c5 select.lua: strip brackets in select-subtitle-line 2024-05-13 16:36:27 +02:00
Guido Cella
61f72bd512 select.lua: add this script
This adds script messages to select playlist entries, tracks, chapters,
subtitle lines, bindings and properties using the newly introduced
mp.input.select().

This fully closes #13964.
2024-05-12 23:13:48 +02:00