| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
| |
- remove redundant strlen/wcslen
- reuse allocated temporary buffers
The difference is not big, but it satisfies me to remove those
redundancies.
|
|
|
|
|
|
|
| |
GetConsoleMode() can be quite slow and in mpv the mode never changes, so
we can just check it once.
Fixes performance when writing lots of logs to terminal.
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
%s is evaluated as wchar_t only in "Windows classic" semantic. It is not
C standard compliant.
%ls is compatible with both and means the same wchar_t format.
This commit fixes error output from mpv.com.
See: https://devblogs.microsoft.com/oldnewthing/?p=102823
|
|
|
|
|
|
|
|
|
|
|
| |
This is default behavior to attach to existing console, passing custom
handles is useful if we want to replace them, but in case they are
already attached to console we want to attach to console directly.
In theory, it should work out of the box because "console-like" handles
should be managed by Windows internally, which works for INPUT and
OUTPUT, but in certain cases, not for ERROR. This allows using VT
features in those cases for stderr too.
|
|
|
|
|
|
|
|
|
| |
This flag is a GNU extension in C99, but was standardrized in C11,
so mpv should be able to use it. fopen is wrapped on win32 so
non-compliant MSVCRT.dll isn't a concern.
Since the upcoming commit uses this feature it can be brought back.
This reverts commit c36e051470dceb24c75d36316490e063a77dacba.
|
|
|
|
|
| |
Adds a function to resolve the target of a shell link (Windows shortcut)
for use by other parts of mpv.
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
| |
this makes it possible to properly test for those modifiers in a proper
swift like way.
|
|
|
|
| |
some redundant functions that jump through hoops.
|
|
|
|
| |
also make functions thread safe.
|
|
|
|
|
| |
preparation for mac/events cleanup and single responsibility principle.
all functions are thread safe.
|
|
|
|
|
| |
with the use of an explicit type we can removed inferred type checks
like separators/services menu by name or menus by sub configs.
|
|
|
|
| |
also makes menu creation cleaner and more obvious.
|
|
|
|
|
|
| |
only add the "Show log File…" menu item config when invoked from the
bundle, instead of testing on menu item creation. this is similar to the
touch bar menu items now.
|
|
|
|
|
|
| |
keeping track of the dynamic menu items lets us directly access them by
key. we don't need to search in the config array for the right config
and menu item.
|
|
|
|
|
| |
a file path is basically an URL. both are also handled as URL objects
in our code.
|
| |
|
|
|
|
|
| |
add a config property to the menu items, so we don't need to search in
the config array for the right config.
|
| |
|
|
|
|
|
|
| |
the check broke when the runtime check was removed, eg the menu item was
never added to the menu. since we only add the menu item to the config
when touch bar support is available the check is completely unnecessary.
|
| |
|
|
|
|
| |
this key is already assigned to Undo.
|
|
|
|
| |
don't save files in a temporary array and use an in place mapping.
|
| |
|
|
|
|
|
|
|
| |
the config folder is created by mpv if it does not exist, so the last
alert is unnecessary.
also change config path priority.
|
| |
|
| |
|
|
|
|
|
| |
rename all macOS namings (osx, macosx, macOS, macos, apple) to mac, to
make naming consistent.
|
|
|
|
|
|
|
|
|
|
| |
the swift obj-c bridging header is only included when cocoa-cb is
enabled. cocoa-cb is not the only swift feature anymore and disabling
cocoa-cb leads to a runtime error that specific swift classes could not
be found.
include the swift obj-c bridging header in the case swift features are
enabled.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
cocoa-cb was always pre-allocated in the Application itself because
libmpv needs to be set up before usage, an opengl context has to be set
and because it was decided mac specific code should be kept out of
libmpv.
this means that a completely working libmpv and opengl renderer was set
up even if it wasn't used. leading to unnecessary log message, resources
being used or reserved on the system that might not be used, triggering
of dedicated GPU unnecessarily and many other things.
even if not optimal, this wasn't the biggest problem since we only had
that one working vo on macOS. though now that we have a vulkan
gpu(-next) backend on macOS that was made the default, we always have
that dangling cocoa-cb instance, which is completely unnecessary.
move the cocoa-cb initialisation into libmpv preinit function and only
init cocoa-cb when we are a standalone App and cocoa-cb support is build
into.
|
|
|
|
|
|
|
|
| |
unlink() was never wrapped in win32, so all usages of it were referring
the ANSI version of the function. This doesn't work properly for Windows
versions before 1903 (where the UTF-8 codepage is requested).
Fix this by adding mp_unlink() which wraps over _wunlink().
|
| |
|
|
|
|
|
|
|
| |
The purpose of osdep/io is to provide a wrapper for POSIX I/O functions
on Windows. The last 2 functions are utility functions which don't serve
this purpose.
Move them to a separate file.
|
|
|
|
|
|
| |
fopen() with 'x' mode is a non-portable glibc extension, is currently
unused, and should not be used in order to maintain POSIX compatibility.
Thus there is no need for the Windows wrapper mp_fopen() to support it.
|
|
|
|
|
| |
change all mentions and variations of OSX, OS X, MacOSX, MacOS X, etc
consistent. use the official naming macOS.
|
|
|
|
|
| |
In OpenBSD the compilation fail because osdep/threads-posix.h
need include pthread_np.h
|
| |
|
|
|
|
|
| |
no need to keep track of the nowPlayingInfo, MPNowPlayingInfoCenter
already provides the current info.
|
| |
|
|
|
|
| |
Fixes #11233
|
| |
|
|
|
|
| |
Fixes #11233
|
|
|
|
| |
also rate limit the position to update at max once per second.
|
|
|
|
| |
Fixes #11233
|
|
|
|
|
|
|
|
|
|
| |
the observer is registered on every call of the start function. this
could lead to several registered observers for the same event and
several calls to the make current function, even though we only need it
once per event.
properly remove the observer on stop, so we only ever have one observer
registered.
|
|
|
|
|
| |
preparation for the upcoming changes for new functionality not related
to key handling.
|
| |
|
| |
|
|
|
|
|
| |
the class local struct and enum are moved to an extension to separate
their definition and usage.
|
|
|
|
|
| |
making the config explicit gets rid of some optional unwrapping. also
rename some variables to better represent their values.
|
|
|
|
|
| |
Due to the state of the other fds/pipes it cannot safely be assumed
that the loop breaks on its own.
|
|
|
|
|
| |
Replace various dead links with live replacements or archives.
Less friction for anyone who wants to look up these references.
|
|
|
|
| |
Move from vo_gpu_next.c to io.c and return result.
|
|
|
|
| |
No longer true after 8bbcc87feea7abf256a6c7f511244d09f5520c17.
|
|
|
|
|
|
| |
Fixes compatibility with loading scripts from relative config paths.
Fixes #13212
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
commit fa9e1f06f tried to move signal unsafe operations out of
signal handlers but mistakenly introduced a race. before,
sigtstop would process the following in order:
0. do_deactivate_getch2();
1. raise(SIGTSTP)
that commit moved 0 out of the signal handler (due to it being
unsafe) but kept 1 in there. this may mess up the ordering of
these operations. this commit moves everything out of the
handler so that things happen in proper order.
since things are now moved out of the handler, SA_RESETHAND is
no longer being applied to SIGTSTP. since that can result in
races if multiple signals are delivered faster than we can
respond to them.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This can cause mpv to abruptly quit without following the proper uninit
process when a second `SIGTERM` or `SIGQUIT` is sent and mpv
didn't quit on the first one already. This is because the default action
for these signals is to terminate the program immediately, similar to
`SIGKILL`, and `SA_RESETHAND` resets the `quit_request_sighandler` to
`SIG_DFL` for the default action.
Also keep the `SA_RESETHAND` flag for SIGINT because the current
behavior is to quit after receiving two Ctrl+C no matter what, this is
probably convenient and worth keeping.
This change is because some tools (e.g. GNU timeout) send SIGTERM twice
after the timeout period.
An easy way to reproduce is with `timeout 1 mpv [...]` where mpv would
quit abruptly anywhere from half the time to once every 50 attempts
depending on your luck.
|
|
|
|
|
|
|
|
| |
In commit c09245cdf2491211f3e0bfe47f28cc0e0a2e05c8
long-path support was enabled for mpv without actually
making sure that there was no code left that used the
old limit (260 Unicode chars) for buffer sizes.
This commit fixes all but one case.
|
|
|
|
| |
This is about the maximum filename not path length.
|
| |
|
|
|
|
|
|
|
| |
ref: https://learn.microsoft.com/en-us/windows/win32/sbscs/application-manifests#heaptype
Improves demuxer cache recycling speed at the cost of a slight CPU usage increase.
SegmentHeap is supported in Windows 10, version 2004 (build 19041) and later.
|
| |
|
|
|