summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* stats.lua: typo lavfi-complexStefan de Konink2021-08-151-2/+2
| | | | Fix typo lavi-complex to lavfi-complex.
* sub: show subs without duration on vid changeGuido Cella2021-08-131-1/+1
| | | | | | | | | | | | | | | | | When changing video track with subtitles with unknown duration, they aren't shown until you seek, cycle sub back and forth, or apply a video filter. This is caused by reinit_video_chain_src() calling reset_subtitle_state() -> sub/sd_ass.c:reset() -> ass_flush_events() when ctx->duration_unknown is true. The ass_flush_events() call was added in a714f8e so subs with unknown duration wouldn't multiply on seek, i.e. when reset_subtitle_state() is called from reset_playback_state(). So keep calling it from there, and in reinit_video_chain_src() use just term_osd_set_subs(mpctx, NULL) instead to clear any subtitles printed to the terminal. The reset_subtitle_state() call was added in c1ac97b to "reset the state correctly when switching between video/no-video", but with it removed I no longer notice any issue doing that.
* vo_rpi: restore fullscreen handlingHo Ming Shun2021-08-131-0/+20
| | | | | | | Previous fullscreen handling code was removed in 59cdfe50b2 during deprecation of VOCTRL_FULLSCREEN. Lack of this code caused the OSD layer to be to be not resized along with the video layer when fullscreen is toggled.
* x11: handle maximized windows with window-scaleDudemanguy2021-08-121-0/+6
| | | | | | | If a user attempted to change the window scale of a maximized window on x11, nothing would happen since the window manager holds the size of the window constant. Just do an unmaximize first before performing the resize.
* vo_vdpau: Don't treat preemption as an error when reconfiguringsjambekar2021-08-121-1/+11
| | | | | | | | | | | | | | | | | | | When the VT switch out is triggered, the decode thread (VD) falls back to sw decoding. However, on the VO thread, which is responsible for handling display preemption and presentation, vo_vdpau.c:reconfig() is called. The reconfig() function returned -1 when the check_preemption() returned 0. The vo_reconfig2() (which calls reconfig()) returned -1 in turn which entered into an error handling path. This led to a series of functions calls that ultimately set the in_terminate flag to TRUE. This led the vo_thread to exit which ultimately led to the MPV application exit. The fix is to return 0 instead of -1 after the check_preemption() in the vo_vpdau.c:reconfig(). Returning 0 instead of -1 is not fatal and does not have any side effects. This is confirmed by testing the VT switching behaviour. And as far as the frames that are going to the display are concerned, they are now dropped. Since the display is preempted, it is okay to drop the frames and continue.
* desktop entry: fix duplication of the app icon in a dock like PlankStan Janssen2021-08-121-0/+1
| | | | | | | | | Without this entry, when starting mpv as a flatpak application on elementaryOS, the Dock icon would get duplicated, as if the application was detached from its launcher. This entry fixes that by allowing the dock to associate the app's window with the desktop entry. Fixes #9109
* sub: align ytdl-hook secondary subs to the topGuido Cella2021-08-113-4/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 29e15e6248 prefixed youtube-dl's subs url with an edl prefix to not download them until they're selected, which is useful when there are many sub languages. But this prefix broke the alignment of secondary subs, which would overlap the primary subs instead of always being placed at the top. This can be tested with --sub-file='edl://!no_clip;!delay_open,media_type=sub;secondary_sub.srt' When a sub is added, sub.c:reinit_sub() is called. This calls in init_subdec() -> dec_sub.c:sub_create() -> init_decoder() -> sd_ass:init(). Then reinit_sub() calls sub_control(track->d_sub, SD_CTRL_SET_TOP, &(bool){!!order}) which sets sd_ass_priv.on_top = true for secondary subs. But for EDL subs the real sub is initialized again when in dec_sub.c:sub_read_packets() is_new_segment() returns true and update_segment() is called, or when sub_get_bitmaps() calls update_segment(). update_segment() then calls init_decoder(), which calls sd_ass:init(), so sd_ass_priv is reinitialized, and its on_top property is left false. This commit sets it to true again. For URLs that need to be downloaded it seems that the update_segment() call that reinitializes sd_ass_priv is always the one in sub_read_packets(), but with local subs sub_get_bitmaps() is usually called earlier (though there shouldn't be a reason to use the EDL URL for local subs), so I added the order parameter to sub_create(), rather than adding it to all of update_segment(), sub_read_packets() and sub_get_bitmaps(). Also removes the cast to bool in the other sub_control call, since sub/sd_ass.c:control already casts arg to bool when cmd is SD_CTRL_SET_TOP.
* wayland: fix wrong opts structDudemanguy2021-08-101-1/+1
|
* wayland: request xdg-decoration mode on startupDudemanguy2021-08-101-0/+2
| | | | | | Right after the listener is constructed, request a mode based on the value of the border option. If border, then request SSD. If no border, request CSD. The decoration listener handles it from there.
* lua: read_options: quote values at error messagesAvi Halachmi (:avih)2021-08-101-3/+3
| | | | | | | This makes it easier to understand the error in cases of incorrect syntax or formatting at .conf files. (js already has this quoting). Fixes #9105
* vo_wlshm: remove empty options structDudemanguy2021-08-091-6/+0
| | | | | This doesn't do anything and isn't needed as there are no wlshm-specific options.
* DOCS/stats.rst: fix quotingAvi Halachmi (:avih)2021-08-091-1/+1
|
* wayland: check for xdg-decoration on border updateDudemanguy2021-08-091-1/+1
| | | | | Oversight in 69c64f5. If there is no xdg_toplevel_decoration, don't attempt to set the mode.
* options: clarify OS support for media keysLaserEyess2021-08-091-2/+9
| | | | | | | | The previous wording gave the false impression that there was no media key support for OSes besides Windows and macOS. This is untrue, the option may only exist on those two platforms but it simply means that media keys will always be enabled on other OSes as long as they are supported.
* wayland: handle xdg-decoration protocol betterDudemanguy2021-08-091-9/+22
| | | | | | | | | | | | | | | | | | | | | The current usage of the xdg-decoration protocol is quite a bit crude. There's a specific listener struct for this like with most wayland things, but mpv wasn't even using it. It also made no attempt to detect if the compositor was telling mpv to use client side decorations. To implement this correctly, first of all we need to create the decoration listener object and add it like how most wayland things work. Secondly, set_border_decorations needs to be changed to accept the uint32_t mode given by the compositor. When we get the decoration event, pass the mode obtained from the compositor to set_border_decorations. Update the mpv border option, based on whether or not we have server side decorations (yes if we have them; no if we don't). mpv can actually request either client side or server side decorations with this protocol. This function doesn't belong in set_border_decorations but rather it should be called when the border option changes. Whether or not this request actually works depends on the compositor (Plasma appears to allow it; sway does not). If the compositor allows this request, then it gets handled by configure_decorations. Note that the enum strangely starts at 1 hence why there is an extra +1.
* command: check for monitor par in window-scaleDudemanguy2021-08-091-0/+6
| | | | | | | | When performing the scaling calculations, the window scale properties do not bother checking for potential monitor par. The vo keeps track of this via vo->monitor_par. Simply multiply/divide the video's width or height depending on the value of monitor_par. We also clamp the values to avoid the values running away to infinity in extreme cases.
* command: check for rotation in window-scaleDudemanguy2021-08-091-0/+3
| | | | | | | | | | | | | | | The vo currently handles rotations in 90 degree steps and some VOs set this via VO_CAP_ROTATE90. When the rotation exactly hits either 90 or 270 degrees, this causes the values of dwidth and dheight to perfectly swap like one would expect. However, the mp_image_params_get_dsize function call in both of the window scale functions do not take this special case into account. So the width/height values returned will be incorrectly flipped in the 90 and 270 degree cases if the vo driver does implement VO_CAP_ROTATE90 (like vo=gpu). Fortunately, the mp_image_params struct keeps track of the rotation for us. So all we need to do is check if the image is rotated at 90 or 270 degrees and check that the current vo driver supports VO_CAP_ROTATE90. If so, then swap vid_w and vid_h to their true, correct values.
* command: merge window-scale code togetherDudemanguy2021-08-091-13/+3
| | | | | | | Based on a small patch originally written by @avih. Instead of duplicating the window-scale logic in update_window_scale, just call the mp_property_current_window_scale function with the M_PROPERTY_SET action and a NULL property.
* wayland: fix keepaspect-window during resizeDudemanguy2021-08-081-9/+6
| | | | | | | | | | | | So the resizing mechanism is actually supposed to match the video size to the window size while preserving the aspect ratio. In wayland, the current logic behaves as if --no-keepaspect-window was set. Fix this by simply multiplying the height by the same scale factor the width is multiplied by. Also get rid of the pointless (width > height) test (it makes no difference in any case) as well as some unneccesary checks for the keepaspect-window option. The use of ceil here is to make sure the window coordinates can never possibly have be 0 due to truncation (weston can still give you a 1x1 window which is fun). Fixes #9098.
* wayland: improve behavior with touch eventsDudemanguy2021-08-083-20/+10
| | | | | | | | | | | | | | | | | | | | | | | There's currently some touch related code in mpv wayland, but clearly nobody actually uses because it's a broken mess. Initially an attempt to distinguish between two finger touches and one finger touch was made, but there's not a good way to make this work. For whatever reason, initiating either xdg_toplevel_resize or xdg_toplevel_move blocks any other touch events from occurring (at least in plasma). Trying to call these functions anywhere else is not really useful since the serial will be invalid outside of the touch down events (well it would work in the touch up event but that's just silly). Anyways, let's just make this work sanely. Eliminate the touch entries variable completely because it's pointless. Only one finger event is ever considered at a time. Touches besides the initial one are all ignored. If a user touches and drags within the touch edge radius, then a resize event occurs. If the user touches and drags elsewhere on the window, a move event occurs. A single tap displays the osc (which is clickable if you tap again). A double tap toggles fullscreen. Additionally, the default touch edge radius of 64 pixels is way too big (at least I think so). Cut this in half to 32 which feels a lot better (on a pinephone using plasma mobile anyway).
* wayland: correct window-scale behaviorDudemanguy2021-08-071-3/+10
| | | | | | | | | | | | | | The way the window-scale option is supposed to behave wasn't really ever documented until 25cfc81. It turns out that different OS/WMs may do slightly different things. For wayland, we need to fix two things. First, only return the wl->window_size in GET_UNFS (aka don't return the fullscreen size). For SET_UNFS, we need to change the behavior for the maximized window case. If the window is maximized, first attempt to unmaximize it and send the wayland event. If the compositor allows this to happen, then go ahead and set the new dimensions and resize it. In the case that the attempt to unmaximize is not successful, then don't attempt the resize and just save the window size dimensions for later to be used when the user unmaximizes the window.
* manpage: clarify window-scale behaviorDudemanguy2021-08-071-5/+14
|
* command: make current-window-scale writeable, 2nd attemptDudemanguy2021-08-074-4/+21
| | | | | | | | | | | | | | | | | | | | | | The window-scale property mirrors the respective option (not the effective scale derived from the current window size), and as such setting its value to the same value it had before has no effect. Specifically - the window will not resize. This is consistent as far as property-option bridge behavior goes, but we do end up with an issue that we can't set an arbitrary scale and expect the window to always resize accordingly. We do also have a current-window-scale property which does reflect the actual window size, however, it's been read-only till now. This commit makes current-window-scale RW so that it's now always possible to set an arbitrary scale and expect the window to resize accordingly (without affecting window-scale - like manual resize). Also, mention window-scale no-effect-if-not-changed at the docs. Based on code by @Dudemanguy from commit 873ae0d, with same effect.
* Revert "command: make current-window-scale writeable"Avi Halachmi (:avih)2021-08-074-46/+42
| | | | | | | | | | | This reverts commit 873ae0de2af3bb84a11e5e57f6e3a8942b2263c2. The next commit will restore this functionality, with the following differences from the reverted commit: - Smaller and simpler code change. - On bad scale: use "Invalid value" (compared to "no such property"). - Doesn't combine the docs for window-scale and current-window-scale. - Doesn't remove the docs for window-scale behavior prior to 0.31.0.
* wayland: keep track of toplevel width/height againDudemanguy2021-08-062-1/+9
| | | | | | | | | | | | | | Regression from 24357cb. It's ugly but unfortunately keeping tracking of the last toplevel width and height really is the best way to solve this problem and removing it was a mistake. Compositors don't always send width/height coordinates of the actual window. The easiest way to trigger this is by changing window-scale/current-window-scale and then unfocusing the window. The compositor will send another toplevel configure event with coordinates of the window before the resize. Maybe compositors could be smarter but multiple ones do this (sway, gnome, plasma), so just keep the old workaround. The only difference this time is that the toplevel width/height is saved at the very beginning which also covers the case where it equals 0 (i.e. weston).
* stats.lua: page 4 (keys): group current-window-scale under windowGuido Cella2021-08-061-1/+1
| | | | | This groups "set current-window-scale ..." under the "window" group instead of "current" in the list of keybindings.
* command: make current-window-scale writeableDudemanguy2021-08-054-42/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | Somewhat confusingly, mpv has both a window-scale option and a current-window-scale property. The documentation lists window-scale under properties (and it is technically is one), but at its core it is actually an option which means it behaves subtly different. Options in mpv are runtime-configurable, but they only change anything if the value of the option itself changes. window-scale is an option and not meant to keep track of the actual scale of the window (intended behavior introduced by d07b7f0). This causes window-scale to do nothing in certain cases (ex: the window is manually resized and window-scale is set to 1.00 again). This is logical and consistent with the behavior of the rest of the mpv options, but it also makes it a poor candidate for setting the mpv window scale dynamically. As a remedy, we can just make current-window-scale writeable instead. current-window-scale is intended to always report the actual scale of the window and keep track of any window size changes made by the user. By making this property also writeable, it allows the user to have more intuitive behavior (i.e. setting current-window-scale to 1.00 always sets the window to a scale of 1). Additionally, the default input.conf is changed to use current-window-scale instead of window-scale. The window-scale documentation under property list is removed since it is already documented under options and users should probably set the current-window-scale property instead in most cases.
* sub: sub-filter-regex and jsre: support ass-to-plaintextAvi Halachmi (:avih)2021-08-057-3/+31
| | | | | | | | | | | Using --sub-filter-regex-plain (default:no) The ass-to-plaintext functionality already existed at sd_ass.c, but it's internal and uses a private buffer type, so a trivial utility wrapper was added with standard char*/bstr interface. The plaintext can be multi-line, and the multi-line regexp flag is now always set, but only affects plaintext (the ASS source is one line).
* sub: new: --sub-filter-jsre (js regex)Avi Halachmi (:avih)2021-08-057-0/+146
| | | | | | | | | | | | Pretty much identical to filter-regex but with JS expressions and requires only JS support. Shares the filter-regex-* control options. The target audience is Windows users - where filter-regex doesn't work due to missing APIs, but mujs builds cleanly on Windows, and JS is usually enabled in 3rd party Windows mpv builds. Lua could have been used with similar effort, however, the JS regex syntax is more extensive and also much more similar to POSIX.
* sub: SDH filter: use unified text-extraction utilsAvi Halachmi (:avih)2021-08-051-46/+17
|
* sub: SDH filter: small refinementsAvi Halachmi (:avih)2021-08-051-6/+10
| | | | | | | | | | | | | | | 1. On a pathological case where event_format is NULL, previously the filter was trying to use it with each new sub - and re-failed. Now the filter gets disabled on init (event_format doesn't change). 2. Previously, if the filter didn't modify the text or if the text could not be extracted - it still allocated a new packet with same content. Now it returns the original, saving a whole lot of no-ops (there are still few allocations in this case though). 1 above is preparation for the next commit, and 2 was trivial, but there's more to do if anyone cares (NIH string functions instead of bstr, unused arguments, messages could be improved, and more).
* sub: add filter text utils, use from filter-regex (no-op)Avi Halachmi (:avih)2021-08-053-22/+39
| | | | | | | | | | | | Add two stand-alone function to help with the text-extraction task which ass filters need. Makes it easier to add new filters without cargo-culting this functionality. Currently, on malformed event (which shouldn't happen), a warning is printed when a filter tries to extract the text, so if few filters are enabled, we'll get multiple warnings (like before) - not critical. The regex filter now uses these utils, the SDH filter not yet.
* wayland: cleanup handle_toplevel_configDudemanguy2021-08-032-13/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The source of many geometry woes. There's some loosely related toplevel things that should be cleaned up/fixed. First of all, VO_EVENT_LIVE_RESIZING is actually completely useless. It might have been useful sometime in the past, but there's no point. It doesn't "speed up" resizing in any way and appears to be originally for cocoa. Just remove it. Way back in the day, toplevel_width/height was added as a workaround for when we got uncoorperative (i.e. wrong) width/height coordinates from the compositor in this event. Basically it could happen due to numerous reasons but a lack of atomic commits was part of the reason and also mpv's geometry handling then was a lot rougher. We *shouldn't* need this workaround anymore. The width/height values are only used exactly when we need them. If mpv sets geometry on its own, it should still be the right dimensions. Related to the above, mpv never actually propertly handled the case where width or height was equal to 0. According to the xdg-shell spec, "If the width or height arguments are zero, it means the client should decided its own window dimension." An example of a compositor doing this is weston. It's, unsurprisingly, broken. Getting out of fullscreen or a maximized state does not restore the old window size like it should. The right way to handle this is to just return near the end of the function if we have a 0 for either argument and before any geometry is set (wl->geometry's width or height can never be zero). Luckily, state changes are already being detected so they just trigger the goto when needed. Finally, e2c24ad mistakenly removed the VO_EVENT_EXPOSE. There are edge cases where this is needed and it's safer to just force a redraw here when the window gets activated again. Just force wl->hidden to false first and then trigger the expose.
* options: don't always set set-locally to trueGuido Cella2021-08-031-2/+1
| | | | | | | | | | | | | | | | Since 1d1d1fbff9 option-info/<name>/set-locally was being set to true for every option. This broke setting start from ytdl-hook, which doesn't overwrite start if it was set-locally. Fix this so that only adding an option to reset-on-next-file or setting file-local-options/<name> make set-locally true like before. However, it's arguable that just adding an option to reset-on-next-file without ever changing it should not make set-locally true, so that e.g. --reset-on-next-file=start 'https://youtube.com/watch?v=...&t=30' will start at 30, though it currently doesn't. Fixes #9081.
* stats.lua: page 4 (keys): better alignment of non-ascii keysAvi Halachmi (:avih)2021-07-311-2/+16
| | | | | | | | | | | | | | | | | | | | | | | Previously we assumed the key-name string occupies strlen(name) cells, now we count codepoints instead. This improves alignment of non-english key names. Still not perfect because we don't know if the key name is single or double width, but wcwidth not available to scripts, notoriously unreliable (depends on locale, correct and updated tables, etc), and also not always available (Windows). Still, better than nothing, and we err by at most one cell - vs up to three before this commit (4 bytes keyname codepoint). In the future we could do the alignment using libass tags, however, this both complicates the ass-output generation, and also not available when we output for the terminal, so for now only count codepoints. Also, if the key name was in a right-to-left language, then previously the name/command were swapped visually. Now we inject a left-to-right marker before the name to ensure direction. This works also when harfbuzz is disabled for libass (--sub-ass-shaper=simple).
* player: eac3 to the whitelist of audio extensionsDudemanguy2021-07-301-1/+1
| | | | ffmpeg plays these just fine. Fixes #9065.
* DOCS/input.rst: key names: add shift modifier notehooke0072021-07-301-0/+6
| | | | Fixes #9060
* stats.lua: page 4 (keys): detect single-quotesAvi Halachmi (:avih)2021-07-301-2/+2
|
* input: arguments quoting: support single-quotesAvi Halachmi (:avih)2021-07-302-9/+26
| | | | | | | | | | | | | | | | | | | Users expect single quotes to work when the value includes literal backslashes or double-quotes (or as general quoting like in shell). The updated docs also include some previously-missing notes: - newline is only supported in double quotes. - adjacent (quoted) arguments don't join into one. Supporting mixed quoting (adjacent quoted strings) would make mpv's parsing more complete, but would require delicate effort of larger scope, for two reasons: - We'd need to also support escaping outside of quotes and do our best about backward compatibility. - The parsed value can either be a substring of the input or a newly-allocated string, which would be delicate when joining. Not critical to add right now.
* input: argument custom quotes: use ` instead of !Avi Halachmi (:avih)2021-07-302-7/+7
| | | | | | | | | | | Custom quotes were added in 4f129a3e and began with !, however, this required quoting "!reverse" (used for the cycle-values command), which is inconvenient, and was not taken into account when ! was chosen for custom quotes. Also, ` is more natural for quoting than !. This does break backward compatibility with the earlier form of custom quotes, but at least we didn't make a release yet since custom quotes were added (the last release - 0.33[.1] doesn't support it).
* options: audio-display determines cover priorityGuido Cella2021-07-294-12/+21
| | | | | | | | | | | | Let audio-display determine whether embedded images or external cover art tracks should be selected when both are present. Attached pictures are given priority by default as requested in #8539. Also updates references to attached pictures in the log and manpage to refer to cover art as well. Closes #8539.
* DOCS: fix manual compiling warningsgaroto2021-07-282-2/+2
| | | | | | | | | | This fix the warnings shown below when compiling the manual for any of its three common formats: ``` DOCS/man/mpv.rst:46: (ERROR/3) Unknown target name: "--input-test". DOCS/man/stats.rst:183: (ERROR/3) Unknown target name: "--input-test". ```
* DOCS/mpv.rst: fix quotingAvi Halachmi (:avih)2021-07-281-1/+1
| | | | | | In rst, double-backtick starts a code string only if it's followed by a non-space char, otherwise it's taken literally, hence, `` x2.0`` was taken literally rather than code string.
* ci/travis: remove everything as it's nop nowJan Beich2021-07-271-52/+0
|
* ci/travis: remove freebsd buildJan Beich2021-07-271-38/+0
|
* github/workflows: add freebsd CIJan Beich2021-07-271-0/+43
|
* manpage: explain when properties are expandedGuido Cella2021-07-271-3/+13
|
* TOOLS/autocrop.lua: allow hiding OSD messagesGuido Cella2021-07-271-6/+12
| | | | | | Because having these on every video is annoying, and when yo