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

52190 Commits

Author SHA1 Message Date
Guido Cella
d0aeca5918 demux_lavf: pass jpg filenames to ffmpeg for probing
Fixes #13192, fixes #13431. See the comment for details.
2024-04-18 16:48:25 +02:00
nanahi
750dec880c m_option: change confusing error messages for obj_settings_list
This option type is not used only by filter options: they're already
used by --ao, --vo, and --gpu-context. Replace the mentions of
"filter" to "item" instead, and changes some languages to improve clarity.

Also change the documentation on "Filter options" to describe what it
really is, and fix a typo.
2024-04-18 16:28:21 +02:00
nanahi
e968a505d6 DOCS/man/options: mention the new priority list usage of --gpu-context
The settings list conversion means a custom priority list can now be used.
2024-04-18 16:28:21 +02:00
nanahi
2533ea764f various: add GPU context description
Now that obj_settings_list is used for GPU contexts, detailed
descriptions can be added so that --gpu-context=help can print
the descriptions of the GPU contexts using standard
obj_settings_list help printing.
2024-04-18 16:28:21 +02:00
nanahi
a6ff33425d video/out/gpu/context: add auto dummy context
This adds a dummy context at the start of the context lists, which
serves three purposes:

- The "auto" option is listed for --gpu-context=help.
- Some special handlings of "auto" string are removed.
- Make sure that lists have at least one element, so MP_ARRAY_SIZE()
  works as intended.
2024-04-18 16:28:21 +02:00
nanahi
96e1f1dfa5 video/out/gpu/context: convert --gpu-context to use obj_settings_list
Since the list of available GPU contexts is a compile time constant,
use obj_settings_list instead of opt_string_validate for GPU contexts.
This has several advantages:

- Aligns with the existing usage of vo, ao, and filter lists.
- Allows custom probing order.
- Allows list option suffixes. (--gpu-context-append, etc.)
- Allows autocomplete in console.lua.
- Uses the standard obj_settings_list help printing, so the custom
  help printing function is no longer needed.

This also deduplicates some context creation code for ra_ctx_create
and ra_ctx_create_by_name.
2024-04-18 16:28:21 +02:00
nanahi
d5ec069829 video/out/gpu/context: don't use hidden flag for contexts
For contexts that have no API, just use a separate list for them.
This keeps validate func for the main contexts simpler.
2024-04-18 16:28:21 +02:00
Shuanglei Tao
fefa1b6645 DOCS/client-api-changes.rst: fix formatting 2024-04-18 16:13:57 +02:00
rcombs
d3a63e16d2 command: use property_time() for sub-start and sub-end
This gives these properties the "time" type, which allows them to be pretty-printed as HH:MM:SS easily (but also still allows raw formatting using e.g. ${=sub-start}).
2024-04-18 13:11:01 +02:00
Kacper Michajłow
2f8038c598 vo_gpu_next: invalidate cache object if requested by libplacebo
See: https://code.videolan.org/videolan/libplacebo/-/merge_requests/659
2024-04-18 02:25:12 +02:00
Kacper Michajłow
dc632e16d2 stats.lua: display short decoder name if not generic one is used 2024-04-18 01:20:32 +02:00
Kacper Michajłow
a569c3ce0c player/command: add track-list/N/decoder 2024-04-18 01:20:32 +02:00
Guido Cella
8a4ecda940 stats.lua: filter input bindings by typing them
This lets you press / in page 4 of the stats and type a keybinding or
part of its command to filter it by using mp.input.

This works badly without a VO because both stats.lua and console.lua use
show-text and only one can be displayed at a time, but it's still better
than not having the search available at all.
2024-04-18 01:17:53 +02:00
nanahi
7cfd369ffb terminal-win: support mouse input events
The mouse input information is available from the INPUT_RECORD
with MOUSE_EVENT event type.
2024-04-18 01:03:33 +02:00
nanahi
8a2892a68f terminal-win: implement terminal_get_size2
The size of the console font can be acquired with GetCurrentConsoleFont,
and the terminal size can be calculated from the rols, cols, and font
size.
2024-04-18 01:03:33 +02:00
nanahi
eff18a8a11 terminal-win: implement terminal_set_mouse_input 2024-04-18 01:03:33 +02:00
nanahi
c2ed2e7bc8 terminal: add terminal_set_mouse_input function
This function is used to enable/disable mouse input for win32 and unix.
2024-04-18 01:03:33 +02:00
nanahi
abc0b0e8c9 terminal-unix: style fix 2024-04-18 01:03:33 +02:00
nanahi
7c6bb9c37b vo_{tct,sixel,kitty}: implement mouse support 2024-04-18 01:03:33 +02:00
nanahi
cbc3fb104d terminal-unix: ignore unhandled mouse CSI sequences
21d434d2db attempted to ignore unknown
CSI sequences with a specific termination rule. This however does not
apply to mouse CSI sequences which can have characters out of that
range. Fix this by throwing away the whole sequence when an unhandled
mouse sequence is detected.
2024-04-18 01:03:33 +02:00
nanahi
9ae58ba186 terminal-unix: support mouse escape codes
These 6-byte codes have the format of \e [ M <button> <xpos> <ypos>.
Support the first 3 mouse bottons + scroll up/down for now as
button numbers > 5 are pretty non-portable across terminals.
Pixel-based mouse position values are calculated and sent to the
input system.
2024-04-18 01:03:33 +02:00
llyyr
805577c792 sd_ass: add sub-vsfilter-bidi-compat to enable vsfilter bidi compat
Enable ASS_FEATURE_{WHOLE_TEXT_LAYOUT, BIDI_BRACKETS} and auto base
detection by default, and add an option to disable this if needed.

This is strictly an improvement for webvtt files as they always use
auto base detection. This _fixes_ right-to-left text rendering for
webvtt files which correctly mark rtl/ltr. Webvtt files obtained from
sources which sideload the RTL information through css also see an
improvement due to the auto detection.

Generally SRT files also want this, but some are also written to
workaround VSFilter quirks.

See also: https://github.com/mpv-player/mpv/pull/12985#issuecomment-1839565138
2024-04-18 00:14:44 +02:00
llyyr
f862d3b6cd sd_ass: fix margins for all styles when overriding PlayResX
Also save old playresx and use it instead of assuming values of things
we know.
2024-04-18 00:14:44 +02:00
llyyr
d2efa1c1be sd_ass: replace ifdef with explicit version check 2024-04-18 00:14:44 +02:00
nanahi
c9a53780cf DOCS: document --show-in-taskbar option 2024-04-18 00:09:09 +02:00
nanahi
8c614e0df5 w32_common: implement --show-in-taskbar option
When the window style changes, use WS_EX_TOOLWINDOW style to exclude
the window from the taskbar and Alt+Tab switching.
2024-04-18 00:09:09 +02:00
nanahi
dcd1034529 x11_common: implement --show-in-taskbar option
This adds a new option --show-in-taskbar, which controls whether
mpv appears in taskbars. This is useful for picture-in-picture
setups where the video window should not appear in taskbars.

On X11, this can be controled by setting the
_NET_WM_STATE_SKIP_TASKBAR window state.
2024-04-18 00:09:09 +02:00
nanahi
3a92d7ba3b x11_common: detect wm support for _NET_WM_STATE_SKIP_TASKBAR 2024-04-18 00:09:09 +02:00
Guido Cella
51bd00c33a stats.lua: inherit OSD styles
Avoid having to configure both the OSD and the stats script opts when
you change the OSD options, in particular avoid having to convert colors
to BGR.

Also document the shadow options.

font_size, border_size and shadow offset defaults are kept because the
same values look much bigger in the stats than in the corresponding OSD
options.

osd-back-color is now respected without extra checks until you
explicitly set a shadow_color.
2024-04-17 23:47:55 +02:00
sunpenghao
75d899bcaf DOCS/input: minor typo correction 2024-04-17 23:46:35 +02:00
sunpenghao
c70cc5b01d osc: add playlist_media_title option
Showing media titles in the playlist is pointless when sources are ill
tagged and media titles contain only garbage. Being able to opt for
file names at least gives us a choice in such cases.
2024-04-17 23:46:35 +02:00
nanahi
715feea8d8 dec_sub: fix locking for sub_ass_get_extradata
sub->sd can be destroyed and recreated when update_segment is called
inside a lock.

Fixes: f9918b5390
2024-04-17 23:42:35 +02:00
nanahi
dbe377645f input: make mp_input_queue_cmd return a meaningful value
It's currently always a meaningless 1. Make it so it returns 0 is cmd
is NULL. Remove the unused return value from queue_cmd.
2024-04-17 23:42:35 +02:00
nanahi
b7ad0968ad dec_sub: don't use recursive mutex
92a9f11a0b added locking for dec_sub.
At that time, because the lock was exposed to the outside world,
a recursive mutex was used. However, this is no longer true after
e9e883e3b2, when the public locking
functions were removed. This means that the lock is now private.

Unlike input.c, dec_sub already enforces said call hierarchy, so
combined with the aforementioned change, the lock is only ever
called once and never recursively. Thus the lock can be converted to
a normal mutex.
2024-04-17 23:42:35 +02:00
nanahi
e731972163 dec_sub: fix locking for sub_is_{primary,secondary}_visible
These public functions should use locks to keep its usage
consistent with input.c.

Fixes: 024e0cd4c1
2024-04-17 23:42:35 +02:00
nanahi
f4db4aaed7 input: don't use recursive mutex
Previous commits made sure that the lock will never be called for more
than once for all public functions. Thus deadlock is impossible, so
recursive mutex is unneeded and can be converted to a normal mutex.
2024-04-17 23:42:35 +02:00
nanahi
e8b9476bf7 input: avoid unnecessary recursive locks
The absense of a call hierarchy between public and private functions
results in many unnecessary recursive locks: public functions require
locks, which are also called by other public and private functions in this
file. Fortunately, since the lock is private to this file, this situation
can be avoided by establishing a call hierarchy:

- Public functions must lock, and can only call private functions in
  this file
- Private functions must not lock, and can only call private functions
  in this file
- No function can call any public function in this file, the only
  exception being mp_input_wakeup and mp_input_parse_cmd.

This arrangement ensures that there will be no locks more than necessary:
All public function calls will lock only once, and never recursively.
2024-04-17 23:42:35 +02:00
nanahi
3cbb34fd03 input: remove mp prefix for static functions
This makes it easy to eyeball check the call hierarchy between public
and private functions.
2024-04-17 23:42:35 +02:00
nanahi
ce4294bc37 input: fix locking of mp_input_bind_key
This is a public function, yet its access to ictx through
get_bind_section is not locked.

Fixes: 4614d432a8
2024-04-17 23:42:35 +02:00
Kacper Michajłow
7b181c989e options: fix runtime update of teletext-page 2024-04-17 23:41:30 +02:00
Kacper Michajłow
1394e5a111 sub/sd_lavc: check decoder output type for dvb and arib
Depending on the options:
For AV_CODEC_ID_ARIB_CAPTION this allows using bitmap output.
For AV_CODEC_ID_DVB_TELETEXT this allows using text output.

Fixes: #13471
2024-04-17 23:41:30 +02:00
Kacper Michajłow
35c6b62ddc sub/lavc_conv: set dvb teletext and arib caption output type to ASS
Also set teletext page while at it.
2024-04-17 23:41:30 +02:00
Kacper Michajłow
73779a8c70 sub/lavc_conv: take sd context as a parameter for lavc_conv_create
Will be useful for future commits.
2024-04-17 23:41:30 +02:00
sfan5
1586ccc0c8 Update VERSION 2024-04-17 21:19:56 +02:00
sfan5
02254b92dd
Release 0.38.0 2024-04-17 21:18:44 +02:00
m154k1
7a8a92be8d Revert "ao_coreaudio: switch to ao_read_data_nonblocking()"
This reverts commit 36d5b52612.
2024-04-17 21:04:34 +02:00
sfan5
3b64bf908a test: add an encoding test with libmpv 2024-04-17 20:22:36 +02:00
nanahi
32817198bb player/misc: fix audio-only fallback when video init fails
--stop-playback-on-init-failure=no is documented to continue playback in
audio-only mode if video init fails. However, this does not function
properly after a080432992: because video
is initialized first, if video init fails, ao_chain is still null.
As a result, !(mpctx->vo_chain || mpctx->ao_chain) is true, a playback
error is raised, so the playback ends and audio does not play.

Fix this by reverting that change, so it checks the tracks instead.

Fixes: a080432992
2024-04-16 22:19:55 +00:00
Kacper Michajłow
d23f641bb3 player/command: remove codec-info and use track-list directly
Turns out that adding more medatata like HDR10+ and Dolby Vision would
produce a lot of duplication and it is better to centralize it around
the track-list property.

Fixes: e720159f72
2024-04-16 21:58:55 +02:00
Dudemanguy
68bcbf66ef player: avoid busy looping during reinit_sub
If the player is paused, switching subtitle track requires us to read
subs packets for an indefinite amount of time in order to actually
display the subtitles. The problem with this is that it puts a blocking
loop in the play thread which can be slow in cases where it takes a long
time to fetch the subtitle (e.g. over a network).

9e27b1f523 alleviates this when a pause
happens because of buffering, but it's not complete. One could encounter
this if the user pauses the video first manually and then switches the
subtitle track.

To solve this better, make it so the loop has a time out (totally
arbitrary number) so the player isn't blocked forever. If subtitles are
not fetched within that time, we flag the track and try again later in
the playloop.
2024-04-16 19:45:00 +00:00