Commit Graph

3326 Commits

Author SHA1 Message Date
Kacper Michajłow 3ab5401b38 player/command: remove video-aspect property
4 years is enough of deprecation period.
2023-08-31 17:37:42 +00:00
Niklas Haas 7f9b1b32a5 stats.lua: enable --tone-mapping-visualize while stats shown
Except in oneshot mode. Controllable via new option.
2023-08-30 17:10:13 +02:00
Kacper Michajłow 15ada7c41c stats.lua: display hdr metadata and peak detection 2023-08-29 20:58:44 +02:00
Kacper Michajłow 3cf71fd7c7 command: add hdr-metadata property 2023-08-29 20:58:44 +02:00
Dudemanguy df613cef4c loadfile: fix --no-subs-with-matching-audio with --slang
If --slang was set to some language and it matched the subtitle track,
then --no-subs-with-matching-audio would do nothing. Fix the logic by
doing the --no-subs-with-matching-audio step at the end to ensure that
it always "wins" over whatever --slang or --subs-fallback has set.
Clarify the docs a bit to make it clearer that this is the intended
behavior. Fixes fbe8f99194.
2023-08-29 12:34:27 -05:00
Dudemanguy 92fe8f1a4e osc: replace sub-forced-only with sub-forced-events-only 2023-08-29 16:39:00 +00:00
Dudemanguy a062f115a1 command: remove sub-forced-only-cur property
Since we no longer have the auto choice, this is always exactly equal to
the value of the option (sub-forced-events-only). Remove the property
and alias it.
2023-08-29 16:39:00 +00:00
Dudemanguy 9b9475e218 player: rename --sub-forced-only to --sub-forced-events-only
The old name is pretty bad and users mistakenly think it has something
to do with selecting forced subtitles (that would be
--subs-fallback-forced). Instead of giving it such a generic name, make
it clearer that this has to do specifically with forced sub events
which is only relevant for a small minority of subtitles.
2023-08-29 16:39:00 +00:00
Dudemanguy 4009e99b9c player: remove auto choice from sub-forced-only
First of all, this never worked. Or if it ever did, it was in some
select few scenarios. c9474dc9ed is what
originally added support for the auto choice. However, that commit
worked by propagating a value to a fake option used internally. This
shouldn't have ever worked because the underlying m_config_cache was
never updated so the value shouldn't have been preserved when accessed
in sd_lavc. And indeed with some testing, the value there is always 0
unsurprisingly.

This was later rewritten in ba7cc07106
along with a lot of other sub changes, but with that, it was still
mostly broken. The reason is because one of the key parts of having to
hit this logic (prefer_forced) required `--no-subs-with-matching-audio`
to be set. If the audio language matches the subtitle language (the
requirement also excludes forced subs), the option makes no subtitle
selection in the first place so pick->forced_only_def is not set to true
and nothing even happens. Another way around this would be to attempt to
change your OS language (like with the LANG environment variable) so
that the subtitle track gets selected but then audio_matches mistakenly
becomes false because it compares the OS language to the audio language
which then make preferred_forced 0, so nothing happens. I don't think
there's a scenario where pick->forced_only_def is actually set to true
(thus meaning `auto` is useless), but maybe someone could contrive
something very strange. Regardless, it's definitely not something even
remotely common.

fbe8f99194 changed track selection again
but didn't consider this particular case. The net result is that DVD/PGS
subs become equivalent to --sub-forced-only being yes, so this a change
in behavior and probably not a good one. Note that I wasn't able to
actually observe any difference in a PGS sample. It still displayed
subtitles fine but that sample probably didn't have the right flags to
hit the sub-forced-only logic.

Anyways, the auto feature is extremely questionable at best and in my
view, not actually worth it. It is meant to be used with
`--no-subs-with-matching-audio` to display forced pictures in subtitle
tracks that are not marked as forced, but that contradicts that
particular option's purpose and description in the manual (secretly
selecting a track under certain conditions even though it says not to).

Instead of trying to shove all this logic into select_default_track
which is already insanely complicated as it is, recognize that this is a
trivial lua script. If you absolutely want to turn --sub-forced-only on
under these certain conditions (DVD/PGS subtitles, matching audio and
subtitle languages, etc.), just look at the current-tracks property and
do your thing. The very, very niche behavior that this option tried to
accomplish basically never worked, no user even knows what this option
does, and well it's just not worth supporting in core mpv code. Drop
all this code for sanity's sake and change --sub-forced-only back to a
bool.
2023-08-29 16:39:00 +00:00
Kacper Michajłow 2a969a833f stats.lua: add hints about scrolling 2023-08-28 21:14:26 +02:00
Kacper Michajłow ce64b5687b stats.lua: refactor video params display
- Move window scale to scaled resolution line
- add deinterlacing display
- rename "Gamma" to "Transfer"
- reorder to colormatrix/primaries/transfer as commonly used by
  ffmpeg/ffprobe
2023-08-28 21:14:26 +02:00
Kacper Michajłow 42f8c71aa0 stats.lua: remove dummy new lines from headers 2023-08-28 21:14:26 +02:00
Kacper Michajłow 52bf44d2e0 stats.lua: display actual output video size after anamorphic correction
This makes much more sens than frame size that is the same as native
one.
2023-08-28 21:14:26 +02:00
Dudemanguy 165f9e061f player: add always to --subs-fallback-forced
In general, forced tracks should only be shown if they match the
language of the audio. However some people do want them no matter what,
so add an always option to this so such tracks are always selected.
2023-08-28 18:43:46 +00:00
Dudemanguy 58ec0630f5 player: add --subs-match-os-language option
This is the replacement for the previous auto option for slang. It
behaves similar however it never overrides slang if that is set and will
instead try to pick the subtitle that matches the user's language if
appropriately flagged by the file.
2023-08-28 18:43:46 +00:00
Dudemanguy fbe8f99194 loadfile: simplify default track selection a bit
What was previously there is extremely complicated and really confusing.
Poorly named variables like "prefer_forced" that don't neccesarily have
anything to do with prefering forced tracks didn't help either. Try to
rewrite a few things to be saner. The idea is that after you loop
through the tracks, the special sub-specific options (like subs-fallback
and so on) should be handled and the track should be deselected if
appropriate. Another change is to remove the "prefered_forced" argument
in compare_track. This actually was both not neccessary and caused bad
behavior by always depriortizing forced tracks even when it didn't apply
(e.g. forced video tracks were never selected even though the flag
should simply be ignored for anything that's not a subtitle track).
2023-08-28 18:43:46 +00:00
Dudemanguy 53d032374d player: remove special auto option from alang/slang/vlang
This proved to be too problematic. Depending on the value of
--subs-with-matching-audio, you could either end up with cases where
--slang wasn't respected and users didn't get subtitles or alternatively
cases where subtitles were given and the user didn't ask for them.
Fundamentally, the OS language functionality doesn't really map well to
slang (and for alang/vlang it makes zero sense; not that anyone actually
used it). Instead of trying to shove it in an option where it doesn't
belong, we should split this off into something else. So for now, just
remove the special handling of "auto" and flip slang back to NULL.
2023-08-28 18:43:46 +00:00
Guido Cella e1f9444d4d playlist: remove unused code to track redirects
It turns out that the code to track redirects (playlists and
directories) never worked correctly, only the last redirect is
remembered and num_redirects is never greater than 1.

You can see this by doing quit-watch-later with the old watch later
system, before dbf244fd2f, on a m3u playlist of files and a m3u playlist
of directories. Only in the first case a redirect entry for the m3u file
is created, because in the second case the m3u redirect is replaced by
the directory one.

If you did mpv --directory-mode=lazy /foo it did create redirect entries
for all subdirectories e.g. /foo/bar, /foo/bar/baz, /foo/bar/baz/qux,
this made it seem like it worked correctly, but actually
/foo/bar/bar/qux was the only redirect entry and thus it was considered
as the first redirect, and mpv created redirect entries for each segment
of the first redirect only.

In the previous commit dbf244fd2f, rather than figuring out how to fix
the code to track redirects, and since creating redirect entries for
multiple redirects is overkill, I just used the new playlist-path
property which does the same thing but only for the last redirect.

By replacing the only other use of the old redirect code with
playlist-path, we can remove it.
2023-08-28 18:31:17 +00:00
Guido Cella 64959c450d player: always write redirect entries for resuming playback
35f43dfacb added a system to write resume files for redirects, i.e.
directories and playlists that mpv expands.

It creates a resume file for each redirect, and for the first redirect
only, it writes a resume file for each segment of its path, without even
converting it to an absolute path if it's relative. This is incomplete:

mpv 'Iron Maiden/1982 The Number of the Beast/8 Hallowed Be Thy Name.mp3'
This doesn't save any redirect entry.

mpv --directory-mode=recursive 'Iron Maiden', then quit-watch-later on
Hallowed Be Thy Name
This saves a redirect entry for "Iron Maiden", but not for "1982 The
Number of the Beast". It doesn't save redirect entries for the
directories above "Iron Maiden" either because "Iron Maiden" isn't
converted to an absolute path.

In both of these cases mpv --directory-mode=lazy 'Iron Maiden' won't
resume from "Hallowed Be Thy Name" because "1982 The Number of the
Beast" isn't the first subdirectory and there is no redirect entry for
it.

503dada42f made mpv recursively expand subdirectories precisely to fix
this, and f266eadf1e added back an option not to expand them. But if we
fix how redirect entries are stored, we can make the superior
--directory-mode=lazy (because it's faster and doesn't result in massive
playlists) the default, and also ensure that mpv will resume playback
even when you quit-watch-later a file without redirects and then play
the directories above it.

Fix this by always creating redirect entries for all segments of the absolute
path of the file, so that both

mpv 'Iron Maiden/1982 The Number of the Beast/8 Hallowed Be Thy Name.mp3'
and
mpv --directory-mode=lazy 'Iron Maiden'

will create redirect entries for

/$USER
/$USER/music
/$USER/music/Iron Maiden
/$USER/music/Iron Maiden/1982 The Number of the Beast

making mpv --directory-mode=lazy "Iron Maiden" resume from
"Hallowed Be Thy Name".

This commit also makes mpv delete the redirect entries of parent
directories when resuming playback, because if for example you have a
playlist with all the songs in a discography:

1980 Iron Maiden/1 Prowler.mp3
1980 Iron Maiden/2 Remember Tomorrow.mp3
...
1981 Killers/1 The Ides of March.mp3
1981 Killers/2 Wrathchild.mp3
...

Now mpv will eventually create redirect entries for every album. If you
later decide to play the directories instead and there are 20 albums,
you would have to do mpv * 20 times to clear all the redirect entries.
2023-08-28 18:31:17 +00:00
llyyr a19aefac37 osc: fix margin for forced-only subs toggle in bar layout
This ensures the spacing between forced-only sub toggle button and the
volume button matches the spacing between the volume and the fullscreen
button on bottombar/topbar layouts
2023-08-27 16:28:24 +00:00
llyyr d0bc907806 osc: only add sub forced-only toggle to layout for DVD/PGS subs
Fixes: 945d7c1eda

Previously, we would have a button with empty string added to the layout
for non DVD/PGS subtitles. This would cause there to be an invisible
button present that would take up space and could still be clicked
despite being invisible when the current subtitle track was not DVD/PGS.
The idea was that the button would be invisible for regular subtitle
tracks, and be visible as "[ ]"/"[F]" for DVD/PGS subtitle tracks.

This commit modifies the bar and box layouts to only add this button if
the current subtitle track is DVD/PGS. This results in there no longer
being an invisible button, and also prevents it from taking up space.
The button is added to layout as before when the current subtitle track
is DVD/PGS, matching the same logic as before.
2023-08-27 16:28:24 +00:00
llyyr f9918b5390 command: add `sub-ass-extradata` property 2023-08-27 16:14:18 +00:00
Dudemanguy 32be72623b player: make all autoload extensions configurable
--audio-file-auto, --cover-art-auto, and --sub-auto all work by using an
internally hardcoded list that determine what file extensions get
recognized. This is fine and people periodically update it, but we can
actually expose this as a stringlist option instead. This way users can
add or remove any file extension for any type. For the most part, this
is pretty pretty easy and involves making sub_exts, etc. the defaults
for the new options (--audio-file-auto-exts, --cover-art-auto-exts, and
--sub-auto-exts). There's actually one slight complication however. The
input code uses mp_might_be_subtitle_file which guesses if the file drag
and dropped file is a subtitle. The input ctx has no access to mpctx so
we have to be clever here.

For this, the trick is to recognize that we can leverage the
m_option_change_callback. We add a new flag, UPDATE_SUB_EXTS, which
fires when the player starts up. Then in the callback, we can set the
value of sub_exts in external_files to opts->sub_auto_exts. Whenever the
option updates, the callback is fired again and sub_exts updates. That
way mp_might_be_subtitle_file can just operate off of this global
variable instead of trying to mess with the core mpv state directly.

Fixes #12000.
2023-08-26 00:33:00 +00:00
llyyr afdd2fa565 player: use audio pts corresponding to playing audio on EOF
We should account for ao queue when setting playback position on EOF,
previously we were using the pts value corresponding to the start of
the ao queue, rather than the currently playing audio.

This fixes time-remaining being a negative number when mpv seeks to EOF
while playback is paused.
2023-08-25 22:38:25 +00:00
Kacper Michajłow cc3c2ad8fb stats.lua: display output resolution if it differs to native one
Useful when filters are applied that alters the video resolution, like
crop. Also display aspect ratio per each resolution.
2023-08-18 16:39:35 +02:00
Kacper Michajłow 540a5eb5ab stats.lua: hide window scale in fullscreen
It display window (not fullscreen) scale, which is quite confusing as it
doesn't match any other currently displayed values.
2023-08-18 16:39:35 +02:00
Dudemanguy 0b4a36476d loadfile: avoid infinite playlist loading loops
There are a number of ways one can craft a playlist file that refers to
itself or cleverly goes around in a loop to other playlist files. There
is obviously no use for this, but mpv spins around forever trying to
load the files so you have to just SIGTERM/SIGKILL it. We can be smarter
about this and attempt to detect it. The condition for detecting this is
surprisingly simple: the filename of the first entry in the playlist
must match a previous playlist path we stored. If we get this, we can
then log an error and stop playback. If there is a "real" file loaded at
any point in time, then we know it's not an infinite loop and clear out
the saved playlist paths. Fixes #3967.
2023-08-16 13:01:28 +00:00
Dudemanguy e8a77e5279 player: add playlist-path properties
A bit of a long standing pain with scripting is that when opening a file
that gets interpreted as a playlist (like an m3u), the original path of
the file gets thrown away later. Workarounds basically consist of
getting the filename before mpv expands the path, but that's not really
reliable. Instead of throwing it away, save the original playlist path
by copying to the playlist entries when applicable (demuxer playlist and
the playlist option). Then expose these as properties: playlist-path for
the currently playing entry and playlist/N/playlist-path for each
specific entry. Closes #8508, #7605.
2023-08-13 19:58:20 +00:00
Dudemanguy c62b45ec2a player: add --term-remaining-playtime option
The OSC reports the speed-adjusted remaining time, but the terminal does
not. This is a weird mismatch and the OSC's default behavior makes
sense, so let's just do some division and add an option to disable it.
Also named "remaining-playtime" after the OSC option. Fixes #10445.
2023-08-13 19:58:20 +00:00
Dudemanguy 6ea08be59a player: make sub-pos a float value
mpv makes this option an integer, but the underlying ass API actually
accepts doubles. From some testing, there is no meaningful precision
difference between float or double (it seems to go in roughly 0.05
steps), so just make it a float. sd_lavc also can handle non-integer
values here. Closes #11583.
2023-08-13 19:58:20 +00:00
Kacper Michajłow e85d70f84f stats.lua: use video-params/aspect-name 2023-08-13 15:04:33 +00:00
Kacper Michajłow 2a7639f452 player/command: add video-params/aspect-name
With pretty printed aspect ratio and related format.
2023-08-13 15:04:33 +00:00
fireattack 3954660f03 ytdl_hook: improve Windows exe search with suffix 2023-08-13 14:40:36 +00:00
Dudemanguy 598e30173d command: don't print "unknown" on video tracks
When printing the name of the video track on the OSC, mpv almost always
prefixes it with "unknown". This is referring to the language tag which
essentially nobody ever does for the video track since it doesn't make
any sense. Instead of putting unknown when there's no language, just
make it an empty string instead. "Unknown" confuses can confuse users
here and practically nobody would guess that it's referring to language.
We still will print the language for a video track in case someone out
there really does tag it, but that should be rare.
2023-08-11 22:28:50 +00:00
Dudemanguy fccb4466cd player/video: avoid spamming logs with EOF
When playing a sparse video stream, the debug log gets hit with the
video EOF constantly since the audio is still playing. There's no
practical use for this so just do add some logic to only signal it once
if it is sparse.
2023-08-11 22:28:50 +00:00
Dudemanguy 41c0321208 audio: drain ao before setting pause
There's an edge cause with gapless audio and pausing. Since, gapless
audio works by sending an EOF immediately, it's possible to pause on the
next file before audio actually finishes playing and thus the sound gets
cut off. The fix is to simply just always do an ao_drain if the ao is
about to set a pause on EOF and we still have audio playing.
Fixes #8898.
2023-08-11 22:28:50 +00:00
Dudemanguy 908dc79129 command: show "no" for hwdec-current if hwdec failed
Now actually matches the documentation (was an empty string not null).
Fixes #11464.
2023-08-11 22:28:50 +00:00
Dudemanguy 692ccca3a2 command: fix some fringe play-dir behavior
This is pretty obscure but if you screw around with the play-dir option
to essentially create a ping-pong loop; mpv will get hit by an assertion
error. What's happening here is that changing the play-dir always
requires a seek. This is handled in player/command along with the other
runtime option changes. However, queue_seek can actually clear the value
of mpctx->stop_play if the file is ending. So while loadfile is
terminating playback and the play-dir gets changed, the value of
mpctx->stop_play gets cleared because of seek. This then hits that
assertion later when mpv tries to finish the file.

The fix is to just add some weird logic to play-dir in player/command.
We have to be sure that mpctx->play_dir matches the new direction
immediately when we get the change so explictly set it here and don't
wait for it later. Secondly, keep the old value of mpctx->stop_play
before the seek and restore it afterwards. This ensures that termination
still happens cleanly and allows the ping-pong loop to work. Fixes #10782
2023-08-11 22:28:50 +00:00
Dudemanguy a323dfae42 sub: fix switching tracks while paused
Internal subtitles were not shown when switching between tracks while
mpv was paused. The reason for this is simply because the demuxer data
isn't available yet when the track switch happens. Fixing it is
basically just retrying until the packet is actually available when the
player is paused. Fixes #8311.
2023-08-11 22:28:50 +00:00
Dave dfbdf75165 osc: support speed-independent time-remaiing display
The new OSC config option "remaining_playtime" controls whether the
time-remaining display considers speed (yes - default) or ignores it.
2023-08-11 14:30:42 +03:00
llyyr b51036cdc0 command: fix stack smashing when displaying aspect-ratio
1df0a42a8c changed aspect-ratio from
floats to doubles, but forgot to change this function for
pretty-printing them as fractions for the video-aspect-override property
2023-08-11 13:04:52 +02:00
Dudemanguy 13c6e060e2 external_files: add sbv to the sub whitelist 2023-08-10 13:50:34 -05:00
Dudemanguy 5ffa3681ff external_files: alphabetize file extensions
Looks nicer.
2023-08-10 13:48:03 -05:00
Kacper Michajłow 14504e0559 player/main: do not print build time, if it is unknown 2023-08-02 18:51:13 +00:00
Dudemanguy 0bed2a2263 build: remove outdated generated directory
This only existed as essentially a workaround for meson's behavior and
to maintain compatibility with the waf build. Since waf put everything
in a generated subdirectory, we had to put make a subdirectory called
"generated" in the source for meson so stuff could go to the right
place. Well now we don't need to do that anymore. Move the meson.build
files around so they go in the appropriate place in the subdirectory of
the source tree and change the paths of the headers accordingly. A
couple of important things to note.

1. mpv.com now gets made in build/player/mpv.com (necessary because of
   a meson limitation)
2. The macos icon generation path is shortened to
   TOOLS/osxbundle/icon.icns.inc.
2023-07-31 19:00:06 +00:00
Thomas Weißschuh 6e023547ea audio: add AO_INIT_MEDIA_ROLE_MUSIC
This allows the AO to set the media role directly during init().
2023-07-31 14:01:44 +02:00
Thomas Weißschuh 1608059d64 Revert "audio: add AOCONTROL_UPDATE_MEDIA_ROLE"
The only user of these APIs was ao_pipewire and the logic there got
converted so drop the now dead code.

This reverts commit 3167a77aa3.
2023-07-30 19:48:35 +02:00
Dudemanguy 65840f8889 player/video: check for track and decoder existence
The track during lavfi-complex can actually be NULL which meant that
ca4192e2df regressed lavfi-complex by
causing mpv to crash during runtime changes of the filter. Additionally,
it's possible for the decoder wrapper to also be NULL. check_framedrop
within write_video checks this, but check_for_hwdec_fallback does not.
Perhaps, it's impossible for this to happen, but we might as well add
the check here to be on the safe side since mp_decoder_wrapper_control
is not designed to handle a NULL.
2023-07-27 16:30:26 +02:00
Dudemanguy ca4192e2df player/video: check for forced eof
It's a bit of an edge case, but since we now allow the disabling of the
software fallback it's possible to have a situation where hwdec
completely fails and the mpv window is still lingering from the previous
item in the playlist. What needs to happen is simply that the vo_chain
should uninit itself and handle force_window if needed. In order to do
that, a new VDCTRL is added that checks vd_lavc if force_eof was set.
player/video will then start the uninit process if needed after getting
this.
2023-07-22 17:42:25 +00:00
llyyr 4198e6f35f osc: don't add margins to osc-deadzonesize
Currently, the osc will add a margin of (osc_height / 2) to the
deadzonesize for the window controls, the topbar and the bottombar,
i.e. when osc-deadzonesize=1, the osc will show up even if the cursor
is only hovering (osc_height / 2) pixels above or below it. This is not
what this option is supposed to do according to the manual, instead
osc-deadzonesize=1 should result in the osc only appearing when it is
directly hovered. The user can simply set osc-deadzonesize=0.9 or so if
such a margin is desired, instead make the option work as advertised by
removing this margin.

It should be noted that osc-layout=box does not share this behavior,
and it already works as advertised in the manual.
2023-07-21 20:24:18 +02:00
Dudemanguy d16c59096c screenshot: implement screenshot-window in sw for most VOs
mpv already has a bunch of software scaling utils. Instead of forcing
every VO to implement this, we can just grab the frame and scale it in
software in one central place. Fixes #11968.
2023-07-21 20:23:11 +02:00
Dudemanguy 97457a837e screenshot: clarify software screenshot logic
We should always be trying hardware screenshots (VOCTRL_SCREENSHOT and
VOCTRL_SCREENSHOT_WIN) before software ones. Rearrange all the logic
here to hopefully make this clearer. The mode is passed to add_osd
(renamed since it will also be used to add the osd) which will be used
more in the next commit.
2023-07-21 20:23:11 +02:00
sfan5 a960b75604 image_writer: move tag_csp check into image_writer_flexible_csp()
This ensures the sRGB fallback to happen in all situations involving
the image writer code, notably --screenshot-sw.

fixes: cbbe2e5221
2023-07-19 13:01:08 +02:00
llyyr fbd392bcbb loadfile: make get_audio_lang function static
This fixes a build warning about missing prototypes
2023-07-17 18:02:07 +02:00
rcombs 9e6c6c0897 loadfile: compute audio lang for sub selection when using lavfi-complex
When using lavfi-complex, no single track populates current_track for audio.
We work around this by iterating over the list of tracks and using the first
non-null language from a selected track. If multiple tracks are selected
(i.e. used by the filter) and have conflicting language tags, we'll ignore
them all and maintain the previous behavior (null).
2023-07-16 21:32:50 -07:00
Christoph Heinrich cf0373e15b console: sort the output from the `help` command
Closes #11927
2023-07-14 13:06:01 +00:00
Guido Cella fc43faa026 player: delete watch later redirect entries again
6a365b258a broke deleting redirect entries for resuming playback. If you
do mpv dir1 dir2, quit-watch-later on a file in dir1, then later
quit-watch-later on a file in dir2, mpv dir1 dir2 would not resume from
dir2 because the redirect entry for dir1 is never deleted.

Fix this by deleting watch later config files for directory/playlist
entries.
2023-07-14 13:05:40 +00:00
m154k1 cbb1af64d5 stats.lua: set sans-serif as default font
sans is deprecated and unsupported on some platforms.
2023-07-10 16:58:54 +02:00
Dudemanguy 6a365b258a player: delete watch_later file after successful load
Currently, mpv immediately deletes the watch_later file after an attempt
at playing the file is made. This is not really ideal because the file
may fail to load for a variety of reasons (including not even existing),
but the state is cleared anyway unconditionally. Instead, just wait
until after playback is successfully initialized before deleting it.
This way silly mistakes like forgetting to mount the drive doesn't
result in deleting your watch_later data. Fixes #3427.
2023-07-08 14:33:47 +00:00
cvzi f5eb7ea1a9 json: unify json_parse depth to MAX_JSON_DEPTH=50 2023-07-08 11:36:15 +02:00
cloud11665 695172f63e player/screenshot: add "screenshot" logger 2023-07-01 02:05:23 +00:00
NRK 2f220c6286 loadfile: fix leak due to setting NULL parent
in the first iteration, *out will be null and thus the steal and the
strdup both sets the parent to NULL - leaking the allocation later on
(caught via LeakSanitizer).

let append_lang() take care of setting the parent instead.
2023-06-28 14:45:13 -05:00
Philip Langdale 9921785340 loadfile: insert missing parentheses
Impressively, gcc's parentheses warning has caught a situation where
the missing parentheses were really needed.
2023-06-26 09:26:27 -07:00
rcombs 945d7c1eda osc: add toggle for forced-only subs 2023-06-25 11:01:58 +02:00
rcombs d8bd1c35ef loadfile: expose auto-forced-only when printing stream info 2023-06-25 11:01:58 +02:00
rcombs 5c4852d173 command: add sub-forced-only-cur prop 2023-06-25 11:01:58 +02:00
rcombs c6cacea4de command: report auto-forced-only flag in track desc 2023-06-25 11:01:58 +02:00
rcombs ba7cc07106 sub: rewrite auto-forced-only support
- No longer has a fake "option" used only internally (which didn't always get propagated properly)
- Always overrideable during playback
2023-06-25 11:01:58 +02:00
rcombs 991a2f79ce player: add more precise sub fallback options 2023-06-25 11:01:58 +02:00
rcombs 5f146e742a loadfile: support "auto" as a language option
This uses the user's OS-level preferred set of languages
2023-06-25 11:01:58 +02:00
rcombs 76009bf7a6 loadfile: use mp_match_lang_single
This adds basic support for IETF language tags,
as well as matching 2-letter language codes against 3-letter ones (and vice versa).
2023-06-25 11:01:58 +02:00
rcombs eb14dbff3e loadfile: take a const char* in match_lang 2023-06-25 11:01:58 +02:00
rcombs be34f52f72 loadfile: short-circuit early on null stream language 2023-06-25 11:01:58 +02:00
Arthur Williams 46ee31b655 player: don't load unwanted files after 519e56f
519e56f caused an attempt to get the language even if the file name
didn't start with the movie title. However, detecting a language when
fuzz >= 1 or the language is known, caused prio to be non-zero which
caused the file to be included regardless of its name. This shouldn't be
the behavior when sub-auto != all.

Now all the prio updates that depend on lang will only happen if the
file in question starts with the movie name. Since language was never
detected before if this wasn't true, the behavior should be the same as
before 519e56f when sub-auto != all.

Closes: #11749
2023-06-07 10:17:28 +02:00
Christoph Heinrich 83acd93c6a lua: read_options: find script-opts prefix at index 1 exactly
Finding the prefix in the key is not enough, the key has to actually
start with the prefix. Otherwise a key like `uosc-font_scale` will not
only match the `uosc-` prefix, but also the `osc-` prefix, resulting
in a logged warning about `-font_scale` being an unknown key.
2023-06-01 15:11:55 +03:00
sfan5 2a2cb6a49e player: improve diagnostics around writing watch_later files 2023-05-21 20:11:24 +02:00
Arthur Williams 519e56f80f player: always try to detect subtitle language from file name
Previously, we'd only attempt to call guess_lang_from_filename if the
external file name matched the video name ignoring the extensions. So if
they didn't match, we'd just report the language as "unknown". And since
the name will never match for urls, the language would always be treated
as unknown.

Now we'll always try to guess the language from the filename regardless
of its similarity to the video file name.

Closes #10348
2023-05-21 10:02:03 -04:00
Dudemanguy 7c4c9bc86f player: use XDG_STATE_HOME for watch_later
A pain point for some users is the fact that watch_later is stored in
the ~/.config directory when it's really not configuration data. Roughly
2 years ago, XDG_STATE_DIR was added to the XDG Base Directory
Specification[0] and its description, user-specific state data, actually
perfectly matches what watch_later data is for. Let's go ahead and use
this directory as the default for watch_later. This change only affects
non-darwin unix-like systems (i.e. Linux, BSDs, etc.). The directory
doesn't move for anyone else.

Internally, quite a few things change with regards to the path
selection. If the platform in question does not have a statedir concept,
then the path selection will simply return "home" instead (old
behavior). Fixes #9147.

[0]: 4f2884e16d
2023-05-09 20:37:17 +00:00
Dudemanguy 5158b85b21 path: expand internal path selection API to allow for additional types
Currently, nothing new is actually implemented but the idea is simply to
just pass a type string all the way up from mp_find_user_file down to
actually getting the platform path. This allows for selecting different
directories besides the user's native config directory. See the next
commit for an implementation.
2023-05-09 20:37:17 +00:00
Thomas Weißschuh 6d422b3edc options: read config file as stream
This aligns the possible sources of config files other loaded data.
For example `--input-conf`.
2023-04-29 22:34:54 +00:00
Guido Cella c5211dbf4a console.lua: add a script-opt for the border size
Because I find the console log easier to read with a thicker border.
2023-04-26 16:30:01 +00:00
Arnold Stanovský c50f536bd1 ytdl_hook: fix clip start and end 2023-04-12 02:14:09 +00:00
Leo Izen cbbe2e5221 player/screenshot: avoid non-sRGB spaces with --screenshot-tag-csp=no
If --screenshot-tag-csp=no, then there won't be any color tags in the
output space, so PNG and JXL screenshots should be written as sRGB
rather than the native space of the input video.
2023-04-10 18:29:56 -04:00
Dudemanguy 7ae7fc0112 auto_profiles: try to distinguish invalid properties better
6e4a76db08 attemped to reject invalid
properties and print an error for users so they actually know that
something is going wrong. This worked by simply checking if the property
not found error is returned, but it is actually perfectly possible for a
property to not be found (different than being unavailable just to be
clear here) at first and then show up later. An example would be
user-data which can be created at any time. It's also possible with
subproperties of things like track-list where a new track could be added
later.

In light of this, let's soften the error checking logic here with a
simple trick. mpv already keeps track of all toplevel properties and it
can be easily retrieved with the "property-list" property, so just cache
that. When we get a property not found error, instead of rejecting it,
try to match it something in the property-list first. If we have a
match, then consider the property valid and allow the script to behavior
normally. If not, we reject it. This approach means property names that
are obviously wrong like "fake-property-here" will reliably get rejected
and something like "user-data/test" works as usual. The downside is that
errors in the subproperty level are not caught, so something like
"track-list/0/fake-property" would still be considered valid and the
user gets no warning that this won't work. We'll just accept the
compromise and hope this isn't too common.

Fixes #11550.
2023-04-07 01:48:55 +00:00
Guido Cella 41372c5e1f auto_profiles.lua: apply profiles when conditions are truthy
Instead of erroring when values returned by profile-cond expressions
aren't booleans, apply the relative profiles as long as the return
values are truthy. This allows shortening conditions like

profile-cond=path:match('foo') ~= nil

to

profile-cond=path:match('foo')
2023-04-05 18:32:18 +00:00
Christoph Heinrich b7ffe0d16e osc: skip rendering when osd_dimensions are 0
The idle logo could appear on the left side of the window for a split
second after starting.
That is because when osd dimensions can be reported as 0 at the very beginning.
Since the width gets calculated based on a fixed height and the aspect ratio,
which is 0, that results in a width of 0 until the next update.
2023-04-05 17:14:43 +00:00
Dudemanguy 6e4a76db08 auto_profiles: check for non-existent properties
Previously, it just silently didn't do anything which is not very
intuitive. Since the lua api returns an error string, check to see if
it matches the "property not found" case and print an error message.
Additionally, don't add the fake property to the internal
cached_properties list or try to observe it. This avoids redundant
evaluate calls which will never actually succeed. We do still mark it
under watched_properties however. This avoids having to call
mp.get_property_native multiple times.
2023-03-29 13:33:57 +00:00
Alexander Seiler bdf7b5c3b8 various: fix various typos in the code base
Signed-off-by: Alexander Seiler <seileralex@gmail.com>
2023-03-28 19:29:44 +00:00
Harri Nieminen 292a5868cb various: fix typos
Found by codespell
2023-03-28 19:29:44 +00:00
cloud11665 664f197746 player/screenshot: add filename return field
DOCS/input: add screenshot return value description
2023-03-25 16:24:21 +00:00
Christoph Heinrich 34a04d0567 player: set playlist title to media title if not set already
The playlist title only got set when it was specified in the playlist
file.
If there is a title after opening a file, that should also be reflected
in the playlist.
2023-03-24 02:28:49 +00:00
Christoph Heinrich 5ddf6d479e Revert "player: set playlist title to media title if not set already"
As it turns out that approach was suboptimal.
The playlist title would only ever get set when media-title actually
gets read, which depending on the configuration and usage might never
happen.

The next commit reimplements that feature in a different way.

This reverts commit 048d4d8b75 except for
the input.rst change.
2023-03-24 02:28:49 +00:00
rcombs 3eb2dfe2eb player/command: fix mem leak in user-data property; closes #11436 2023-03-13 22:49:51 -04:00
Christoph Heinrich 855b619cc9 screenshot: fix segfault when taking a screenshot without video
Also a style change to exit early when nothing can be done anymore.
2023-03-07 14:36:52 +00:00
rcombs 291e05ec1a loadfile: strongly prefer that all streams are from the same program
In raw OTA MPEGTS, different programs can be entirely different virtual channels.
In web streams, different programs can be different variant bitrates,
so using streams from different programs can waste large amounts of bandwidth.
2023-03-03 23:54:46 -06:00
rcombs b2a021d891 command: expose hls-bitrate and program-id as track-list subproperties 2023-03-03 23:54:46 -06:00
rcombs 46199c02a0 loadfile: report hls_bitrate and program_id in struct track 2023-03-03 23:54:46 -06:00
Christoph Heinrich 362256edbc ytdl_hook: only log error when no fallback url available
An error indicates that something doesn't work, but as long as a
safe url is available, playback is still expected to work.

Thus reduce logging level of MP4 DASH without fragments message and
add a new error message for when there is no safe url available either.

Also adds a missing space.
2023-03-03 23:02:13 +00:00
Christoph Heinrich 94c189dae7 ytdl_hook: init fragment requires other fragments
With dash the first fragment was always considered an init fragment if
there wasn't a duration. However that only makes sense when there are
also other fragments, so check if there are other fragments in addition
to the lack of a duration.
2023-03-03 23:02:13 +00:00
Dudemanguy 3535e326dc player: remove unittest option
Since meson has its own unit testing system, let's rework mpv's tests so
they integrate nicely with this. To prepare for this, start off by
dropping the unittest option. Of course, this means that tests will no
longer be supported in the waf build at all but it will be dropped
anyway. Note that the tests option is preserved for the meson build. We
will still make use of this in the future commits.
2023-03-02 15:45:27 +00:00
Martin Eesmaa 0426f4b107 external_files: recognize jxl and avif files as cover art 2023-02-27 17:50:46 +00:00
Dudemanguy c5d1230517 {console,ytdl_hook}: use the platform property
The console.lua check is still kind of dumb since we check an
environment variable to distinguish between wayland and x11, but
otherwise it should be better in theory.
2023-02-27 17:13:21 +00:00
Dudemanguy 80feac62f1 command: add platform property
This returns the value of the target OS that mpv was built on as
reported by the build system. It is quite conceivable that script
writers and API users would need to make OS-dependent choices in some
cases. Such people end up writing boilerplate/hacks to guess what OS
they are on. Assuming you trust the build system (if you don't, we're in
really deep trouble), then mpv actually knows exactly what OS it was
built on. Simply take this information at configuration time, make it a
define, and let mp_property_platform return the value.

Note that mpv has two build systems (waf and meson), so the names of the
detected OSes may not be exactly the same. Since meson is the newer
build system, the value of this property follows meson's naming
conventions*. In the waf build, there is a small function to map known
naming deviations to match meson (i.e. changing "win32" to "windows").
waf's documentation is a nightmare to follow, but it seems to simply
take the output of sys.platform in python and strip away any trailing
numbers if they exist (exception being win32 and os2)*.

*: https://mesonbuild.com/Reference-tables.html#operating-system-names
*: https://waf.io/apidocs/Utils.html#waflib.Utils.unversioned_sys_platform
2023-02-27 17:13:21 +00:00
Christoph Heinrich 8ea7aa5471 ytdl_hook: don't overwrite force-media-title
ytdl_hook always set force-media-title, making users unable to force
a media-title via options.

To prevent that, check if force-media-title is already set to avoid
overwriting it.

A better solution would be to use tags like is already done for some
metadata, however that doesn't work when `all_formats=yes` is used.
See cbb8f534b0
A comment was added to hint at why it isn't done via tags.

ref.
https://github.com/mpv-player/mpv/pull/10453#issuecomment-1445277496
2023-02-27 17:07:38 +00:00
Guido Cella 42fd6f5f6f ytdl_hook.lua: make exec return a single value
This refactors exec to only return the result of the subprocess command,
and makes the rest of run_ytdl_hook use the fields of this result,
because specifying all those return values multiple times is unwieldy
now that exec is called several times, and this is easier to read
anyway.

I removed the line
err = string.format("%s returned '%d'", err, es)
altogether instead of updating the es variable, because there was no
chance of it being executed since it would only happen when
result.killed_by_us is true, but run_ytdl_hook returns early when it is.
2023-02-27 17:04:42 +00:00
der richter ae6a22ddec audio: remove a duplicate clearing of a struct variable
Fixes #8301
2023-02-27 17:02:19 +00:00
Christoph Heinrich c5265381b5 client API: reintroduce CONF_TYPE_FLAG for type conversion
Changing the CONF_TYPE_FLAG was a bad idea because mpv_node.u.flag
continues to be an int, leading to a mismatch in type sizes which can
lead to problems with memcpy().

ref. #11373

This partially reverts commit 17d91b9d4d.
2023-02-27 11:21:49 +01:00
rcombs d941564d48 console: observe osc margins from user-data instead of shared-script-properties 2023-02-26 17:54:09 -06:00
rcombs 894f0c28eb osc: set values in user-data in addition to shared-script-properties 2023-02-26 17:54:09 -06:00
Christoph Heinrich 048d4d8b75 player: set playlist title to media title if not set already
The playlist title only got set when it was specified in the
playlist file.
If there is a title after opening a file, that should also be reflected
in the playlist.

ref. #4780
2023-02-26 22:39:54 +00:00
Thomas Weißschuh ed5426c351 various: fix warning -Wimplicit-const-int-float-conversion 2023-02-26 16:45:07 +01:00
Thomas Weißschuh b4ae1551e4 vo_wayland: fix warning -Wvoid-pointer-to-enum-cast 2023-02-26 16:45:07 +01:00
Christoph Heinrich 17d91b9d4d options: transition properties from flag to bool 2023-02-21 17:15:17 +00:00
Christoph Heinrich 4ebfe9851c options: transition commands from OPT_FLAG to OPT_BOOL 2023-02-21 17:15:17 +00:00
Christoph Heinrich 91cc0d8cf6 options: transition options from OPT_FLAG to OPT_BOOL
c784820454 introduced a bool option type
as a replacement for the flag type, but didn't actually transition and
remove the flag type because it would have been too much mundane work.
2023-02-21 17:15:17 +00:00
Thomas Weißschuh 9efce6d4ae various: drop unused #include "config.h"
Most sources don't need config.h.
The inclusion only leads to lots of unneeded recompilation if the
configuration is changed.
2023-02-20 14:21:18 +00:00
Niklas Haas c975888584 player/screenshot: pass on ability to output native CSP
Fixes: #10988
2023-02-13 21:53:41 +01:00
Niklas Haas ff26024496 screenshot: explicitly default VOCTRL_SCREENSHOT csp
This allows the logic in `convert_image` to fast-path if the image
params are equal. Without this check, the image params are basically
never equal, because that path goes through `mp_image_params_guess_csp`
while the `mp_image` itself does not.

Force it here for consistency across VOs.
2023-02-13 21:53:41 +01:00
dyphire 070287aebb stats.lua: display HDR peak in nits
The value of `sig-peak` is relative to the SDR peak. This is not
a problem when used inside the player, but the `HDR peak` in stats
should display human-readable information.
So change to return the actual nits value of HDR.
Closed https://github.com/mpv-player/mpv/issues/10127
2023-02-02 14:22:40 +00:00
StratusFearMe21 3038e578af player/video.c: don't resync audio if video is an image 2023-01-30 14:52:00 +00:00
Avi Halachmi (:avih) 86093fcae7 lua/js: remove user-data helpers
This reverts:
  3fb4140c lua/defaults: add user_data helpers
  68a20e7a javascript/defaults: add user_data helpers
  00510379 lua/js: fix user_data_del util function

As well as the lua/js parts of:
  3ec2a098 docs: document new user-data property

user-data and its sub-properties can be set/get/observed/deleted
via the standard properties interface, so there's no need for
additional helpers specific to user-data, which only added maintenance
burden.
2023-01-29 01:52:31 +02:00
rcombs 0051037957 lua/js: fix user_data_del util function 2023-01-28 15:21:15 -06:00
rcombs 68a20e7ae4 javascript/defaults: add user_data helpers 2023-01-28 14:37:24 -06:00
rcombs 3fb4140c38 lua/defaults: add user_data helpers 2023-01-28 14:37:21 -06:00
rcombs 0b4860248b player/command: add user-data property
This will replace shared-script-properties in new usage. It can be used for all the same things, but is much more versatile.
Clients can create arbitrary sub-objects, and text expansion can access them.
For instance, if a script sets `user-data/my-script/property1` to "test", that value will be available by expanding ${user-data/my-script/property1}.
2023-01-28 14:37:02 -06:00
rcombs 94e1659b6c javascript: add mp.del_property() 2023-01-28 14:20:20 -06:00
rcombs 51c6784df7 lua: add mp.del_property() 2023-01-28 14:20:20 -06:00
rcombs 2cfaa820e5 libmpv: add mpv_del_property() convenience function 2023-01-28 14:20:20 -06:00
rcombs 04241ab731 player/command: add "del" command 2023-01-28 14:20:20 -06:00
rcombs dc4fd24c6f player/client: support observing sub-properties
This notifies if either a descendent or ancestor of the requested path is modified.
2023-01-28 14:20:20 -06:00
Thomas Weißschuh 870512eb84 audio: simplify implementation of property ao-volume
ao-volume is represented in the code with a `struct ao_control_vol_t`
which contains volumes for two channels, left and right.

However the code implementing this property in command.c never treats
these values individually. They are always averaged together.
On the other hand the code in the AOs handling these values also has to
handle the case where *not* exactly two channels are handled.

So let's remove the `struct ao_control_vol_t` and replace it with a
simple float.
This makes the semantics clear to AO authors and allows us to drop some code from the AOs and command.c.
2023-01-25 15:49:21 -08:00
Avi Halachmi (:avih) 8eb7a00fa1 msg: log-file set at mpv.conf: don't ignore early messages
Previously, if log-file was set not via a CLI option (e.g. set via
mpv.conf or other config file, or set from a script init phase),
then meaningful early log messages were thrown away because the log
file name was unknown initially.

Such early log messages include the command line arguments, any
options set from mpv.conf, and possibly more.

Now we store up to 5000 early messages before the log file name is
known, and flush them once/if it becomes known, or destroy this
buffer once mpv init is complete.

The implementation is similar and adjacent, but not identical, to an
existing early log system for mpv clients which request a log buffer.
2023-01-23 11:05:08 +02:00
sfan5 1201d59f0b various: replace abort() with MP_ASSERT_UNREACHABLE() where appropriate
In debug mode the macro causes an assertion failure.
In release mode it works differently and tells the compiler that it can
assume the codepath will never execute. For this reason I was conversative
in replacing it, e.g. in mpv-internal code that exhausts all valid values
of an enum or when a condition is clear from directly preceding code.
2023-01-12 22:02:07 +01:00
sfan5 7b03cd367d various: replace if + abort() with MP_HANDLE_OOM()
MP_HANDLE_OOM also aborts but calls assert() first, which
will result in an useful message if compiled in debug mode.
2023-01-12 22:02:07 +01:00
Dudemanguy 6471afecd0 player: don't force saving start in watch-later-options
The watch-later mechanism has always unconditionally wrote start to
files to save the playback position. When this was later expanded to
watch-later-options, this logic was kept in place. But we don't actually
have to unconditionally write this and can allow users to remove the
option from the list if they want to. The start value still requires
some special handling; it should always be written if possible
regardless of the value changing. However, we can just place it within
the default set of options for watch-later-options so it can be removed
like any other.
2023-01-09 16:37:14 +00:00
Christoph Heinrich c4ec47a65e player: add video-sync=display-tempo
So far there was no way to sync video to display and have audio sync to
video without changes in pitch.

With this option the audio does not get resampled (pitch change) and
instead the corrected audio speed is applied to audio filters.
2023-01-09 15:17:09 +00:00
Christoph Heinrich 67321b1440 player: choose speed of smallest acceptable factor for display sync
Instead of choosing based on smallest deviation from set speed,
use the speed change from the smallest factor that does not
exceed `video-sync-max-video-change`.
2023-01-09 15:03:30 +00:00
Ron Shabi b6c9846112 external_files: recognize webp files as cover art
mpv currently only recognizes jpg and png files named "AlbumArt",
"Album", "cover", etc. which are in the same folder as the audio files
as album/cover art and displays it when playing such audios.

This feature adds support for webp files following the same naming
scheme to be displayed as cover art for albums who have them.

Webp variations are lower in priority compared to jpg or png files.

Resolves: #11006
2022-12-29 15:48:57 +01:00
Nicolas F 7614e68233 external_files: set log level for potential files to trace
We ask users to freely share log files with us, which is usually
okay, unless a user has some unrelated and potentially embarrassing
files in their working directory. These would show up in the debug
level message output that --log-file enables.

Change the listing of potential external files to trace log level,
to save the users and the developers the embarrassment.
2022-12-21 19:04:27 +01:00
NRK 25b66256d7 player: add window-id property
currently only supported on x11.

one practical use-case of this is wanting to embed something (such as
dmenu) into the mpv window to use as a menu/selection. there might be
other use-cases as well (e.g doing some shenanigans with `xdotool` or
whatnot).

it's currently possible to:

* listen for 'current-window-scale' change (to check if the
  window has been created or not)
* call an external tool like `xdo` or `xdotool` and grab the xid
  from mpv's pid.

however it adds unnecessary dependency on external tools when mpv is
fully capable of easily providing this information.

closes: #10918
2022-12-05 02:03:25 +00:00
Dudemanguy bca516bd2c osc: don't spam window-controls bindings on every render
Not sure when this actually started happening, but it's probably been
like this for years. Currently, the logic for the window-controls works
by simply checking if the osc is visible and then either enabling or
disabling the associated keybindings. The problem is that this can just
constantly spam mp.enable_keybindings/disable_key_bindings on every
single render call if the user disables the border at any point in time.
This does a lot of pointless work and also results in the logs being
spammed with lines like "disable-section". Clearly, this should just
work like the code for checking the input keybindings just above it.
Keep track of an internal state variable and check when it doesn't match
the osc visibility. In that case, we can then either enable or disable
the key bindings and just update the variable.
2022-11-29 16:40:36 +00:00
Dudemanguy bab85944df player/video: add VOCTRL_CONTENT_TYPE
mpv's core already keeps track of whether or not it thinks a track is an
image. Some VOs (i.e. wayland) would benefit from knowing if what is
currently being displayed is an image or not so add a new VOCTRL that
signals this anytime we load a new file with a VO. Additionally, let's
add a helper enum for signaling the kind of content that is being
displayed. There is now MP_CONTENT_NONE (strictly for force window being
used on a track with no image/video), MP_CONTENT_IMAGE, and
MP_CONTENT_VIDEO. See the next commit for the actual usage of this (with
wayland).
2022-11-15 23:18:55 +00:00
Jan Ekström 0f0520aeca player/main: log libplacebo version if built with it
As we start basing more and more functionality on it, it makes
sense to start logging it more visibly as part of --version.
2022-11-15 21:41:22 +02:00
Christoph Heinrich 445a3561d3 console: add history deduplication
Deduplicate history like the fish shell. So for example
entering "cmd 1" then "cmd 2" then "cmd 3" then "cmd 1"
would result in a history of
[cmd 2][cmd 3][cmd 1]
instead of
[cmd 1][cmd 2][cmd 3][cmd 1]

Adds a function `history_add` to replace directly adding to history.
Adds an option `history_dedup` to activate the deduplication.
Defaults to on.
2022-11-03 13:30:58 +01:00
Christoph Heinrich 1a633a6cbc ytdl_hook: reverse order of tracks
Only matters when configuring ytdl_hook with `all_formats=yes`.

So far the tracks were ordered from worst to best quality.

Web players with quality selection always show the highest quality
option at the top. Since tracks are usually listed with the first
track at the top, that should also be the highest quality one.

yt-dlp/youtube-dl sorts it's formats from worst to best.
Iterate in reverse to get best track first.
2022-11-01 09:54:33 -04:00
Christoph Heinrich fd91776207 console: respect the top margin shared script property
Console already respected the bottom margin to not overlap with the
bottom bar from the OSC, but it would still overlap with the window
decorations from the OSC.

Now everything is clipped above the top margin and no superfluous lines
are drawn.
2022-10-28 13:04:32 +02:00
Christoph Heinrich cc65b3892d osc: scale rendered aspect ratio with window aspect ratio
The logo stays centered better and it doesn't distort anymore due to a
recent change in libass https://github.com/libass/libass/pull/645
2022-10-06 14:34:56 -04:00
Christoph Heinrich ac7f3913d3 ytdl_hook: use subtitle `name` as title if available
So far the `ext` was always used as the title,
but `name` is more appropriate when it's available.
2022-09-23 19:18:49 +00:00
Philip Langdale 989d873d6e filters: lavfi: allow hwdec_interop selection for filters
Today, lavfi filters are provided a hw_device from the first
hwdec_interop that was loaded, regardless of whether it's the right one
or not. In most situations where a hardware based filter is used, we
need more control over the device.

In this change, a `hwdec_interop` option is added to the lavfi wrapper
filter configuration and this is used to pick the correct hw_device to
inject into the filter or graph (in the case of a graph, all filters
get the same device).

Note that this requires the use of the explicit lavfi syntax to allow
for the extra configuration.

eg:

```
mpv --vf=hwupload
```

becomes

```
mpv --vf=lavfi=[hwupload]:hwdec_interop=cuda-nvdec
```

or

```
mpv --vf=lavfi-bridge=[hwupload]:hwdec_interop=cuda-nvdec
```
2022-09-21 09:39:34 -07:00
Christoph Heinrich e302c9b7dd ytdl_hook: simplify exclude option parsing
The parsing used to be unnecessarily complicated,
now it's easier to read and understand.
2022-09-14 13:29:11 +02:00
Thomas Weißschuh 013ec877f6 audio: try to use playback AO as hotplug AO first
When a platform has multiple valid AOs that can provide hotplug events
we should try to use the one that also provides playback.

Concretely this will help when introducing hotplug support for
ao_pipewire.

Currently ao_pulse is probed by ao_hotplug_get_device_list() before
ao_pipewire and on the common setups where both AOs could work pulse
will be selected for hotplug handling.
This means that hotplug_init() of ao_pipewire will never be called and
list_devs() has to do its own initialization.
But if ao_pulse is non-functional or not compiled-in suddenly
ao_pipewire *must* implement hotplug_init() for hotplugging events to
work for all.

Also if the hotplug ao_pulse connects to a PulseAudio instance that is
not emulated by the same PipeWire instance as the playback ao_pipewire
the hotplug events are useless.
2022-09-11 20:24:42 -07:00
Thomas Weißschuh 3167a77aa3 audio: add AOCONTROL_UPDATE_MEDIA_ROLE
This is used to notify an AO about the type of media that is being
played.
Either a movie or music.
2022-09-10 12:32:52 -07:00
Philip Langdale e2e8c21be4 player/audio: remove explicit drain on EOF
We have previously had a problem where pull AOs (such as pipewire)
would not reinitialize on a format change when going between two
audio-only files. In such a situation, playback would stop after the
first file.

We initially attempted to fix this by explicitly draining on EOF, which
solves that problem but introduces a blocking step where we don't
actually want one, breaking gapless audio, and causing dropped frames
at the end of playback for files with video in them too.

So, let's undo these changes and do something better in the next
commit.
2022-08-23 11:01:52 -07:00
Thomas Weißschuh bf5c19e05b audio: don't try to drain non-existent AO
52aed495cb ("audio: drain ao on EOF") introduced logic to drain an AO
when EOF of the input has been reached.
When no AO however is present this leads to a NULL-dereference.

Fixes #10556
2022-08-21 08:05:13 -07:00
Christoph Heinrich 08dd30fde8 ytdl_hook: improve track detection
Every format that was not detected as a video format was added to the
audio tracks. This resulted in e.g. YouTube storyboards from ending up
in the list of audio tracks.

Now formats that are already known to be neither video formats nor audio
formats, will also not end up in any track list.

Formats where it is unknown if they are video or audio get added to
tracks if `force_all_formats` is used, otherwise only
formats that are known to contain video or audio become video or audio
tracks respectively.

https://github.com/yt-dlp/yt-dlp/issues/4373#issuecomment-1186637357
2022-08-17 20:04:00 +00:00
Christoph Heinrich 1ef53f094b ytdl_hook: consistant behavior for single format
One would expect that e.g.
`--script-opts=ytdl_hook-all_formats=no --ytdl-format=bestaudio` and
`--script-opts=ytdl_hook-all_formats=yes --ytdl-format=bestaudio`
to play the exact same tracks without manual intervention.
This already worked when two formats were requested.
For a single format with `all_formats=yes` it would also play a track
that was not requested when available. This was inconsistant with the
behavior of `all_formats=no` (default), which would not play a second
track when only a single one was requested.
This combined with #10395 now plays the exact same tracks with
`all_formats=yes` as without, even when only one format is requested.
2022-08-14 23:31:51 +00:00
Christoph Heinrich 813dfe1924 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.
2022-08-12 14:31:59 +00:00
Thomas Weißschuh 52aed495cb audio: drain ao on EOF
This gives pull-based AOs the chance to play all queued audio.
Also it will make sure that the audio has finished playing so we can
reinitialize the AO if format changes are necessary.

Fixes #10018
Fixes #9835
Fixes #8904
2022-08-09 10:30:58 -07:00
Christoph Heinrich 284fecc0bd ytdl_hook: fix playlist index extraction
The example given in #3024 would not play the correct video when
combined with `--ytdl-raw-options=yes-playlist=`.
Allowing `youtube:tab` as extractor and correcting the id check fixes
that.
2022-07-26 21:16:23 +00:00
Ryan Hendrickson ad5a1ac873 osc.lua: add osc-tcspace script option
Generally, the hard-coded sizes used for the OSC elements are
comfortable regardless of the font used, but the timecode fields have
relatively many characters, and so are affected to a greater degree by
fonts with a wider or narrower average character width than expected.

This allow users to adjust the space reserved for the timecode fields to
compensate.
2022-07-19 23:19:45 +03:00
Ryan Hendrickson ff25a8c65a osc.lua: add osc-unicodeminus script option
This option enables the use of the Unicode U+2212 Minus Sign character
when displaying the time remaining, instead of "-" (U+002D
Hyphen-Minus).
2022-07-19 23:19:45 +03:00
Christoph Heinrich 431473310f ytdl_hook: always set HTTP headers
In some cases HTTP headers were not set, leading to some sites not
working despite being supported by yt-dlp/youtube-dl.
2022-07-18 01:17:00 +00:00
Avi Halachmi (:avih) 3694af6076 js: key bindings: ensure priorities for same-key - again
Commit 7f4841ff sorted the bindings so that if the same key was bound
more than once, then the newest binding takes priority (sorted last).

However, it got the comparison function wrong, which means the result
of the sort depended on the algorithm and not on the actual data, so
the priority for keys with more than one binding was still arbitraty.

Fix the sort function, and finally ensure that later binding acutally
override earlier bindings of the same key.
2022-06-23 17:16:33 +03:00
CogentRedTester 1ffdb9128d lua: command_native_async: make the callback optional
The documentation states that the callback is optional, but it actually
was not.

Now it's optional, as docuented.
2022-06-22 14:44:52 +03:00
CogentRedTester 099ae86717 lua: command_native_async: always callback a-sync
Previously if the raw command_native_async returned an error then the
callback function was run directly. This meant that script writers
potentially had to account for both synchronous and asynchronous logic
in the callback, which can happen even with seemingly 'safe' commands
if the mpv event queue is full.

This was at odds with the Javascript implementation of
the function, which always runs the callback asynchronously.

Now the mp.add_timeout function is used to run the callback
asynchronously on error, replicating the Javascript implementation.

This provides consistency for developers in how the callback is handled
in Lua, and increases consistency between the Lua and Javascript APIs.
2022-06-22 14:44:12 +03:00
AtticFinder65536 a4f0db051a player: add tiff/tif (TIFF) to list of image extensions 2022-06-07 06:28:34 -04:00
AtticFinder65536 bd46f050fe player: add jxl (JPEG XL) to list of image extensions 2022-06-07 06:28:34 -04:00
Dudemanguy ec236f7a99 osc.lua: add idlescreen and osc-idlescreen
This is mainly for other user scripts that may conflict with the osc
logo in some way. Although it is possible to listen for
shared-script-properties, this has many edge cases that could easily pop
up. A user could want other OSC things to happen at the same time (say
osc-message). They just don't want the logo. The idlescreen option
disables all idlescreen related things (including the santa hat) if it
is set to "no". A new script message (osc-idlescreen) is also added so
users can easily toggle the value (passing "cycle" or just explictly
setting "yes" or "no"). Some more discussion on this is found in the
below github issues.
https://github.com/mpv-player/mpv/issues/10201
https://github.com/CogentRedTester/mpv-file-browser/issues/55
2022-06-04 14:48:32 +00:00
CogentRedTester b4c73ed105 osc.lua: fix crash when calling osc-tracklist while idle
If the player is started with --idle  and the osc-tracklist script-message
is called then the tracks_osc table will be nil,
which caused the OSC to crash due to attempting to index a nil value.

This appears to be because the osc_tracklist variable is both
initialised and updated by (ultimately) the render() function, which
is not run when the player is idling.

Rather than mess with the existing OSC logic it's easier to either
add this single check, or alternatively to initialise the the tracks_osc
table somewhere before this.
2022-05-19 13:54:31 +00:00
Dudemanguy f20dbcd620 player: check for argv before printing help text
Both mpv's main function and the client API use mp_initialize to start
up. In general, these work the same however the client API had one
slight, unnecessary limitation: you can't start it up with idle=no. In
practice, the libmpv profile (used with the client API) sets idle to
yes, so it's rarely encountered, but there's no particular reason why
this policy needs to be enforced. It turns out that mp_initialize does a
quick check to see if there are any entries in the playlist and if idle
mode is set. If not, it prints the help message and exits. Basically,
it's just the part that handles the terminal message when you type "mpv"
with no arguments. Unfortunately with idle=no, the client API also hits
this code path, exits prematurely with 1 and thus returns an API error.

Fortunately, the fix is very simple. If the client API is used instead
of the "normal" mpv executable, then the mp_initialize function gets a
NULL for the options argument. When starting mpv from the terminal (when
you would want to see the before mentioned help text), there will always
be at least an argv[0] (the mpv executable name itself) so we can
reliably distinguish between the two. The other case where there could
be no argv is if the pseudo-gui profile is used, but this always
enforces idle so we don't have to worry about it either. In other words,
with this combination of conditions (options, no idle, and no playlist
entries), we can be sure this is from a user calling mpv in the terminal
with no arguments. Therefore, other cases can be allowed which means
client API users can initialize with idle=no. Fixes #10162.
2022-05-16 21:10:09 +00:00
Dudemanguy 9467772362 player: set EOF when seeking to end with keep-open
Normally with the keep-open option, mpv is supposed to set the
eof-reached property to true so clients can possibly do interesting
things at this step. However, there was actually an edge case where this
property notification did not occur. If you use keep-open and then seek
in the file past the end (so mpv stops), property notification is not
actually sent in this case. Internally, mpv does a very exact seek at
this step which also ends playback, but it does not set STATUS_EOF to
the ao and vo before the core idle state is updated. To fix this edge
case, it's simply just a matter of explictly setting STATUS_EOF after
seek_to_last_frame in handle_keep_open. This logic will only ever
trigger if keep-open is being used and the seek goes past the end of the
file, so we know that there will always be an EOF here.
2022-05-14 14:51:42 +00:00
Guido Cella fe9e074752 various: remove trailing whitespace 2022-05-14 14:51:34 +00:00
Guido Cella e686297ecf lua: avoid rare memory leak in mp.join_path
If lua_pushstring is OOM, then our joined path allocation is leaked. Use
autofree to ensure it's not leaked in case of Lua OOM.
2022-05-12 17:15:37 +03:00
Guido Cella ebaf6a6cfa console.lua: don't render a 2nd cursor on the OSC
09ea3a424f moved the console above the OSC when it is visible so they
don't overlap, but only changed the first ass:pos() call and forgot to
update the second one, which redraws the cursor on top of the text, so
when both the OSC and the console are visible, a second cursor is drawn
on the OSC. You have to type past where the buttons are to notice it.

This commit synchronizes the position of the 2 ASS events.
2022-05-01 21:48:20 +10:00
Cœur bb5b4b1ba6 various: fix typos 2022-04-25 09:07:18 -04:00
Guido Cella 9d2a6dc302 player: add cover-art-whitelist option
This allows more fine grained control over which cover art to load. With
--cover-art-auto=exact and --cover-art-whitelist=yes, you can now load
cover art with the exact media filename and the whitelisted filenames,
but not cover art that contains the media filename
(--cover-art-auto=fuzzy).
2022-04-21 16:42:27 +00:00
Dudemanguy fe6d9b6962 player: rearrange video sync opts/enums/defines
The video sync logic for mpv lies completely within its core at
essentially the highest layer of abstraction. The problem with this is
that it is impossible for VOs to know what video sync mode mpv is
currently using since it has no access to the opts. Because different
video sync modes completely changes how mpv's render loop operates, it's
reasonable that a VO may want to change how it renders based on the
current mode (see the next commit for an example).

Let's just move the video sync option to mp_vo_opts. MPContext, of
course, can still access the value of the option so it only requires
minor changes in player/video.c. Additionally, move the VS_IS_DISP
define from to player/core.h to common/common.h. All VOs already have
access to common/common.h, and there's no need for them to gain access
to everything that's in player/core.h.
2022-04-11 18:14:22 +00:00
Guido Cella 4d12dfb75a options.lua: remove unused function
val2str isn't used anywhere. Its only use was removed in dd3e52fe68,
when it was still part of osc.lua.
2022-04-08 19:20:49 +03:00
Guido Cella d6affda0a7 options: add osd-playing-msg-duration 2022-04-07 22:13:50 +00:00
sfan5 84821dbcb6 lua: use correct chunkname when loading script files
This was brought up in #10007 and it turned out mpv did not follow Lua conventions.
2022-03-23 21:09:53 +01:00
Avi Halachmi (:avih) b15b3f6711 ytdl_hook.lua: consider any subprocess status != 0 as error
Previously only status<0 was considered as error, but status>0 is
also an error (the process exit code). Change to status != 0.

This likely makes little to no difference in practice, because if
stdout is empty or can't be parsed as JSON then it's considered
an error anyway, but still, this is more correct.

Also, on error, add the complete subprocess result to the verbose log.
2022-03-03 15:01:40 +02:00
George Brooke 1a3e85ec33 ytdl_hook: fix url_is_safe to match URL protocols properly
Some youtube_dl extractors retrieve URLs which contain other URLs
inside of them, for example Funimation, like this:
https://example.com/video?parameter=https://example.net/something

The url_is_safe function uses a pattern to match the protocol at the
start of the URL. Before this commit, this pattern was not compliant
with the URL spec (see the definition of "A URL-scheme string"):
https://url.spec.whatwg.org/#url-writing
Therefore it would match any characters, including "://", until the
last occurence of "://" in the string. Thus the above URL would match
https://example.com/video?parameter=https
which is not in safe_protos so the video will not play.

Now the protocol can only start with a letter and only contain
alphanumerics, "." "+" or "-" as the spec says, so it will only match
the first protocol in the URL ("https" in the above example.)
Previously the URL also had to contain "//" after the ":". Data URLs
do not contain "//": https://datatracker.ietf.org/doc/html/rfc2397
so now the pattern does not look for "//", only ":".
2022-03-02 20:59:33 +02:00
Avi Halachmi (:avih) 57f42cee84 stats.lua: page 2 - frame timing: use fixed display order
Page 2 displays the frame timing info for each type (currently "Fresh"
and "Redraw"), but since they're unordered keys of a map, their
iteration order and hence their order on screen could (and did) change
depending on $things, which was annoying.

haasn thinks none of them should be considered more important (and
therefore maybe worthy of being displayed on top), so we go with
lexicographic order, which currently means that "Fresh" is first.

Fixes #9901
2022-02-23 02:20:49 +02:00
Avi Halachmi (:avih) 37927b65f7 stats.lua: graphs: fix bad rendering due to division by 0
This fixes two potential divisions by 0 at generate_graph(...):
- If v_avg is (given and) 0.
- if v_max is 0.

The former doesn't seem to happen in practice because v_avg is only
used at one generate_gpah call, where it's apparently not 0.

The latter triggers if all the graph values are 0 (hence v_max is
also 0).

The implication of these divisions by 0 is an invalid y-value which
ends up at the ASS coordinates string for the graph inner content.

On linux the value ends as "nan" (luajit) or "-nan" (lua 5.1/5.2), and
on Windows it's "nan" (luajit) or "-1.#IND00" (lua 5.1/5.2), maybe due
to msvcrt's snprintf.

All these strings are wrong as ASS numbers, but due to luck in how
libass parses the coordinates, "nan" and "-nan" result in empty graph
(which looks OK for "all values are 0"), while "-1.#IND00" is parsed
as -1, which breaks the graph rendering (affects other graphs too).

One example of "all values are 0" is at page 0 (internal performance
graphs) on Windows - because the cpu metrics don't work.
So this fixes at least page 0 on Windows with lua 5.1/5.2.

While at it, move the scale calculations to one place, which now
avoids division by 0, instead of duplicating this calculation.

In the future, we can consider improving the generate_graph API:
- It needs one peak value, but takes 3 (v_max, v_avg, scale) which
  are meshed into one final value.
- v_avg is only used in 1 of 6 call sites, but at the middle of the
  arguments, so all other call sites need to pass explicit "nil".
- "scale" is arbitrary and used to leave some space at the top of the
  graph. 5 places use 0.8, one uses 0.9. Could probably be unified.
2022-02-21 16:05:02 +02:00
Niklas Haas fbe154831a vo_gpu_next: refactor subtitle rendering
Render subs at the output resolution, rather than the video resolution.
Uses the new APIs found in libplacebo 197+, to allow controlling the OSD
resolution even for image-attached overlays.

Also fixes an issue where the overlay state did not get correctly
updated while paused. To avoid regenerating the OSD / flushing the cache
constantly, we keep track of OSD changes and only regenerate the OSD
when the OSD state is expected to change in some way (e.g. resolution
change). This requires introducing a new VOCTRL to inform the VO when
the UPDATE_OSD-tagged options have changed.

Fixes #9744, #9524, #9399 and #9398.
2022-02-21 12:01:44 +01:00
Dudemanguy 27c38eac10 options: add always to stop-screensaver
The stop-screensaver option is currently limited to a simple yes/no
option. While the no option does always disable mpv trying to stop the
screensaver, yes does not mean the screensaver is always stopped. The
screensaver will be enabled again depending on certain conditions (like
if the player is paused). Simply introduce a new value for this option,
always, which does exactly what the name implies: the screensaver will
always be disabled.
2022-02-18 22:04:08 +00:00
Avi Halachmi (:avih) 0197729949 osc.lua: seekbar hover: speed-up chapter access
This speeds up chapter name access while hovering the seekbar:

- Fetch the chapter-list property using observation rather than on
  every render while hovering the bar. Property access, especially
  with potentially lots of values (chapters), can be expensive-ish,
  and can involve locking, so the less per-render the better.

- Sort the list once (on change) to simplify the iteration logic when
  searching the chapter which matches the mouse position. It's still
  O(N) (no binary search currently), but with less work.

The cached sorted list is stored at the state. While there are other
places which access this property and could use this cache, for now we
don't touch them, because they're not performance-critical (on init
for the chapter markers, on ch_{prev,next} button click for OSD).

Caching properties using observation instead of using mp.get_property
can indeed speedup other places too, but it should be part of a system
rather than implemented per-property. Maybe some day.
2022-02-06 11:02:39 +02:00
Avi Halachmi (:avih) 7849a36beb js: utils.get_user_path: make wrapper of expand-path
When utils.get_user_path was added, the expand-path command didn't
exist. Now it does, so remove the C code, make it a trivial wrapper.

Keep this function for backward compat to not break scripts, but
technically it's not required anymore.
2022-02-04 12:53:16 +02:00
CogentRedTester 712ef65e2a auto_profiles.lua: don't warn if profile-restore=default
The code assumed that the value of the profile-restore field is
"default" for such profiles, but the C implementation is such
that the field is intentionally omitted in such case.

This resulted in incorrectly trying to restore such profiles. However,
there are no stored values with profile-restore=default, so it only
resulted in a harmless warning, but otherwise behaved correctly (i.e.
nothing is restored).

Fix the condition by taking into account that missing field means
"default", so that it doesn't try to restore in such case, and
avoid the warning.
2022-01-30 15:13:10 +02:00
Avi Halachmi (:avih) 9cddd73f67 Revert "options: add --sub-visibility=<primary-only|secondary-only>"
This reverts commit 04f0b0abe4.

It's not a good idea to unify the names only for visibility, while
keeping secondary-* for everything else.

This needs a bit more thought before we allow secondary sub to be
visible on its own.
2022-01-19 21:56:28 +02:00
Ripose 04f0b0abe4 options: add --sub-visibility=<primary-only|secondary-only>
Adds --sub-visibility choices 'primary-only' for only displaying the
primary subtitle track, and 'secondary-only' for only displaying
secondary subtitle track.

Removes --secondary-sub-visibility and displays a message telling the
user to use --sub-visibility=yes/primary-only instead.

These changes make it so that the default 'sub-visibility' bind 'v'
cycles through all the 'sub-visibility' choices, 'no', 'yes',
'primary-only', and 'secondary-only'.
2022-01-19 14:27:04 +00:00
chelobaka 1ab3f56df0 player: add thd (TrueHD) to whitelist of audio extensions 2022-01-19 14:00:05 +00:00
LaserEyess 471b3c2b59 player: fix parentheses warning with &&
Was tripping -Wparantheses as the && after the || was not explicitly
wrapped. However, due to operator precedence the intended effect was
still correct.
2022-01-18 13:49:19 +00:00
Niklas Haas 9e2c0b8baa sub: rename SUBBITMAP_RGBA to SUBBITMAP_BGRA
This was a misnomer, the actual channel order is IMGFMT_BGRA (as the
comment explicitly point out). Rename the enum for consistency.
2022-01-11 23:45:08 +02:00
Avi Halachmi (:avih) 2157bb1995 js: events registration: clarify breakage/fix
This commit is mainly for correcting the previous commit message.

The previous commit fixed an issue where [un]registering events above
the first event ID "hole" is not requested from libmpv, and that's
indeed true.

However, this had nearly zero impact in practice, because libmpv
enables all events by default anyway (except TICK).

Therefore, above the first ID "hole" [un]register requests are not
sent to libmpv, and the events just keep arriving.

But the callback functions are still added/removed correctly (at
defaults.js), and so the script is not called back even if unregister
did not actually happen with libmpv.

The only event which was affected is TICK - which is not enabled by
default as it's deprecated, and before the previous commit could not
be enabled.

So the fix is more a general correctness fix now that the IDs array
can have "holes", but with effctively no impact in practice.
2021-12-26 21:00:21 +02:00
Avi Halachmi (:avih) 5c5e35c1bc js: fix event registration (keys, script-message, more)
Commit 63205981 removed some events but left all other event IDs at
their original values, which created "holes" at the events IDs array.

The JS backend for mp.register_event maps a name to an ID by scanning
all IDs and stopping when the name was found or a NULL name was
returned. Lua does the same except that it doesn't stop on NULL name.

Previously it was not possible to have a NULL name before the end of
the array, but now it is possible due to the enumeration holes.

Fix by skipping missing names, like lua does.
2021-12-26 20:02:45 +02:00
sfan5 f9fd50c654 player: make deprecated track/chapter/metadata events internal
We still need these to track or notify of modifications to certain properties,
but they're now gone from the libmpv ABI.
2021-12-15 12:29:10 +01:00
sfan5 dfcd561ba9 lua: remove mp.suspend, resume and resume_all
These functions were deprecated in v0.21.0 and no-ops
since v0.23.0. The matching client API functions were
removed in the previous commit.
2021-12-15 12:29:10 +01:00
sfan5 632059816a libmpv: remove opengl_cb API and other deprecated symbols
Not all deprecated symbols were removed. Only three events were removed for now
since these are not used internally.
This bumps the library version to 2.0.
2021-12-15 12:29:10 +01:00
sfan5 72915e8b76 {player,video}: remove references to obsolete opengl-cb API 2021-12-15 12:29:10 +01:00