summaryrefslogtreecommitdiffstats
path: root/osdep
Commit message (Collapse)AuthorAgeFilesLines
* mac/event: only initialise an EventHelper when necessaryder richter2024-03-242-4/+12
|
* mac/touchbar: use AppHub directly instead of the singletonder richter2024-03-241-2/+3
|
* mac/remote: use AppHub directly instead of the singletonder richter2024-03-241-2/+3
|
* mac/touchbar: use EventHelper for event handlingder richter2024-03-244-66/+22
| | | | also remove remaining old event handling.
* mac/touchbar: move touch bar into AppHubder richter2024-03-242-1/+7
|
* mac/remote: use EventHelper for event handlingder richter2024-03-242-50/+37
|
* mac/touchbar: fix devision by 0der richter2024-03-241-1/+1
|
* mac/remote: fix devision by 0der richter2024-03-241-1/+1
|
* cocoa-cb: use EventHelper for event handlingder richter2024-03-242-18/+11
|
* cocoa-cb: use a separate mpv_handle for cocoa-cb to simplify shutdownder richter2024-03-243-22/+12
|
* mac/apphub: migrate remaining events functionality to new AppHubder richter2024-03-2410-219/+161
| | | | | | | | add new app_bridge objc file for bridging between mpv core and app functionality. replace old EventsResponder singleton with AppHub. another step to clean up all App functionality and have one central place for it.
* mac/event: add helper to subscribe to mpv events and property changesder richter2024-03-242-0/+166
| | | | | preparation to remove duplicate code from all classes that implement their own observer loops.
* mac/libmpv: remove unused functionsder richter2024-03-211-37/+0
|
* mac/option: remove now unused computed option variablesder richter2024-03-211-1/+0
|
* mac/option: rename option structs to properly represent their contentder richter2024-03-214-35/+29
| | | | also optimise option cache setup.
* mac/libmpv: remove mac option handling in favour of option handlerder richter2024-03-211-14/+0
| | | | | | since the option handler is not optional anymore and available on init in cocoa-cb we don't need to duplicate this functionality in libmpv anymore.
* mac/option: make option helper none optionalder richter2024-03-211-1/+1
| | | | gets rid of some unwrapping boilerplate and nil coalescing operators.
* mac/option: make option helper vo struct independentder richter2024-03-211-6/+3
|
* mac/option: optimise option pointer accessder richter2024-03-211-3/+4
|
* mac/option: remove unused and obsolete variablesder richter2024-03-211-6/+1
|
* mac/option: move option functionality from mpv helper to option helperder richter2024-03-213-8/+8
| | | | delete now empty mpv helper
* mac/type: move c<>swift type bridging into a dedicated type helperder richter2024-03-216-70/+88
|
* win32: increase hires timer resolutionnanahi2024-03-193-21/+38
| | | | | | | | | | | timeBeginPeriod() only allows setting minimum timer resolution to 1 ms. However, modern x86 platforms support a minimum timer resolution of 0.5 ms. Use NtSetTimerResolution() instead for the increased resolution, which can be set with MPV_HRT_RES. Additionally, change the units of mp_start_hires_timers(), mp_end_hires_timer(), MPV_HRT_RES, and MPV_HRT_MAX to nanoseconds, in accordance with other functions used in timer.h.
* win32: avoid multi byte string to wide conversion if not neededKacper Michajłow2024-03-191-5/+18
|
* win32: add puts/fputs wrappersKacper Michajłow2024-03-195-14/+64
|
* win32: optimize mp_vfprintf a littleKacper Michajłow2024-03-194-23/+36
| | | | | | | | - remove redundant strlen/wcslen - reuse allocated temporary buffers The difference is not big, but it satisfies me to remove those redundancies.
* win32: cache GetConsoleMode state for stdout/stderrKacper Michajłow2024-03-193-31/+42
| | | | | | | 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.
* win32: don't touch buffering optionsKacper Michajłow2024-03-191-1/+0
|
* win32-console-wrapper: fix printf specifiersKacper Michajłow2024-03-191-1/+1
| | | | | | | | | | | %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
* win32: don't pass std handles if they are attached to consoleKacper Michajłow2024-03-191-15/+20
| | | | | | | | | | | 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.
* Revert "osdep/io: ignore 'x' mode for mp_fopen"nanahi2024-03-191-1/+2
| | | | | | | | | 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.
* win32: implement shell link target resolvingnanahi2024-03-192-0/+26
| | | | | Adds a function to resolve the target of a shell link (Windows shortcut) for use by other parts of mpv.
* osdep/main-fn-win: fix implicit conversion warningnanahi2024-03-191-1/+1
|
* osdep/threads: fix warning: initializer element is not constantnanahi2024-03-192-2/+2
|
* mac/touchbar: simplify item and view creationder richter2024-03-181-70/+53
|
* mac/touchbar: optimise time item updateder richter2024-03-181-6/+3
|
* mac/touchbar: optimise constraint calculationder richter2024-03-181-5/+3
|
* mac/touchbar: use DateComponentsFormatter for time formattingder richter2024-03-181-9/+5
|
* mac/touchbar: simplify update items logicder richter2024-03-181-27/+8
|
* mac/touchbar: take playback speed into account for rate limitingder richter2024-03-181-1/+4
|
* mac/touchbar: rewrite touch bar in swiftder richter2024-03-184-397/+344
|
* various: use static assertions where appropriatesfan52024-03-171-1/+1
|
* mac/input: optimise scroll wheel event handlingder richter2024-03-161-35/+18
|
* mac/input: move scroll wheel event handling into input helperder richter2024-03-161-5/+40
|
* mac/input: optimise mouse movement enabled checkder richter2024-03-161-2/+3
|
* mac/input: fix switched mouse forward and back buttonder richter2024-03-161-2/+2
|
* mac/input: move mouse event handling into input helperder richter2024-03-161-0/+28
|
* mac/input: add missing special keysder richter2024-03-141-0/+2
|
* mac/input: add simplified mp_keymap initder richter2024-03-142-52/+32
|
* mac/input: remove wrongly mapped modifier keysder richter2024-03-141-3/+0
|
* mac/event: move key event handling to input helper and optimise itder richter2024-03-147-165/+128
|
* mac/input: define AltGr mask as static NSEvent.ModifierFlags variableder richter2024-03-142-2/+8
| | | | | this makes it possible to properly test for those modifiers in a proper swift like way.
* mac/events: remove redundant functions and optimise input helper usageder richter2024-03-1410-109/+29
| | | | some redundant functions that jump through hoops.
* mac/helper: move input ctx related functionality into new input helperder richter2024-03-143-95/+76
| | | | also make functions thread safe.
* mac/events: move input ctx related functionality into new input helperder richter2024-03-143-31/+79
| | | | | preparation for mac/events cleanup and single responsibility principle. all functions are thread safe.
* mac/menu: add explicit menu type instead of an inferred typeder richter2024-03-071-45/+49
| | | | | with the use of an explicit type we can removed inferred type checks like separators/services menu by name or menus by sub configs.
* mac/menu: make menu creation recursive to allow nested submenusder richter2024-03-071-31/+31
| | | | also makes menu creation cleaner and more obvious.
* mac/menu: move conditional Bundle menu items into configder richter2024-03-071-11/+6
| | | | | | 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.
* mac/menu: keep track of menu items with dynamic actionsder richter2024-03-071-14/+8
| | | | | | 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.
* mac/menu: merge file and url config propertiesder richter2024-03-071-15/+11
| | | | | a file path is basically an URL. both are also handled as URL objects in our code.
* mac/menu: properly guard playlist array accessder richter2024-03-071-2/+2
|
* mac/menu: attach menu config to menu item for direct accessder richter2024-03-071-27/+21
| | | | | add a config property to the menu items, so we don't need to search in the config array for the right config.
* mac/menu: replace app.command usage with event.commandder richter2024-03-071-2/+2
|
* mac/menu: fix touch bar menu itemder richter2024-03-071-6/+0
| | | | | | 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.
* mac/menu: rename Preferences to Settings for consistency with macOSder richter2024-03-071-4/+4
|
* mac/menu: remove duplicate key assignment Undo/Zoomder richter2024-03-071-1/+1
| | | | this key is already assigned to Undo.
* mac/menu: optimise loading files functionder richter2024-03-071-7/+3
| | | | don't save files in a temporary array and use an in place mapping.
* mac/menu: replace deprecated openFile() usageder richter2024-03-071-8/+8
|
* mac/menu: remove unnecessary alert config fields and alertder richter2024-03-071-43/+10
| | | | | | | the config folder is created by mpv if it does not exist, so the last alert is unnecessary. also change config path priority.
* mac/menu: rewrite menu bar in swiftder richter2024-03-078-910/+472
|
* mac/app: remove unused functionder richter2024-03-072-7/+0
|
* osdep/mac: make mac naming of files, folders and function consistentder richter2024-02-2828-45/+45
| | | | | rename all macOS namings (osx, macosx, macOS, macos, apple) to mac, to make naming consistent.
* build: fix build when disabling cocoa-cbder richter2024-02-272-2/+2
| | | | | | | | | | 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: remove pre-allocation and initialise only when usedder richter2024-02-274-9/+24
| | | | | | | | | | | | | | | | | | | | | 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.
* osdep/io: add mp_unlink()nanahi2024-02-252-0/+10
| | | | | | | | 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().
* mac: code consistency changesder richter2024-02-241-4/+0
|
* osdep/io: move I/O utility functions to misc/io_utilsnanahi2024-02-232-58/+0
| | | | | | | 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.
* osdep/io: ignore 'x' mode for mp_fopennanahi2024-02-231-2/+1
| | | | | | 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.
* various: make mentions of macOS consistentder richter2024-02-212-2/+2
| | | | | change all mentions and variations of OSX, OS X, MacOSX, MacOS X, etc consistent. use the official naming macOS.
* osdep/threads-posix: fix headers for OpenBSD buildJose Maldonado aka Yukiteru2024-02-151-0/+5
| | | | | In OpenBSD the compilation fail because osdep/threads-posix.h need include pthread_np.h
* mac/remote: simplify cover retrievalder richter2024-02-151-3/+1
|
* mac/remote: remove unnecessary nowPlayingInfo variableder richter2024-02-151-14/+7
| | | | | no need to keep track of the nowPlayingInfo, MPNowPlayingInfoCenter already provides the current info.
* mac/remote: add album and artist infoder richter2024-02-152-3/+12
|
* mac/remote: add seek supportder richter2024-02-151-2/+14
| | | | Fixes #11233
* mac/remote: add chapter title infoder richter2024-02-153-4/+8
|
* mac/remote: add media-title infoder richter2024-02-152-3/+7
| | | | Fixes #11233
* mac/remote: add playback rate infoder richter2024-02-152-2/+6
| | | | also rate limit the position to update at max once per second.
* mac/remote: add duration and current position infoder richter2024-02-152-8/+26
| | | | Fixes #11233
* mac/remote: remove make current observer when stoppedder richter2024-02-151-0/+6
| | | | | | | | | | 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.
* mac/remote: replace command handler with generic handler function configder richter2024-02-151-15/+17
| | | | | preparation for the upcoming changes for new functionality not related to key handling.
* mac/remote: simplify repeatable key logicder richter2024-02-151-6/+2
|
* mac/remote: move configs to initialiser for new MediaPlayer shorthandsder richter2024-02-151-53/+56
|
* mac/remote: move class local struct and enum definition to extensionder richter2024-02-151-1/+3
| | | | | the class local struct and enum are moved to an extension to separate their definition and usage.
* mac/remote: use explicit struct instead of generic array for configsder richter2024-02-151-48/+31
| | | | | making the config explicit gets rid of some optional unwrapping. also rename some variables to better represent their values.
* osdep: fix infinite loop when cancelling subprocesssfan52024-02-111-1/+3
| | | | | Due to the state of the other fds/pipes it cannot safely be assumed that the loop breaks on its own.
* various: replace dead links in commentsnanahi2024-02-111-2/+4
| | | | | Replace various dead links with live replacements or archives. Less friction for anyone who wants to look up these references.
* io: add mp_save_fileKacper Michajłow2024-01-312-0/+30
| | | | Move from vo_gpu_next.c to io.c and return result.
* osdep/timer: update documentation and test for mp_time_nsKacper Michajłow2024-01-261-1/+1
| | | | No longer true after 8bbcc87feea7abf256a6c7f511244d09f5520c17.
* osdep/io: expand path before LoadLibraryKacper Michajłow2024-01-221-3/+17
| | | | | | Fixes compatibility with loading scripts from relative config paths. Fixes #13212
* terminal: don't print escape sequence if not ttyKacper Michajłow2024-01-151-2/+4
|
* terminal-unix: don't install handler before pipeNRK2024-01-151-4/+5
|
* terminal-unix: move all processing out of sighandlerNRK2024-01-151-23/+16
| | | | | | | | | | | | | | | | | | | 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.
* terminal-unix: don't set `SA_RESETHAND` for SIGTERM/SIGQUITllyyr2024-01-141-2/+2
| | | | | | | | | | | | | | | | | | | | 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.
* various: use correct PATH_MAX for win32sfan52023-12-274-11/+28
| | | | | | | | 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.
* osdep: clarify and rename a constant on win32sfan52023-12-271-3/+5
| | | | This is about the maximum filename not path length.
* various: fix capitalization of 'GitHub'Ikko Eltociear Ashimine2023-12-271-1/+1
|
* win32: opt in to the windows segment heapAndarwinux2023-12-221-0/+1
| | | | | | | 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.
* win32: support long file pathsstax762023-12-211-0/+1
|
* terminal-unix: enable the cursor after ctrl+zGuido Cella2023-12-181-0/+2
| | | | | | | 24270b8587 disabled the cursor while mpv is running, but if you send mpv to the background, it is not re-enabled until you run bg, and not even after that if mpv is paused. Fix this by enabling the cursor from the SIGTSTP handler.
* mac: add support for drag-and-drop optionder richter2023-12-152-0/+15
|
* win32: properly handle WM_XBUTTONUP and WM_XBUTTONDOWNnanahi2023-12-061-0/+2
| | | | | | | | | | | | | | | | According to MS documentation, an application should return TRUE from WM_XBUTTONUP and WM_XBUTTONDOWN if it processes these messages. DefWindowProc generates the WM_APPCOMMAND message when it processes the WM_XBUTTONUP message, so if an application properly handles WM_XBUTTONUP messages, extra WM_APPCOMMAND messages won't be generated. Because mpv doesn't properly handle these messages, WM_XBUTTONUP causes APPCOMMAND_BROWSER_BACKWARD to be generated, resulting in duplicated keys and improper fix 438ead7a, which prevents the processing of the appcommand from sources other than mouse clicks. Fix this by following the documentation, and the back and forward appcommands can be added.
* mac: report modifier keys on precise scrollingder richter2023-12-021-2/+23
| | | | | | modifier keys weren't reported when using the trackpad to scroll. Fixes #11195
* Reapply "osdep/meson: add libplacebo include dir to swift compile"Dudemanguy2023-11-271-1/+3
| | | | | | | It's not actually related to libplacebo wrap stuff and the swift compile command needs this to get the right libplacebo include path. This reverts commit b9d392ecd9543aecdfd6e6a06aa2f9585950ac27.
* Revert "osdep/meson: add libplacebo include dir to swift compile"Dudemanguy2023-11-271-3/+1
| | | | | | | This is not needed since we removed the libplacebo wrap not too long after this commit. This reverts commit 4de76ce87a545cd86ef493129b4cfeafe10e8e98.
* mac: fix libmpv usage without embeddingder richter2023-11-254-20/+9
| | | | | | | | | | | NSApp is only an Application when initialised from mpv itself. when used via libmpv an Application is never initialised and mpv would always immediately exit. make the retrieval of the vo and mac options static so they can be retrieved in all cases. Fixes #12518
* mac: cleanup some unused and unneeded codeder richter2023-11-251-1/+0
|
* osdep/io: add PRINTF_ATTRIBUTE for printf overridesKacper Michajłow2023-11-251-2/+4
|
* meson: adjust win32 definesKacper Michajłow2023-11-251-0/+1
| | | | | | | | - Don't define _GNU_SOURCE on Windows, no need - Define WIN32_LEAN_AND_MEAN to strip some unneded headers from windows.h - Define NOMINMAX and _USE_MATH_DEFINES as they are common for Windows headers
* osdep/macosx: add default switch cases to suppress WswitchKacper Michajłow2023-11-242-0/+4
|
* mac: add rotation menubar entriesder richter2023-11-201-0/+22
|
* win32: don't jump over variable init with gotoKacper Michajłow2023-11-181-1/+2
| | | | Those variables are accessed after jump.
* osxbundle: remove mpv-bundle symlink to allow code signingDaniel Brookman2023-11-151-5/+4
| | | | | | | | | | | | | | | | | | | Apps on Apple silicon have to be codesigned to run, but you can't codesign bundles that have a symlink for the main executable. The "mpv-bundle" symlink was used as the bundle's main executable because it makes the execution name of the binary different. Launch Services runs the CFBundleExecutable key from Info.plist when launching a bundle, so by comparing the execution name to the name of the symlink, you can check if that's how the binary was launched. This replaces that detection method by moving the MPVBUNDLE environmental variable into Info.plist. Launch Services will set anything in LSEnvironment as environmental variables before launching the bundle, so we're able to check for it instead of needing to differentiate the execution name of the binary. Fixes #12116
* osdep/w32_keyboard: remove duplicated MP_KEY_BACK mappingKacper Michajłow2023-11-111-1/+0
| | | | | | | MP_MBTN_BACK is already mapped, the appcmd duplicates this. Fixes: #12768 Fixes: 8301906
* mac: change display name retrieval to localizedName NSScreen propertyder richter2023-11-101-31/+0
| | | | | | | | | | | | | | | the old displayName property via the IODisplay API is not working anymore on ARM based macs and was broken in at least one other case. instead we use the new localizedName property introduced in 10.15 of the NSScreen. we don't need any backwards compatibility since 10.15 is the oldest version we support now. configs and scripts that use the options and properties fs-screen-name, screen-name or display-names need to be adjusted since the names could differ from the previous implementation via the IODisplay API. Fixes #9697
* osdep/io: implement rename() wrappersfan52023-11-102-0/+16
| | | | | This is needed to provide the POSIX behaviour of transparently overwriting existing paths.
* vo: don't sleep 1ms always when requested time is in the pastKacper Michajłow2023-11-091-2/+9
| | | | | | | | | | | | | | Fixes a899e14b which changed clamp from 0 to 1 ms which effectivelly introduced 1ms sleep always, even if requested until_time_ns is in the past and should request 0 timeout. While at it also fix mp_poll wrapper to respect negative timeout which should mean infinite wait. Also keep the 37d6604 behaviour for very short timeouts, but round only the ones > 100us, anything else is 0. Fixes: a899e14b
* mac: remove runtime checks and compatibility for macOS older than 10.15der richter2023-11-097-129/+5
| | | | | we stopped supporting macOS older than 10.15 and hence can remove all the unnecessary runtime checks and compatibility layers.
* meson: remove several macos-10-* build optionsDudemanguy2023-11-092-25/+0
| | | | | | | | | | | These have been build options since the waf build, but that doesn't really make sense. The build can detect whatever macOS sdk version is available and then use that information to determine whether to enable the features or not. Potentially disabling multiple sdk versions doesn't really make any sense. Because f5ca11e12bc55d14bd6895b619c4abfd470c6452 effectively made macOS 10.15 the minimum supported version, we can drop all of these checks and bump the required sdk version to 10.15. The rest of the build simplifies from there.
* audio: introduce ao_read_data_nonblocking()Thomas Weißschuh2023-11-081-0/+2
| | | | | This behaves similar to ao_read_data() but does not block and may return partial data.
* threads-win32: add comment about local decl of a functionKacper Michajłow2023-11-081-0/+1
|
* threads-win32: support UWP in mp_thread_set_nameKacper Michajłow2023-11-081-3/+7
|
* osdep/threads-posix: use CLOCK_MONOTONIC if supportedKacper Michajłow2023-11-081-10/+56
|
* osdep/timer-linux: check clock availability on initKacper Michajłow2023-11-081-6/+21
|
* threads: unbreak mpv on builds without assertsKacper Michajłow2023-11-063-4/+2
| | | | | | Also remove duplicated macro. Fixes: #12818 #12820
* win32/pthread: remove unused codeKacper Michajłow2023-11-053-529/+0
|
* timer: remove unused codeKacper Michajłow2023-11-052-37/+0
|
* threads: remove unused codeKacper Michajłow2023-11-052-33/+0
|
* threads: rename threads.c to threads-posix.cKacper Michajłow2023-11-051-0/+0
|
* threads: move pthread debug to threads-posix.hKacper Michajłow2023-11-052-61/+61
| | | | And remove redundant define while at it.
* mp_thread: add win32 implementationKacper Michajłow2023-11-054-2/+233
|
* mp_thread: prefer tracking threads with idKacper Michajłow2023-11-051-3/+7
| | | | | | | | | | | | | | This change essentially removes mp_thread_self() and instead add mp_thread_id to track threads and have ability to query current thread id during runtime. This will be useful for upcoming win32 implementation, where accessing thread handle is different than on pthreads. Greatly reduces complexity. Otherweis locked map of tid <-> handle is required which is completely unnecessary for all mpv use-cases. Note that this is the mp_thread_id, not to confuse with system tid. For example on threads-posix implementation it is simply pthread_t.
* ALL: use new mp_thread abstractionKacper Michajłow2023-11-0513-50/+45
|
* threads: add new mp_thread abstractionKacper Michajłow2023-11-052-0/+148
| | | | | | This will allow to avoid hacky pthreads symbols/header override. Inspired by pl_thread from libplacebo.
* various: remove trailing whitespaceGuido Cella2023-10-301-4/+4
|
* timer-linux: fallback to CLOCK_MONOTONIC instead of timespec_getDudemanguy2023-10-271-3/+4
| | | | | | | | | | | | | CLOCK_MONOTONIC_RAW is linux-specific (macOS later supported it but it has its own timer code) and not neccessarily available everywhere like on BSDs. It makes sense to prefer it because mpv does a lot of measurements at small intervals (e.g. every frame) so theoretically it should be more accurate. However if the OS doesn't have it, fallback to CLOCK_MONOTONIC instead which is almost exactly the same and very widely supported across unix-like systems. This clock is technically optional according to POSIX, but any half-decent OS supports it anyway (sorry Solaris users). As a benefit, we now know that the clock from mp_time is always monotonic.
* mp_threads: rename threads for consistent naming across all of themKacper Michajłow2023-10-274-10/+8
| | | | | | | | I'd like some names to be more descriptive, but to work with 15 chars limit we have to make some sacrifice. Also because of the limit, remove the `mpv/` prefix and prioritize actuall thread name.
* timer: remove MP_START_TIMENRK2023-10-273-13/+6
| | | | | instead require mp_raw_time_ns() to not return 0, which all current implementation already should follow.
* semaphore_osx: change mp_sem_timedwait to mp_timeKacper Michajłow2023-10-262-22/+16
|
* semaphore_osx: don't overwrite global symbolsKacper Michajłow2023-10-261-22/+0
|
* timer: use MP_TIME macrosKacper Michajłow2023-10-262-5/+5
|
* osdep/timer-win2: rename to timer-win32Kacper Michajłow2023-10-251-0/+0
|
* osdep: fix clang warnings with `_FORTIFY_SOURCE`llyyr2023-10-242-2/+2
| | | | | | | This fixes warnings generated for `-Wunused-result` when mpv is built with `-O1 -D_FORTIFY_SOURCE=1` or higher on clang since read/write functions are declared with the `warn_unused_result` attribute. Cast to void to avoid these warnings.
* osdep/meson: add libplacebo include dir to swift compileKacper Michajłow2023-10-241-1/+3
|
* osdep: remove alignof emulationNRK2023-10-231-6/+0
| | | | | it's unused. and since C11 is pretty freely used now, new code can just use _Alignof or include <stdalign.h> directly.
* timer: drop ancient macOS fallbackDudemanguy2023-10-211-15/+1
| | | | | | | macOS didn't support clock_gettime until 10.12 which was released roughly 7 years ago. Since we're breaking support for ancient OSes anyway, we might as well break some old macOS versions for fun. This makes 10.12 the minimum supported macOS version.
* win32/pthread: fix calculation error in pthread_cond_timedwaitsfan52023-10-211-1/+1
| | | | closes #12699
* win32/pthread: add support for pthread_mutex_trylockThomas Weißschuh2023-10-202-0/+11
|
* threads: add support for pthread_mutex_trylockThomas Weißschuh2023-10-202-0/+15
|
* various: sort some standard headersNRK2023-10-201-2/+2
| | | | | | | | | | | | since i was going to fix the include order of stdatomic, might as well sort the surrouding includes in accordance with the project's coding style. some headers can sometime require specific include order. standard library headers usually don't. but mpv might "hack into" the standard headers (e.g pthreads) so that complicates things a bit more. hopefully nothing breaks. if it does, the style guide is to blame.
* various: remove ATOMIC_VAR_INITNRK2023-10-201-1/+1
| | | | | | | | | | | the fallback needed it due to the struct wrapper. but the fallback is now removed so it's no longer needed. as for standard atomics, it was never really needed either, was useless and then made obsolete in C17 and removed in C23. ref: https://gustedt.wordpress.com/2018/08/06/c17-obsoletes-atomic_var_init/ ref: https://en.cppreference.com/w/c/atomic/ATOMIC_VAR_INIT
* osdep: remove atomic.hNRK2023-10-202-32/+1
| | | | | | | replace it with <stdatomic.h> and replace the mp_atomic_* typedefs with explicit _Atomic qualified types. also add missing config.h includes on some files.
* osdep: drop atomic fallbackNRK2023-10-201-80/+0
| | | | | even msvc (which mpv apparently doesn't support) supports C11 atomics now. no need to carry around fallback with subtle semantic differences.
* win32/pthread: try to fix system headers leaking throughsfan52023-10-201-0/+6
|
* win32/pthread: implement clock_gettime for high-res timer purposessfan52023-10-202-9/+31
| | | | | | | Also apply some fixes to pthread_cond_timedwait while we're at it. Note that by using GetSystemTimePreciseAsFileTime here we lose support for Windows 7. This is considered acceptable.
* Revert "win32/pthread: don't convert time through unrelated timer"sfan52023-10-202-14/+16
| | | | | | | | | | This reverts commit 318b5471a18e464cfcd1f7222da7853b7056f9fc. While it may work, changing these two functions in violation of their documented behaviour for the sake of a shortcut is a hack that will spell disaster sooner or later. This is a partial revert since the commit in question also contained a hidden bugfix where it swapped the calculation order for time_rel.
* poll_wrapper: use the actual correct timeout for ppollDudemanguy2023-10-171-1/+3
| | | | It's not absolute time. Fixes #12660.
* timer: remove microsecond timer functionsDudemanguy2023-10-162-32/+0
| | | | | | | | | With the previous series of commits, all internal usage has been replaced by the nanosecond functions. There's not really any point in keeping these around anymore plus there are macros for unit conversions now so we can just axe them. It's worth noting that mpv_get_time_us() obviously still needs to work for API reasons, but we can just divide mp_time_ns() by 1000 to get the same thing.
* demux: convert cache updates to nanosecondsDudemanguy2023-10-161-3/+0
| | | | As a bonus, we can remove the awkward and horribly named MP_SECOND_US.
* timer: add convenience time unit conversion macrosDudemanguy2023-10-161-0/+10
| | | | | | | There's a lot of wild 1e6, 1000, etc. lying around in the code. A macro is much easier to read and understand at a glance. Add some helpers for this. We don't need to convert everything now but there's some simple things that can be done so they are included in this commit.
* vo_gpu/vo_gpu_next: add vulkan support for macOSder richter2023-10-144-2/+166
| | | | | | | | add support for vulkan through metal and a translation layer like MoltenVK. also add the possibility to use different render timing modes for testing. i still consider this experimental atm.
* terminal-unix: make stop/cont sighandlers pipe basedNRK2023-10-131-16/+37
| | | | | | | | | there are currently some silly data-races in the stop/cont sighandler due to the fact that the signal handler might get invoked in a different thread. this changes those sighandlers to a pipe-based approach similar to the existing "quit" sighandler.
* terminal-unix: avoid data race + simplifyNRK2023-10-131-13/+4
| | | | | | | | | | | | tio_orig and tio_orig_set are being touched inside of signal handler which might be invoked from another thread - which makes this a data race. there's no real reason to set tio_orig inside of do_activate_getch2() which is registered as a signal handler. just set it once, in terminal_init(), before any signal handlers come in play. this also allows removing the tio_orig_set variable completely.
* terminal-unix: avoid data-race on do_deactivate_getch2NRK2023-10-131-2/+3
| | | | | | | | | | | | | do_deactivate_getch2() touches some global variables which *might have* been fine if the terminal thread was the one that received the signal but AFAIK which thread will handle the signal is not well defined. in my case, when quitting mpv with CTRL+C the main thread receives the signal rather than the terminal thread and touches those globals without synchronization. caught by ThreadSanitizer. the solution is to move the do_deactivate_getch2() call outside of the signal handler.
* terminal-unix: don't spoil errno in signal handlerNRK2023-10-131-1/+6
| | | | | | | otherwise the resuming code might end up seeing a spoiled errno and end up taking unintended branches based on it. caught via ThreadSanitizer
* osdep/timer-win2: use Waitable Timer for sleepingKacper Michajłow2023-10-101-7/+31
| | | | | | | Allows higher resolution sleeps than Sleep which has milliseconds resolution. In practice Windows kernel does not really go below 0.5ms, but we don't have to limit ourselves on API side of things and do the best we can.
* timer: change mp_sleep_us to mp_sleep_nsDudemanguy2023-10-104-16/+15
| | | | | | | | | | | Linux and macOS already use nanosecond resolution for their sleep functions. It was just being converted from microseconds before. Since we have mp_time_ns now, go ahead and bump the precision here. The timer for windows uses some timeBeginPeriod thing which I'm not sure what it does really but whatever just convert the units to ms like they were doing before. There's really no reason to keep the mp_sleep_us helper around. A multiplication by 1000 is trivial and underlying OS clocks have nanosecond precision.
* vo: use mp_poll wrapper in wait_events when applicableDudemanguy2023-10-102-0/+16
| | | | | | | | | | On linux, several platforms poll for events over a fd. This has ms accuracy, but mpv's timer is in ns now so lots of precision is lost. We can use an mp_poll wrapper to use ppoll instead which takes a timespec directly with nanosecond precision. On systems without ppoll this falls back to old poll behavior. On wayland, we don't actually use this because ppoll completely messes up the event loop for some unknown reason.
* osdep: rename polldev to poll_wrapperDudemanguy2023-10-103-5/+6
| | | | | | | Originally, this was added as purely a shim for macOS. However since we want to do high resolution polling which is not neccesarily available on all platforms, making this a generic wrapper for poll functions is useful so rename it.
* msg: use nanosecond precisionDudemanguy2023-09-291-1/+1
| | | | | | | | | | The timestamps when making a log file is actually dependent on MP_START_TIME. This is a 10 microsecond offset that was added to the timer as an offset. With the nanosecond change, this unit needs to be converted as well so the offset is the same as before. After doing that, we need to change the various mp_time_us calls in msg to mp_time_ns and do the right conversion. This fixes the logs timestamps (i.e. so they aren't negative anymore).
* win32/pthread: define _POSIX_TIMERS to notify they are not supportedKacper Michajłow2023-09-291-0/+2
|
* win32/pthread: don't convert time through unrelated timerKacper Michajłow2023-09-292-18/+16
| | | | Just keep it directly as mp_time for internal implementation.
* timer: teach it about nanosecondsKacper Michajłow2023-09-295-35/+56
| | | | | Those changes will alow to change vsync base to more precise time base. In general there is no reason to truncate values returned by system.
* timer: rename mp_add_timeout to reflect what it actually doesKacper Michajłow2023-09-292-3/+3
|
* timer: remove dead codeKacper Michajłow2023-09-291-35/+0
| | | | This is not a proper way to do unit tests or whatever that was.
* timer: simplify mp_time_us_to_realtimeKacper Michajłow2023-09-291-21/+20
|
* timer: rename mp_time_us_to_timespec to reflect what it actually doesKacper Michajłow2023-09-292-4/+4
|
* options: remove ancient option fallbacks/deprecationDudemanguy2023-09-211-2/+0
| | | | | | | | | | | | | We've got an ungodly amount of OPT_REPLACED and OPT_REMOVED sitting around in the code. This is harmless, but the vast majority of these are ancient. 26f4f18c0629998a9b91e94722d166866d8b80a3 is the last commit that touched the majority of these and of course that only changed how options were declared so all of this stuff was deprecated even before that. No use in keeping these, so just delete them all. As an aside, there was actually a cocoa_opts but it had only a single option which was replaced by something else and empty otherwise. So that entire thing was just simply removed. OPT_REPLACED/OPT_REMOVED declarations that were added in 0.35 or later were kept as is.
* osdep/io: provide dlopen, etc. abstraction wrappers for windowschuck-2023-09-202-0/+79
|
* path-{darwin,unix}: save cache to subdir when using non-XDG pathDudemanguy2023-09-072-4/+12
| | | | | | | | | | mpv saves cache by default nowadays, but vo_gpu is pretty spammy and saves a bunch of files per shader. If someone is using the non-XDG config directory, this all gets dumped directly into ~/.mpv which isn't so nice. Save it to a sub directory called "cache" instead (or alternatively submit to your XDG overlords). For unfortunate reasons, macOS uses XDG_CONFIG_HOME and has the same legacy fallback mechanism, so this applies to it too.
* win32: allow heap cache optimization and memory decommitKacper Michajłow2023-09-011-0/+19
|
* win32: add BASE_SEARCH_PATH_PERMANENT to SetSearchPathModeKacper Michajłow2023-09-011-1/+2
|
* win32: don't load dynamically always available functionsKacper Michajłow2023-09-011-6/+1
| | | | They are all available on Windows 7 and newer.
* player/command: remove video-aspect propertyKacper Michajłow2023-08-311-5/+5
| | | | 4 years is enough of deprecation period.
* input: add missing windows multimedia keysChristoph Heinrich2023-08-271-1/+10
| | | | | | | | x11 and wayland had a lot of multimedia keys mapped that were missing on windows. Now the only ones they map that windows doesn't are `MP_KEY_WWW`, `MP_KEY_ZOOMIN` and `MP_KEY_ZOOMOUT`, which apparently don't have any equivalent ones on windows.
* input: add missing keypad key definesChristoph Heinrich2023-08-251-4/+4
| | | | | | | | So far all the keypad keys except for `0` and `,` mapped to the same MP_KEY_* independent of numlock state, even though different key codes are received. Now all the alternative functions map to appropriate MP_KEY_* defines, with missing ones added.
* path-unix: abort on path truncationNRK2023-08-121-14/+22
| | | | instead of silently proceeding with a truncated path.
* build: remove outdated generated directoryDudemanguy2023-07-313-2/+59
| | | | | | | | | | | | | | | | 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.
* path-win: move state directory to %LOCALAPPDATA%Kacper Michajłow2023-07-291-0/+2
| | | | %LOCALAPPDATA% is where the local application state belongs.
* path-win: add subdirectory for cacheKacper Michajłow2023-07-291-1/+1
| | | | To not polute %LOCALAPPDATA%/mpv as it may be used for other things too.
* language-posix: as a fallback, treat "C" as "en"rcombs2023-07-251-0/+11
| | | | | If we see "C" in one of the language vars we check, don't treat it as a language tag. Once we've checked everything, if we don't have any languages, but saw "C" anywhere, fall back on "en".
* terminal-unix: fix not listening on input after being foregroundedNRK2023-07-211-2/+13
| | | | | | | | | | fixes regression caused by 2e7fcc5a2 where it wouldn't receive terminal input if the process was foregrounded later on like this: $ mpv something.mp4 & $ fg ref: https://github.com/mpv-player/mpv/issues/11795
* player: set default cache dir on macOSm154k12023-07-151-3/+10
| | | | Use ~/Library/Caches/io.mpv for caches instead of ~~home.
* path-win: implement cache directoriesDudemanguy2023-07-151-0/+9
| | | | | | | | | | | | 4502522a7aee093c923e79a65e4684ea2634af30 implemented cache directories but only on linux which meant other OSes continued to save this stuff in their config directory. Since we turned on cache by default, people are getting cache files in there which is understandably causing some confusion. Let's go ahead and implement a separate cache directory for windows since there seems to be some established conventions for this already. For people using the portable_path, the cache is saved in a subdirectory within the portable_path since the idea is for that to be completely self contained.
* terminal-unix: better error detection logicNRK2023-07-081-1/+1
| | | | | | | | | | | | | | | | the reason for checking `EBADF|EINVAL` specifically is unknown. but it's clearly not working as intended since it can cause issues like #11795. instead of checking for "bad errors" check for known "good errors" where we might not want to break out. this includes: * EINTR: which can happen if read() is interrupted by some signal. * EAGAIN: which happens if a non-blocking fd would block. `tty_in` is _not_ non-blocking, so EAGAIN should never occur here. but it's added just in case that changes in the future. Fixes: https://github.com/mpv-player/mpv/issues/11795 Closes: https://github.com/mpv-player/mpv/pull/11805
* osdep: remove erroneous POLLERR emulationNRK2023-06-292-10/+3
| | | | | | | | | | | | first of all, POLLERR is supposed to be ignored in `.events` and only returned in `.revents`. secondly select()'s exceptfds does not have a 1:1 correspondence with POLLERR. thankfully, the only caller of this function (in terminal-unix) never set the POLLERR flag so the errorfds were unused anyways. so go ahead and remove it entirely instead of pretending we can emulate something that's not possible.
* osdep: add mp_get_user_langsrcombs2023-06-253-0/+171
|
* osdep: move cfstr<->cstr conversions to a new apple_utils.c filercombs2023-06-252-0/+67
|
* player: use XDG_CACHE_HOME by defaultDudemanguy2023-05-092-0/+12
| | | | | | | | | | | | This adds cache as a possible path for mpv to internally pick (~/.cache/mpv for non-darwin unix-like systems, the usual config directory for everyone else). For gpu shader cache and icc cache, controlling whether or not to write such files is done with the new --gpu-shader-cache and --icc-cache options respectively. Additionally, --cache-on-disk no longer requires explicitly setting the --cache-dir option. The old options, --cache-dir, --gpu-shader-cache-dir, and --icc-cache-dir simply set an override for the directory to save cache files. If unset, then the cache is saved in XDG_CACHE_HOME.
* player: use XDG_STATE_HOME for watch_laterDudemanguy2023-05-092-4/+21
| | | | | | | | | | | | | | | | | | 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]: https://gitlab.freedesktop.org/xdg/xdg-specs/-/commit/4f2884e16db35f2962d9b64312917c81be5cb54b
* osdep: separate out macos paths from path-unix.cDudemanguy2023-05-092-0/+67
| | | | | | | | | | | macOS really has completely different path conventions that mpv doesn't take into account and it treats it just like any other old unix-like system. This means mpv enforces certain conventions on it (like all the XDG stuff) that doesn't really apply. Since we'd like to use more of this but at the same time not distrupt mac users even more, let's just copy and paste the current code to a new file, update the build and call it a day. This way, the paths of these two platforms can more freely diverge.
* options: transition options from OPT_FLAG to OPT_BOOLChristoph Heinrich2023-02-213-7/+7
| | | | | | c78482045444c488bb7948305d583a55d17cd236 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.
* various: drop unused #include "config.h"Thomas Weißschuh2023-02-206-9/+0
| | | | | | Most sources don't need config.h. The inclusion only leads to lots of unneeded recompilation if the configuration is changed.
* osdep/io: add void to mp_penvironKacper Michajłow2023-02-021-1/+1
|
* osdep: add MP_FALLTHROUGHKacper Michajłow2023-02-021-0/+2
|
* osdep/terminal.h: Rename screen buffer controlsMia Herkt2022-12-201-2/+2
| | | | SAVE/RESTORE were a bit misleading.
* osdep/terminal: Move common esc codes to terminal.hMia Herkt2022-12-191-0/+8
|
* w32: fix typo in F23 mappingThomas Weißschuh2022-09-031-1/+1
|
* macos: add support for F13-F20 keysThomas Weißschuh2022-09-021-0/+3
|
* w32: add support for F13-F24 keysThomas Weißschuh2022-09-021-0/+4
| | | | Fixes #10595
* misc/random: add xoshiro random number implementationLeo Izen2022-08-172-2/+4
| | | | | | | Add xoshiro as a PRNG implementation instead of relying on srand() and rand() from the C standard library. This, in particular, lets us avoid platform-defined behavior with respect to threading.
* various: fix typosCœur2022-04-252-3/+3
|
* osdep/atomic: add mp_atomic_doubleAman Karmani2022-04-021-0/+2
| | | | Signed-off-by: Aman Karmani <aman@tmm1.net>
* subprocess: unblock/reset signals before running child processsfan52021-12-191-0/+21
| | | | | | | During execve() ignored and blocked signals carry over to the child process, though apparently for SIGCHLD (which the bug report was about) this is implementation-defined. fixes #9613
* libmpv: remove opengl_cb API and other deprecated symbolssfan52021-12-151-2/+1
| | | | | | 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.
* build: add meson build supportDudemanguy2021-11-141-0/+1
| | | | | | Adds support for the meson build system as well as a bit of documentation. Compatibility with the existing waf build is maintained.
* osdep: rename MP_UNREACHABLENiklas Haas2021-11-031-2/+2
| | | | | It was pointed out on IRC that the name is misleading, since the actual semantics of the macro is to assert first.
* osdep: add MP_UNREACHABLENiklas Haas2021-11-031-0/+6
| | | | | | | | | This seems to work on gcc, clang and mingw as-is, but I made it conditional on __GNUC__ just in case, even though I can't figure out which compilers we care about that don't export this define. Also replace all instances of assert(0) in the code by MP_UNREACHABLE(), which is a strict improvement.
* win32: Windows 10: timeBeginPeriod on demandAvi Halachmi (:avih)2021-09-213-1/+72
| | | | | | | | | | | | | | | | | | | | | | | | Before this commit, timeBeginPeriod(1) was set once when mpv starts, and the timers remained hi-res till mpv exits. Now we do the same as before on Windows version < 10. On Windows 10+ we now use timeBeginPeriod if needed, per timeout. To force a mode regardless of Windows version, set env MPV_HRT: - "always": the old behavior - hires timers as long as mpv runs. - "perwait": sets 1ms timer resolution if timeout <= 50ms. - "never": don't use timeBeginPeriod at all. It was observed that on Windows 10 we lose about 0.5ms accuracy of timeouts with "perwait" mode (acceptable), but otherwise it works well for continuous timeouts (one after the other) and random ones. On Windows 7 with "perwait": continous timeouts are accurate, but random timeouts (after some time without timeouts) have bad accuracy - roughly 16ms resolution instead of the requested 1ms. Windows 8 was not tested, so to err on the side of caution, we keep the legacy behavior "always" by default.
* terminal-unix: identify and ignore unknown CSI sequencesAvi Halachmi (:avih)2021-08-191-0/+11
| | | | | | | | | | | | | | | If an unknown ESC sequence is detected where an ASCII char <X> follows the ESC, mpv interprets it as ALT+<X>, which is the traditional terminal encoding of ALT+letter. However, if <X> is '[' then it's a CSI sequence which continues after the '[', and has its own termination rules (can be many chars). Previously, mpv interpreted unknown CSI sequences as (incorrect) ALT+[ followed by (incorrect) "keys" from the rest of the sequence. In this commit, if a unknown CSI sequence is detected, mpv ignores exactly the complete sequence.
* terminal-unix: fix ^Z identificationMartin Tournoij2021-07-131-1/+2
| | | | | | | | | | | | | | When using "stty susp ''" to disable sending the TSTP signal with ^Z, mpv didn't recognize ^Z correctly in the terminal: [input] No key binding found for key 'Ctrl+2'. Because ASCII 26 (^Z) and above were incorrectly considered ^<NUMBER>. This commit moves the cutoff between letters/numbers from 25 to 26 so that ^Z is now detected correctly as ^<LETTER>. Additionally, it rephrases the ^<NUMBER> formula for clarity.
* mac: add ability to toggle visibility on all workspaces from menubarEvgeny Zinoviev2021-02-211-0/+7
|
* mac: only update touch bar items when necessaryder richter2021-02-132-87/+150
| | | | | | | | | | | | | | | | the slider on the touch bar was always updated when any of the related properties changed their value. this is partially dependent on the refresh rate of the video, in the case of time-pos. too many updates to touch bar impact the render performance. to prevent this we only update the slider when necessary, when the touch bar or the touch bar item is visible. the touch bar items only need a granularity of seconds without any decimals, but the time-pos property provides a granularity with decimals. we floor those values and only update the touch bar items when we have at least a 1 second difference. we also check for the visibility of the touch bar and its items. Fixes #8477
* mac: use custom touch bar item and slider instead of a touch bar sliderder richter2021-02-131-9/+9
| | | | | | | | | | | | | the NSSliderTouchBarItem seem to be broken in a way it can't be fixed. it has constraints set by default that can't be removed and lead to warnings and render performance regressions. instead of using the preconfigured NSSliderTouchBarItem we use a custom touch bar item (NSCustomTouchBarItem) with a slider, which essential are the same. this way we can configure our constraints ourselves, which aren't needed in the first place. Fixes: #7047
* mac: fix dangling pointersder richter2021-01-131-3/+15
| | | | | | initialising UnsafeMutableRawPointer the way we did won't free those pointers and we get dangling pointers. explicitly define a scope those pointers are alive and auto freed.
* mac: drop build support for swift versions earlier than version 4.1der richter2021-01-131-27/+0
| | | | | | | | | | | | this drops support for swift <4.1 and with this support for xcode <=9.2. this was the last setup that is officially working on macOS 10.12. our old legacy build macOS 10.12 + xcode 9.2 is replaced by macOS 10.13 + xcode 9.4.1 with swift 4.1. the macOS 10.13 + xcode 10.1 VM is replaced by the latest macOS 10.14 + xcode 11.3.1 VM. this is the oldest version officially supported by Apple. this is in preparations for the following commit.
* mac: fix usage of temporary pointersder richter2021-01-132-29/+57
| | | | | | | | | | | the pointer used to initialise the respective structs is only guaranteed to be alive within this constructor. the struct itself is used later and the data it points to, is not guaranteed to be the same. to fix this we define a scope that pointer is definitely valid and use it within this scope. a helper function was added to get the pointers for several data at once. otherwise we would need to nest withUnsafeMutableBytes several times, which would make it hard to read.
* mac: use visible frame rectangle for window geometry calculationder richter2020-12-192-0/+8
| | | | | | | | | | | | | currently we use the whole screen rectangle to calculate the window geometry. this doesn't take the menu bar or the Dock into account. by default use the visible screen rectangle instead. this is also a change in behaviour, since the window can't be placed outside of this rectangle anymore. also add an option to change to the old behaviour, because it can still be useful in certain cases, like placing the window directly underneath the menu bar when used a desktop background. Fixes #8272
* terminal: process input when foregroundedGuido Cella2020-11-261-1/+9
| | | | | | | | | | When mpv is in the background because it was started with `mpv foo.mp3 &`, or the user did ctrl+z bg, and is then brought to the foreground with fg, it buffers input until you press enter. This makes it accept input almost immediately. Having a short interval isn't important, since input is buffered until the next loop iteration. Closes #8120.
* osdep/terminal: Add function to get terminal pixel dimensionsShreesh Adiga2020-11-224-0/+24
|
* path: do not use old_home for win32 exe dirwm42020-11-161-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Apparently mpv supports loading config files from the same directory as the mpv.exe. This is a fallback of some sort. It used the old_home mechanism. I want to add a warning if old_home exists, but that would always show the warning on win32. Obviously we don't want that. Add a separate exe_dir entry to deal with that. Untested, but probably works. Mistakenly reverted as part of the default configuration directory location switch-back in aa18a8e1cde663caeabd93af7d57a745c1a76af6. Separation of the mpv executable directory from old_path is a good change now that we warn about the old_config directory also existing. Fixes #8232 Fixes #8244 Fixes #8262
* Revert "path: switch back to using non-XDG config dir by default"Philip Langdale2020-10-161-7/+7
| | | | This reverts commit 269f0e743e5634691f0c9d5b1b8a4bb68eedbbd0.
* Revert "path: do not use old_home for win32 exe dir"Philip Langdale2020-10-161-1/+1
| | | | This reverts commit c3694f0acb7f71daac7606fafbadcb7b500ca35e.
* terminal: fix segfault when backgroundingwm42020-09-211-2/+4
| | | | | | | | | In the recent terminal commit, I "compressed" the read() error handling, and messed it up. The return value could be -1 for other non-fatal errors (such as EIO when trying to read while backgrounded), which resulted in buf.len getting messed up. Fixes: 602384348e718c77
* mac: add an option to change the App activation policyder richter2020-09-202-0/+3
| | | | useful to hide the app icon in the Dock if necessary.
* terminal: attempt to handle the ESC keywm42020-09-171-24/+22
| | | | | | | | | | | | | | | | | | Due to Unix being legacy garbage, it's not possible to safely detect the ESC key on terminal. The key sequences are ambiguous. The code for the ESC key also starts the sequences for other special keys. Until now, you needed to hit ESC twice for it to be recognized. Attempt to handle this better by using a timeout to detect the key. If ESC is in the input buffer, but nothing else arrived after a timeout, assume it's the ESC key. I think this is the method vim uses. Currently, the timeout is set at 100ms. This is hardcoded and cannot be changed. It's possible that this causes problems on slow ssh connections or so. I'm not sure what exactly happens if you manage to get ESC + another normal key into the input buffer. If it's a known sequence, it will be matched and interpreted as such. If not, it'll probably be discarded.
* terminal-unix: attempt to support more CTRLwm42020-09-101-6/+14
| | | | | | | Hysterically stupid inconsistent legacy garbage from the 70ies or maybe even 60ies. What the fuck. I fucking hate computers so much. Fixes: #8072
* mac: use config cache und wakeup for mac option runtime changesder richter2020-08-222-18/+24
| | | | | | | | remove the libmpv observer for the macOS specific options and use a config cache + change callback for runtime changes. this is also a preparation for new backends and generalises even more, since libmpv functions can't and shouldn't be used in usual vo backends. for feature parity the config cache is used.
* cocoa-cb: generalisation of backend independent partsder richter2020-08-224-20/+14
| | | | | | | | | | | | | move all backend independent code parts in their own folder and files, to simplify adding new backends. the goal is to only extend one class and add the backend dependent parts there. usually only the (un)init, config and related parts need to be implemented per backend. furthermore all needed windowing and related events are propagated and can be overwritten. the other backend dependent part is usually the surface for rendering, for example the opengl oder metal layer. in the best case a new backend can be added with only a few hundred lines.
* win32: scripting utils.get_env_list(): use UTF-8Avi Halachmi (:avih)2020-08-162-0/+15
| | | | | | | | | | | | | | | | lua/js utils.get_env_list() uses `environ' which was ANSI, thus it broke any unicode names/values. mpv already has an internal utf8_environ for win32, but it's used only at the getenv(..) wrapper and not exposed in itself, and also it has lazy initialization - on first getenv() call. Now `environ' maps to a function which ensures initialization while keeping it an l-value (like posix expects). The cost of this fuglyness is that files should include osdep/io.h (which now declares environ as extern) rather than declaring it themselves, or else the build will break on mingw.
* command: extend subprocess command stdin, change behaviorwm42020-08-162-4/+49
| | | | | | | | | | | | | | | Make it possible to feed a string to stdin of a subprocess. Out of laziness, it can't be an arbitrary byte string. (Would require adding an option type that takes in a Lua byte string.) Do not set stdin of a subprocess to fd 0 (i.e. mpv's stdin) anymore, because it makes things more consistent. Enabling stdin didn't make too much sense in the first place, so this behavior change seems justifiable. win32 support missing. Fixes: #8003
* win32: request the UTF-8 code page for Windows APIsJames Ross-Gowan2020-08-081-0/+1
| | | | | | | | | | | | | | This sets the activeCodePage property in the manifest, which forces the ANSI code page to be UTF-8 in Windows 10 1903 and up. It shouldn't make a difference for mpv itself, since mpv already uses the wide-char APIs for most functions, however some of mpv's dependencies, such as Lua, rely on the ANSI codepage. Hence this change enables support for Unicode file names in Lua's I/O library. Thanks @avih for finding this property. See: https://docs.microsoft.com/en-us/windows/uwp/design/globalizing/use-utf8-code-page
* subprocess-win: update to mp_subprocess2James Ross-Gowan2020-07-204-140/+398
| | | | | | | | | | | | | | | | | | | This fixes the "run" and "subprocess" commands on Windows, including youtube-dl support. Unix-like FD inheritance is emulated on Windows by using an undocumented data structure[1] that gets passed to the newly created process in STARTUPINFO.lpReserved2. It consists of two sparse arrays listing the HANDLE and internal CRT flags corresponding to each FD. This structure is used and understood primarily by MSVCRT, but there are other runtimes and frameworks that can write it, like libuv. The code for creating asynchronous "anonymous" pipes in Windows has been enhanced and moved into windows_utils.c. This is mainly an artifact of an unfinished future change to support anonymous IPC clients in Windows. Right now, it's still only used in subprocess-win.c [1]: https://www.catch22.net/tuts/undocumented-createprocess
* command: extend subprocess commandwm42020-07-203-116/+3
| | | | | | | | | | | | | | | | | | | | Add env and detach arguments. This means the command.c code must use the "new" mp_subprocess2(). So also take this as an opportunity to clean up. win32 support gets broken by it, because it never made the switch to the newer function. The new detach parameter makes the "run" command fully redundant, but I guess we'll keep it for simplicity. But change its implementation to use mp_subprocess2() (couldn't do this earlier, because win32). Privately, I'm going to use the "env" argument to add a key binding that starts a shell with a FILE environment variable set to the currently playing file, so this is very useful to me. Note: breaks windows, so for example youtube-dl on windows will not work anymore. mp_subprocess2() has to be implemented. The old functions are gone, and subprocess-win.c is not built anymore. It will probably work on Cygwin.
* path: do not use old_home for win32 exe dirwm42020-06-251-1/+1
| | | | | | | | | | | | | Apparently mpv supports loading config files from the same directory as the mpv.exe. This is a fallback of some sort. It used the old_home mechanism. I want to add a warning if old_home exists, but that would always show the warning on win32. Obviously we don't want that. Add a separate exe_dir entry to deal with that. Untested, but probably works.
* path: switch back to using non-XDG config dir by defaultwm42020-06-251-7/+7
| | | | | | | | | | | | | | | | | | | | | XDG is stupid, so change back to the standard behavior. Unfortunately, most users will now have the XDG one, so we will still need to load this. (This is exactly the same problem as when XDG support was introduced, just the other way around). This should not affect any normal users. Hopefully I tested this well enough; my intention is not to torment miserable XDG fans; they can keep using their config dir if they want it. This changes behavior in two cases: - new users (now creates ~/.mpv/ instead of ~/.config/mpv/) - users which have both directories The latter case will behave subtly or obviously different, not sure. Just fix your shit. Extend the manpage with all the messy details, as far as I could reverse engineer them from the code.
* build: change filenames of generated fileswm42020-06-042-2/+2
| | | | Force them into a more consistent naming schema.
* terminal-win: handle 'Change Window Title' OSC sequenceJames Ross-Gowan2020-05-291-99/+131
| | | | | | | | | | | | | | | | | This should make --term-title work in Windows 8.1 and below. OSC sequences are defined in ECMA-48. The 'Change Window Title' command, as far as I can tell, is a de-facto standard defined by xterm[1]. In either case, this code is probably still not standards-compliant. This also changes mp_write_console_ansi to convert to UTF-16 before parsing control sequences, because that made it easier to pass the OSC param to SetConsoleTitleW. I think it's also more correct to do it this way, even though it doesn't really matter much for our limited terminal parsing. As a side-effect of this, mp_write_console_ansi no longer mutates its argument. [1]: https://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h3-Operating-System-Commands
* osdep: remove confstr() fallback for subprocess spawningsfan52020-05-251-7/+2
| | | | | It doesn't exist on bionic (Android) and accurately emulating execvpe's behaviour isn't all that important.
* osdep: remove posix_spawn() helpers and wrapperswm42020-05-154-145/+1
| | | | See previous commit. Farewell, useless shitty POSIX function.
* subprocess: replace posix_spawnp() with fork()wm42020-05-151-17/+118
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This code runs posix_spawnp() within a fork() in some cases, in order to "disown" processes which are meant as being started detached. But posix_spawnp() is not marked as async-signal-safe, so what we do is not allowed. It could for example cause deadlocks, depending on implementation and luck at runtime. Turns out posix_spawnp() is useless crap. Replace it with "classic" fork() to ensure correctness. We could probably use another mechanism to start a process "disowned" than doing a double-fork(). The only problem with "disowning" a process is calling setsid() (which posix_spawnp() didn't support, but maybe will in newer revisions), and removing as as parent from the child process (the double-fork() will make PID 1 the parent). But there is no good way to either remove us as parent, or to "reap" the PID in a way that is safe and less of a mess than the current code. This is because POSIX/UNIX is a miserable heap of shit. (Less shit than "alternatives" like win32, no doubt.) Because POSIX/UNIX is a miserable heap of shit, execvp() is also not specified as async-signal-safe. It's funny how you can run a full fledged HTTP server in an async-signal-safe context, but not start a shitty damn process. Unix is really, really, really extremely bad at this process management stuff. So we reimplement execvp() in an async-signal-safe way. The new code assumes that CLOEXEC is a thing. Since POSIX/UNIX is such a heap of shit, O_CLOEXEC and FD_CLOEXEC were (probably) added at different times, but both must be present. io.h defines them to 0 if they don't exist, and in this case the code will error out at runtime. Surely we could do without CLOEXEC via fallback, but I'll do that only if at least 1 bug is reported wrt. this issue. The idea how to report exec() failure or success is from musl. The way as_execvpe() is also inspired by musl (for example, the list of error codes that should make it fail is the same as in musl's code).
* w32_common: Support HiDPI on WindowsRealDolos2020-05-081-2/+3
|
* win32: SGR emulation: minor fixup on invalid sequenceAvi Halachmi (:avih)2020-04-241-2/+5
| | | | | | | | This fixes two issues with invalid value after 38/48: - It was not detected correctly and ended up skipping 4 instead of 0. - The intent was to skip 0, but it's better to skip the rest. Behavior with valid 2/5 after 38/48 was correct and is unaffected.
* osdep/terminal-win: native VT: report exact widthAvi Halachmi (:avih)2020-04-231-2/+3
| | | | | The narrower-by-1 width is not required with a native VT console because the wrapping behavior is the same as on *nix on such case.
* win32: native VT: logic fixupAvi Halachmi (:avih)2020-04-231-2/+2
| | | | | We want basemode unmodified so that we can use it if setting VT mode fails.
* win32: use windows 10 native virtual-terminal if availableAvi Halachmi (:avih)2020-04-231-2/+34
| | | | | | | | This enables native and more complete escape-sequence handling instead of our emulation. E.g. it supports 256/true colors, and more. This should get enabled automatically on Windows 10 build 16257 (August 2017) or later.
* win32: improve console SGR escape sequence emulationAvi Halachmi (:avih)2020-04-231-11/+50
| | | | | | | | | | | | | | | Previously an SGR sequence was emulated correctly only if: - It had exactly 1 or 2 numeric values (not 0). - Only reset, bold, and foreground colors were supported. - 256/true colors were not skipped correctly with their sub-values. Now it supports the same as before, plus: - 0-16 (inclusive) numeric values, e.g. \e[m now resets correctly. - Supports also codes for background color, reverse, underline* . - Supports also codes for default intensity/fg/bg/reverse/underline. - 256/true colors are recognized and skipped gracefully. * Reverse/underline seem to work only on windows 10.
* build: restore BSD thread names after 9f461b85bfa3Jan Beich2020-04-231-0/+4
| | | | | | | | | | | | | | On FreeBSD non-POSIX threading functions are in a separate header. DragonFly and OpenBSD adopted FreeBSD header and extensions. ../test.c:3:3: error: implicit declaration of function 'pthread_set_name_np' is invalid in C99 [-Werror,-Wimplicit-function-declaration] { pthread_set_name_np(pthread_self(), "ducks"); return 0; } ^ ../osdep/threads.c:47:5: error: implicit declaration of function 'pthread_set_name_np' is invalid in C99 [-Werror,-Wimplicit-function-declaration] pthread_set_name_np(pthread_self(), tname); ^ Signed-off-by: Jan Beich <jbeich@FreeBSD.org>
* terminal-unix: add key_entry defs for DECCKM modeMurray Campbell2020-04-151-0/+4
| | | | | | | | zsh often sets DECCKM (i.e. Cursor Key Mode) meaning the arrow keys send `SS3 A/B/C/D` instead of `CSI A/B/C/D`. Add `key_entry` definitions for this alongside the existing DECCKM Reset definitions.
* win32: pthread: define PTHREAD_MUTEX_ERRORCHECKwm42020-03-191-0/+1
| | | | mpv uses it now. Doesn't need to do anything.
* osdep: add a pthread debugging wrapperwm42020-03-182-1/+82
| | | | | | | | | | | | | | | | | | | | Because pthread failures are virtually undebuggable (which sure is pretty strange, given all these heavy instrumentation tools these days). Of course it affects only files which include osdep/threads.h. I'm departing from the usual way to add symbols with config.h and using "#if", and defining it on the compiler command line + "#ifdef" because I don't want to include config.h from a header (which would be necessary in this case) to keep things slightly cleaner. Maybe this is misguided, but still. This would have been easier if mpv defined its own wrappers for all thread functions. But we don't (which to be honest is probably better than e.g. going crazy like VLC and essentially reimplementing everything). This seems to be a good compromise. Since it's off by default and basically a developer tool, the minor undefined behavior (redefining reserved symbols) isn't much of an issue.
* options: change option macros and all option declarationswm42020-03-181-24/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change all OPT_* macros such that they don't define the entire m_option initializer, and instead expand only to a part of it, which sets certain fields. This requires changing almost every option declaration, because they all use these macros. A declaration now always starts with {"name", ... followed by designated initializers only (possibly wrapped in macros). The OPT_* macros now initialize the .offset and .type fields only, sometimes also .priv and others. I think this change makes the option macros less tricky. The old code had to stuff everything into macro arguments (and attempted to allow setting arbitrary fields by letting the user pass designated initializers in the vararg parts). Some of this was made messy due to C99 and C11 not allowing 0-sized varargs with ',' removal. It's also possible that this change is pointless, other than cosmetic preferences. Not too happy about some things. For example, the OPT_CHOICE() indentation I applied looks a bit ugly. Much of this change was done with regex search&replace, but some places required manual editing. In particular, code in "obscure" areas (which I didn't include in compilation) might be broken now. In wayland_common.c the author of some option declarations confused the flags parameter with the default value (though the default value was also properly set below). I fixed this with this change.
* options: introduce bool option type, use it for --fullscreenwm42020-03-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The option code is very old and was added to MPlayer in the early 2000s, when C99 was still new. MPlayer did not use the "bool" type anywhere,l and the logical option equivalent to bool, the "flag" option type, used int, with the convention that only the values 0 and 1 are allowed. mpv may have hammered many, many additional tentacles to the option code, but some of the basics never changed, and m_option_type_flag still uses int. This seems a bit weird, since mpv uses bool for booleans. So finally introduce an m_option_type_bool. To avoid duplicating too much code, change the flag code to bool, and "reimplement" m_option_type_flag on top of m_option_type_bool. As a "demonstration", change the --fullscreen option to this new type. Ideally, all options would be changed too bool, and m_option_type_flag would be removed. But that is a lot of monotonous thankless work, so I'm not doing it, and making it a painful years long transition. At the same time, I'm introducing a new concept for option declarations. Instead of OPT_BOOL(), which define the full m_option struct contents, there's OPTF_BOOL(), which only takes the option field name itself. The name is provided via a normal struct field initializer. Other fields (such as flags) can be provided via designated initializers. The advantage of this is that we don't need tons of nested vararg macros. We also don't need to deal with 0-sized varargs being a pain (and in fact they are not a thing in standard C99 and probably C11). There is no need to provide a mandatory flags argument either, which is the reason why so many OPT_ macros are used with a "0" argument. (The flag argument seems to confuse other developers; they either don't immediately recognize what it is, and sometimes it's supposed to be the option's default value.) Not having to mess with the flag argument in such option macros is also a reason for the removal of M_OPT_RANGE etc., for the better or worse. The only place that special-cased the _flag option type was in command.c; change it to use something effectively very similar that automatically includes the new _bool option type. Everything else should be transparent to the change. The fullscreen option change should be transparent too, as C99 bool is basically an integer type that is clamped to 0/1 (except in Swift, Swift sucks).
* atomic: add atomic_exchange_explicit() fallbackwm42020-03-051-2/+7
| | | | | Apparently I want to use this in a later commit. Untested, because this is a pre-C11 fallback, and I only test with real <stdatomic.h>.
* mac, cocoa: fix UI updates on none main queue threadsder richter2020-02-221-3/+7
| | | | | | injecting the Apple Main Thread Checker via DYLD_INSERT_LIBRARIES=libMainThreadChecker.dylib identified several problems that needed fixing.
* mac: fix media key support for libmpv usersder richter2020-02-225-43/+33
| | | | | | | | this basically moves the remote command center to our mac events instead of keeping it our Application, which is only available when started from mpv itself. also make it independent of the NSApplication. this also prevents a runtime crash
* scripting: add a way to run sub processes as "scripts"wm42020-02-191-0/+6
| | | | | | | | | | This is just a more convenient way to start IPC client scripts per mpv instance. Does not work on Windows, although it could if the subprocess and IPC parts are implemented (and I guess .exe/.bat suffixes are required). Also untested whether it builds on Windows. A lot of other things are untested too, so don't complain.
* subprocess: implement proper detached processes on POSIXwm42020-02-163-10/+66
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The previous method for this sucked: for every launched detached process, it started a thread, which then would leak if the launched process didn't end before the player uninitialized. This was very racy (although I bet the race condition wouldn't trigger in a 100 years), and wasteful (threads aren't a cheap resource). Implement it for POSIX directly. posix_spawn() has no direct support for this, so we need to do it ourselves with fork(). We could probably do it without fork(), and attempt to collect the PID in another thread. But then we'd either have a waiting thread again, or we'd need to do an unsafe waitpid(-1, ...) call. (POSIX process management sucks so badly, how did they even manage this. Hopefully I'm just missing something, but I'm not.) So now we depend on both posix_spawn() _and_ fork(), isn't it fun? Also call setsid(), to essentially detach the child process from the terminal. (Otherwise it can receive various signals from the terminal, which is probably not what you want.) posix_spawn() adds POSIX_SPAWN_SETSID in newer POSIX releases, but we don't want to rely on this yet. The posix_spawnp() call is duplicated, but this is better than somehow trying to unify the code paths. Only somewhat tested, so enjoy the bugs.
* subprocess: change to a fancier APIwm42020-02-163-83/+185
| | | | | | | | | | | | | | Introduce mp_subprocess() and related definitions. This is a bit more flexible than the old stuff. This may or may not be used for a more complicated feature that involves starting processes, and which would require more control. Only port subprocess-posix.c to this API. The player still uses the "old" API, so for win32 and dummy implementations, the new API is simply not available, while for POSIX, the old APIs are emulated on top of the new one. I'm hoping the win32 code can be ported as well, so the ifdefs in subprocess.c can be dropped, and the player can (if convenient or needed) use the new API.
* mac: activate logging when started from the bundleder richter2020-02-081-4/+41
| | | | | | | | | | this creates a default log for the last mpv run when started from the bundle. that way one can get a log of what happened even after an issue occurred. also add a menu entry under Help to show the current log, but only when the bundle is used. Fixes #7396 Fixes #2547
* mac: remove stdout and stderr redirect for loggingder richter2020-02-081-11/+0
| | | | | | | this was kinda useless anyway since the bundle was started with terminal=no and no logging was done anyway. Fixes #1590
* mac: change Report Issue menu link to the new choose template pageder richter2020-01-261-1/+1
|
* cocoa-cb: add support for forcing the dedicated GPU for renderingder richter2020-01-262-0/+4
| | | | | | | | this deprecates the old cocoa backend only option and moves it to the general macos ones. add support for the new option in the cocoa-cb layer creation and use the new option in the olde cocoa backend. Fixes #7272
* mac: report playback state to the MediaPlayer Command Centerder richter2020-01-262-11/+48
| | | | | | some system logic for the global media key events depends on the right playback state. set the state properly to prevent more breakages in the future.
* mac: add support for PLAYONLY and PAUSEONLY key codes to MediaPlayerder richter2020-01-261-3/+3
| | | | Fixes #7365
* build: fix build with disabled swift and Media Playerder richter2019-12-231-1/+2
| | | | | | | | | | | | | | when swift is disabled some headers are not included. one of them is the options/options.h header that is needed for the vo_sub_opts struct. we include it to fix the build without swift. the second problem is the build time check for the macOS 10.12.2 features or more specific the Media Player support. since it is a swift feature we can not use it when swift is disabled. add a separate Media Player check that also depends on swift and use that new preprocessor variable as a build time check instead. Fixes #7282
* mac: replace old event tap for media key support with MediaPlayerder richter2019-12-156-126/+184
| | | | | | | | | | | | | | | the old event tap has several problems, like no proper priority support or having to set accessibility permissions for mpv or the terminal. it is now replaced by the new MediaPlayer which has proper priority support and isn't as greedy as previously. this only includes Media Key support and not any of the other features included in the MediaPlayer framework, like proper Now Playing data (only set dummy data for now). this is only available on macOS 10.12.2 and higher. also removes some unnecessary redefines. Fixes #6389
* mac: remove Apple Remote supportder richter2019-12-155-2481/+1
| | | | | | the Apple Remote has long been deprecated and abandoned by Apple. current macs don't come with support for it anymore. support might be re-added with the next commit.
* cocoa-cb: fix freeing of macos_opts config groupder richter2019-12-151-5/+5
| | | | | | | | | using the MPContext as ta parent was a bad idea and shouldn't be done in any circumstances there because it only supposed to be for internal usage. this had the undesired effect that the options group was freed but still used since the MPContext is freed afterwards. instead manually free options group.
* cocoa-cb: update and add more options to use new options handlingder richter2019-12-151-0/+5
| | | | | this updates and add the maximized, minimized, keepaspect and ontop options to use the new options handling
* cocoa-cb: use m_config_cache and new VOCTRL for option handlingder richter2019-12-154-5/+49
| | | | | | | | this removes the direct access of the mp_vo_opts stuct via the vo struct and replaces it with the m_config_cache usage. this updates the fullscreen and window-minimized property via m_config_cache_write_opt instead of the old mechanism via VOCTRL and event flagging. also use the new VOCTRL_VO_OPTS_CHANGED event for fullscreen and border changes.
* atomic: add mp_atomic_uint64wm42019-11-291-0/+2
|
* player: Optionally validate st_mtime when restoring playback stateChris Down2019-11-201-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I often watch sporting events. On many occasions I get files with the same filename for each session. For example, for F1 I might have the following directory structure: F1/ FP1.mkv FP2.mkv FP3.mkv Qualification.mkv Race.mkv Since usually one simply watches one race after the other, I usually just rsync the new event's files over the old ones, so, for example, Race.mkv will be replaced from the file for the last event with the file from the new event. One problem with this is that I like to use --resume-playback for other kinds of media, so I have it on by default. That works great for, say, a movie, but doesn't work so well with this scheme, because you can trivially forget to pass --no-resume-playback on the command line and end up 2 hours in, watching spoilers as the race results scroll down the screen :-) This patch adds a new option, --resume-playback-check-mtime, which validates that the file's mtime hasn't changed since the watch_later configuration was saved. It does this by setting the watch_later configuration to have the same mtime as the file after it is saved. Switching back and forth between checking mtime and not checking mtime works fine, as we only choose whether to compare based on it, but we update the watch_later configuration mtime regardless of its value.
* cocoa-cb: remove get_property_* usages and split up mpv helperder richter2019-10-065-110/+156
| | | | | | | | | | all the get_property_* usages were removed because in some circumstances they can lead to deadlocks. they were replaced by accessing the vo and mp_vo_opts structs directly, like on other vos. additionally the mpv helper was split into a mpv and libmpv helper, to differentiate between private and public APIs and for future changes like a macOS vulkan context for vo=gpu.
* cocoa-cb: add support for 10bit opengl renderingder richter2019-09-264-1/+20
| | | | | | | this will request a 16bit half-float framebuffer instead if a 8bit integer framebuffer. Fixes #3613
* mac: add Open Playlist menu bar itemAkemi2019-09-231-0/+17
|
* stream_libarchive: Always use LC_CTYPE_MASK for libarchiveJames Hilliard2019-09-211-1/+0
| | | | | | Using LC_ALL_MASK is unnecessary and unreliable on some systems. Signed-off-by: James Hilliard <james.hilliard1@gmail.com>
* io: remove Windows tmpfile() emulationwm42019-09-192-37/+0
| | | | | | | | | | | | Unused now. The old stream cache used it, but it was removed. On a side note, the demuxer cache uses mp_mkostemps(). It looks like our Windows open() emulation handles this correctly by using CREATE_NEW, so no functionality gets lost by the "new" approach. On the other hand, the demuxer cache does not set FILE_FLAG_DELETE_ON_CLOSE, but instead tries to delete the file after opening (POSIX style), which probably won't work on Windows. But I'm not sure how to make it use the DELETE_ON_CLOSE flag, so whatever.
* win32: remove -municode from mpv binarywm42019-09-191-7/+5
| | | | | | | | | | | | | If this is used, the runtime expects that wmain() instead of main() is defined. This caused me severe problems in a certain now irrelevant case. I think it's a good idea to avoid this special case. We can just use main() and call GetCommandLineW() instead. This function returns a single string, so use CommandLineToArgvW() to split it, and hope it has the same semantics. Should this ever return NULL, hope that it leaves argc at 0. Untested, I think.
* osdep: add mkostemps() emulationwm42019-09-192-2/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Supposed to follow the standard function. The standard function is not standard, but a GNU extension. Adding some ifdef mess is pointless too - it has no advantages other than having a mess, and not spotting implementation bugs in the emulation due to running it only on "obscure" platforms (like Windows, so most computers actually, except the developer's platform). There is mkstemp(), which at least is in POSIX 2008. But it's 100% useless, except in some obscure cases: it doesn't set O_CLOEXEC, nor can you pass it to it. Without O_CLOEXEC, we'd leak the temporary file to all child processes. (The fact that the file, which is expected to reach double or tripple digit GB sizes, will be deleted only once all processes unreference the FD, makes this sort of a big deal. You could ftruncate() it, but that doesn't fix all the other problems.) Why did POSIX standardize mkstemp() and O_CLOEXEC apparently at the same time, but provided no way to pass O_CLOEXEC to mkstemp()? With the introduction of O_CLOEXEC, they acknowledged that there's a need to atomically set the FD_CLOEXEC flag when creating file descriptors. (FD_CLOEXEC was standard before that, but setting it with fcntl() is racy.) You're much more likely to need a temp file that is CLOEXEC rather than the opposite, and even if they were somehow opposed to CLOEXEC by default (such as for compat. reasons), surely POSIX could have standardized mkostemp() too or instead. And then there's the fact that this whole O_CLOEXEC mess is stupid. Surely there would have been a better way to handle this, instead of requiring adding O_CLOEXEC to almost ALL instances of open() in all code that has been written ever. The justification for this is that the historic default was wrong, and you can't change it (e.g. this won't work: changing the behavior of exec() and not inherit the FD to the child process, unless a hypothetical O_KEEP_EXEC flag is set). But on the other hand, surely you could have introduced an exec() variant which does close all FDs, except a whitelist of FDs passed to it. Let's call it execve2(). In fact, I'm going to argue that exec() call sites are the most aware of whether (and which) FDs to inherit. Some programs even tried to explicitly iterate over all opened FDs and explicitly close "unwanted" FDs (which of course was problematic for other reasons), and such an execve2() call would have been the ideal solution. Maybe this proposed solution would have had problems too. But surely revisiting and reviewing every exec*() call would have been simpler than reviewing every open() call. And more importantly, having to extend every damn library function that either calls open() or creates FDs in some other way, like mkstemp(). What argument are there going to be against this? That there will be library code that can't keep working correctly with processes that use the "old" exec? Well, what about all my legacy library code that uses open() incorrectly, and that will break no matter what? Well, I'm not going to claim that I can come up with better solutions than POSIX (generally or in this case), but this situation is ABSOLUTELY ATROCIOUS. It makes win32 programming look attractive compared to POSIX, that standard pandering to dead people from the past. (Note: not trying to insult dead people.) I'm not sure what POSIX is even doing. Anything useful? Doesn't look like it to me. Are they paid? Why? They didn't even fix the locale mess, nor do they intend to. I bet they're proud of discussing compatibility to 70ies code day in and day out iwtohut ever producing anything useful. What a load of crap. They seriously got to do better than this. Oh, and my wrapper is probably buggy. Fortunately that doesn't matter. Also I'm dumping this into io.h. Originally, io.h was just supposed to replace broken implementation of standard functions by MinGW (and then by Android), but whatever, just give a dumping ground for shit code.
* cocoa-cb: migrate to swift 5 with swift 4 fallbackder richter2019-07-213-9/+74
| | | | | | | | | | | | | this migrates our current swift code to version 5 and 4. building is support from 10.12.6 and xcode 9.1 onwards. dynamic linking is the new default, since Apple removed static libs from their new toolchains and it's the recommended way. additionally the found macOS SDK version is printed since it's an important information for finding possible errors now. Fixes #6470
* cocoa-cb: conditional compilation for Dark Mode and Material featuresder richter2019-07-211-0/+24
| | | | Fixes #6621
* win32-console-wrapper: silence missing prototype warningsJames Ross-Gowan2019-05-101-2/+4
|
* libarchive: add fallback for systems without C.UTF-8dudemanguy2019-05-041-0/+1
|
* cocoa-cb: remove all force unwrappings of optionalsder richter2019-04-252-25/+37
| | | | | | the force unwrapping of optionals caused many unpredictable segfaults instead of gracefully exiting or falling back. besides that, it is bad practice and the code is a lot more stable now.
* cocoa-cb: add support for custom colored title barder richter2019-04-024-0/+18
|
* cocoa-cb: refactor title bar stylingder richter2019-04-023-3/+20
| | | | | | | | | | | | | half of the materials we used were deprecated with macOS 10.14, broken and not supported by run time changes of the macOS theme. furthermore our styling names were completely inconsistent with the actually look since macOS 10.14, eg ultradark got a lot brighter and couldn't be considered ultradark anymore. i decided to drop the old option --macos-title-bar-style and rework the whole mechanism to allow more freedom. now materials and appearance can be set separately. even if apple changes the look or semantics in the future the new options can be easily adapted.
* cocoa-cb: synchronise the flush with the renderAkemi2019-04-021-1/+4
| | | | | | | this could lead to a crash on deinit when flush was called while the opengl state was cleaned up. Fixes #6323
* cocoa-cb: wakeup vo when new events are availableAkemi2019-04-021-0/+1
| | | | | | | new events were added but not fetched by the vo, because we didn't signal the vo that new events were available. actually wakeup the vo when new events are available.
* macosx_events: fix crash when shutting down during window animationsRodger Combs2019-03-131-1/+3
|
* Merge branch 'master' into pr6360Jan Ekström2019-03-113-1/+67
|\ | | | | | | | | | | Manual changes done: * Merged the interface-changes under the already master'd changes. * Moved the hwdec-related option changes to video/decode/vd_lavc.c.
| * cocoa-cb: add support for VOCTRL_GET_DISPLAY_NAMESAkemi2019-02-102-0/+38
| |
| * cocoa-cb: use Swift Extensions for convenienceAkemi2019-02-101-0/+28
| | | | | | | | preparations for the following commit.
| * mac: add missing semicolon to macosx_compat.hKen2019-01-261-1/+1
| | | | | | | | fixes build on older systems
* | demux, stream: readd cache-speed in some other formwm42018-12-061-0/+3
| | | | | | | | it's more like an input speed rather than a cache speed, but who cares.
* | Merge commit '559a400ac36e75a8d73ba263fd7fa6736df1c2da' into ↵Anton Kindestam2018-12-055-17/+8
|\ \ | |/ |/| | | | | | | wm4-commits--merge-edition This bumps libmpv version to 1.103
| * terminal-unix: stop trying to read when terminal disappearswm42018-05-241-2/+4
| | | | | | | | | | | | | | | | Avoids 100% CPU usage due to terminal code retrying read(). Seems like this was "forgotten" (or there was somehow the assumption poll() would not signal POLLIN anymore). Fixes #5842.
| * osdep: add portable C11-like alignof() macrowm42018-05-241-0/+5
| |
| * timer: remove an unused helper functionwm42018-05-242-16/+0
| | | | | | | | It's also dumb.
| * misc: move mp_cancel from stream.c to thread_tools.cwm42018-05-242-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | It seems a bit inappropriate to have dumped this into stream.c, even if it's roughly speaking its main user. At least it made its way somewhat unfortunately to other components not related to the stream or demuxer layer at all. I'm too greedy to give this weird helper its own file, so dump it into thread_tools.c. Probably a somewhat pointless change.
* | cocoa-cb: use libmpv's advanced rendering control and timingAkemi2018-11-131-2/+22
| | | | | | | | | | | | | | | | this adds support for GPU rendered screenshots, DR (theoretically) and possible other advanced functions in the future that need to be executed from the rendering thread. additionally frames that would be off screen or not be displayed when on screen are being dropped now.
* | {mac,cocoa}: trim trailing null out of macosx_icon when loading itRodger Combs2018-10-021-1/+2
| | | | | | | | | | | | This prevents crashes when loading the application icon image. Suggested-by: Akemi <der.richter@gmx.de>
* | mac: fix crash if we can't get an event tapRodger Combs2018-10-021-9/+12
| | | | | | | | | | | | | | | | without assistive-device permissions the event tap can't be create on 10.14 any more which lead to an assertion. System Preferences > Security & Privacy > Privacy > Accessibility and add mpv or your terminal App to the list.
* | cocoa-cb: add Apple Software Renderer supportAkemi2018-09-302-0/+4
| | | | | | | | | | | | by default the pixel format creation falls back to software renderer when everything fails. this is mostly needed for VMs. additionally one can directly request an sw renderer or exclude it entirely.
* | cocoa-cb: move macOS option retrieval to the earliest point possibleAkemi2018-09-301-0/+6
| | | | | | | | | | | | | | moved the retrieval of the macOS specific options from the backend initialisation to the initialisation of the CocoaCB class, the earliest point possible. this way macOS specific options can be used for the opengl context creation for example.
* | osdep: make use of HAVE_ANDROIDTom Yan2018-08-203-4/+8
| |
* | osx: Fix initialization and access of service menuMichael Hoang2018-08-111-2/+2
| | | | | | | | | | Replace dot syntax with accessor syntax so that clang no longer errors out due to not finding the property servicesMenu on NSApp.
* | cocoa-cb: remove pre-allocation of window, view and layerAkemi2018-06-125-41/+44
| | | | | | | | | | | | | | | | | | | | | | the pre-allocation was needed because the layer allocated a opengl context async itself and we couldn't influence that. so we had to start the core after the context was actually allocated. furthermore a window, view and layer hierarchy had to be created so the layer would create a context. now, instead of relying on the layer to create a context we do this manually and re-use that context later when the layer wants to create one async itself.
* | terminal-unix: stop trying to read when terminal disappearswm42018-05-251-2/+4
|/ | | | | | | | Avoids 100% CPU usage due to terminal code retrying read(). Seems like this was "forgotten" (or there was somehow the assumption poll() would not signal POLLIN anymore). Fixes #5842.
* demux: support for some kinds of timed metadatawm42018-04-181-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This makes ICY title changes show up at approximately the correct time, even if the demuxer buffer is huge. (It'll still be wrong if the stream byte cache contains a meaningful amount of data.) It should have the same effect for mid-stream metadata changes in e.g. OGG (untested). This is still somewhat fishy, but in parts due to ICY being fishy, and FFmpeg's metadata change API being somewhat fishy. For example, what happens if you seek? With FFmpeg AVFMT_EVENT_FLAG_METADATA_UPDATED and AVSTREAM_EVENT_FLAG_METADATA_UPDATED we hope that FFmpeg will correctly restore the correct metadata when the first packet is returned. If you seke with ICY, we're out of luck, and some audio will be associated with the wrong tag until we get a new title through ICY metadata update at an essentially random point (it's mostly inherent to ICY). Then the tags will switch back and forth, and this behavior will stick with the data stored in the demuxer cache. Fortunately, this can happen only if the HTTP stream is actually seekable, which it usually is not for ICY things. Seeking doesn't even make sense with ICY, since you can't know the exact metadata location. Basically ICY metsdata sucks. Some complexity is due to a microoptimization: I didn't want additional atomic accesses for each packet if no timed metadata is used. (It probably doesn't matter at all.)
* cocoa-cb: fix a warning with swift 4.1 and slight cleanupAkemi2018-04-171-3/+7
| | | | | | the icc profile data is mutated to an UnsafeMutablePointer and could possibly changed. therefore the size of it should be accessed before a possible change.
* HIDRemote: fix volume buttons on macOS 10.13Akemi2018-04-171-0/+8
| | | | | | | this is a backport of line 1039 to 1046 from https://github.com/iospirit/HIDRemote/commit/33a32ab6136feb8b8220e99ec52c7504c3a82242#diff-8a4d13f0849b3beffa4267954ca28517R1039 Fixes #5721
* cocoa-cb: fix shutdown when fullscreen animation is runningAkemi2018-03-181-1/+4
| | | | | | | | commit 2edf00f changed the MPV_EVENT_SHUTDOWN behaviour slightly, such that it will only be sent once. cocoa-cb relied on it being sent continuously till all mpv_handles are destroyed. now it manually shuts down and destroys the mpv_handle after the animation instead of relying on this removed behaviour.
* all: replace mpv_detach_destroy() with mpv_destroy()wm42018-03-151-2/+2
|
* cocoa-cb: fix usage of wrong fbo when off-screenAkemi2018-03-111-4/+4
| | | | | | | | when we transitioned to the new libmpv API with commit ae29725 i reintroduced an old bug that was fixed with 7f714c6 because of a dumb rebasing error on my part. the branch i based the libmpv changed on was originally without the fbo fix and on rebasing i forgot to change the variable to the proper one, basically deactivating the fix.
* cocoa-cb: use new libmpv API instead of opengl-cbAkemi2018-03-042-48/+62
| | | | | a new replacement API was introduced with b037121 and the old one was deprecated. porting cocoa-cb to the new API.
* cocoa-cb: move the GL dummy function to swiftAkemi2018-03-042-6/+3
| | | | | | it's possible to get a function pointer through a closure after all in swift. remove the GL dummy function from the c header and do it in the swift code instead.
* osdep/atomic: add emulation for atomic_exchange()wm42018-02-281-0/+7
|
* osdep/atomic: fix potential shadowing warningswm42018-02-281-8/+8
| | | | | | | The stdatomic emulation adds "_" to each variable used inside the macros, to avoid that compilers print -Wshadow warnings for identifiers that are also used in surrounding code. Do this more consistently, because new warnings have been showing up.
* cocoa-cb: make fullscreen resize animation duration configurableAkemi2018-02-281-0/+7
|
* cocoa-cb: change border and borderless window stylingAkemi2018-02-282-0/+17
| | | | | | | | | | | the title bar is now within the window bounds instead of outside. same as QuickTime Player. it supports several standard styles, two dark and two light ones. additionally we have properly rounded corners now and the borderless window also has the proper window shadow. Also make the earliest supported macOS version 10.10. Fixes #4789, #3944
* cocoa-cb: fix invalid framebuffer operation errorAkemi2018-02-211-1/+5
| | | | | | | | | in certain circumstances the returned fbo for drawing is 0, but that fbo is solely used internally by the CAOpenGLLayer for its drawing and should never be used. in that case we fallback to 1 or the last used fbo instead if it was not 0. Fixes #5546
* lua+js: Implement utils.getpid()sfan52018-02-131-0/+29
| | | | | | | Usable for uniquely identifying mpv instances from subprocesses, controlling mpv with AppleScript, ... Adds a new mp_getpid() wrapper for cross-platform reasons.
* cocoa-cb: initial implementation via opengl-cb APIAkemi2018-02-126-42/+392
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | this is meant to replace the old and not properly working vo_gpu/opengl cocoa backend in the future. the problems are various shortcomings of Apple's opengl implementation and buggy behaviour in certain circumstances that couldn't be properly worked around. there are also certain regressions on newer macOS versions from 10.11 onwards. - awful opengl performance with a none layer backed context - huge amount of dropped frames with an early context flush - flickering of system elements like the dock or volume indicator - double buffering not properly working with a none layer backed context - bad performance in fullscreen because of system optimisations all the problems were caused by using a normal opengl context, that seems somewhat abandoned by apple, and are fixed by using a layer backed opengl context instead. problems that couldn't be fixed could be properly worked around. this has all features our old backend has sans the wid embedding, the possibility to disable the automatic GPU switching and taking screenshots of the window content. the first was deemed unnecessary by me for now, since i just use the libmpv API that others can use anyway. second is technically not possible atm because we have to pre-allocate our opengl context at a time the config isn't read yet, so we can't get the needed property. third one is a bit tricky because of deadlocking and it needed to be in sync, hopefully i can work around that in the future. this also has at least one additional feature or eye-candy. a properly working fullscreen animation with the native fs. also since this is a direct port of the old backend of the parts that could be used, though with adaptions and improvements, this looks a lot cleaner and easier to understand. some credit goes to @pigoz for the initial swift build support which i could improve upon. Fixes: #5478, #5393, #5152, #5151, #4615, #4476, #3978, #3746, #3739, #2392, #2217
* osx: add some more menu bar items as suggested by Apples's HIGAkemi2018-01-201-0/+35
| | | | | | | | | | | | this adds the standard menu bar items Services, Hide Others, Show All and Close, as suggested by Apple's HIG. https://developer.apple.com/macos/human-interface-guidelines/menus/menu-bar-menus/#app-menu - Services are useful to add custom actions and shortcuts via the System Preferences to mpv - Close is important since the menu bar can open secondary windows, like About or the Open dialogue. those couldn't be closed with the standard system shortcut before. this is now possible.
* osx: code cleanups and cosmetic fixesAkemi2018-01-205-16/+2
|
* osx: fix macOS 10.13 deprecation warningAkemi2018-01-202-1/+7
| | | | | | | | NSFileHandlingPanelOKButton is deprecated with macOS 10.13, but the replacement NSModalResponseOK is not available on 10.8 and earlier. added a declaration for 10.8 and earlier since i only officially dropped support for 10.7 and earlier. this is untested.
* mpv.rc: readd actual version infoRicardo Constantino2018-01-011-2/+2
|
* build: move copyright statement to a shared locationwm42018-01-012-2/+3
| | | | | | | Now macosx_menubar.m and mpv.rc (win32) use the same copyright string. (This is a bit roundabout, because mpv.rc can't use C constants. Also the C code wants to avoid rebuilding real source files if only version.h changed, so only version.c includes version.h.)
* Update copyright yearwm42018-01-011-1/+1
|
* subprocess-win: don't change the mouse cursor in CreateProcesspavelxdd2017-12-141-1/+1
| | | | | | By default the CreateProcess changes the mouse cursor to IDC_APPSTARTING. The new flag added to STARTUPINFOEXW prevents changing the cursor from default arrow on creating a new process.
* terminal-unix: fix race condition with tty resetDrew DeVault2017-12-091-10/+10
| | | | | | | | | | | | | Calling do_deactivate_getch2 before joining the terminal thread could lead to breakage if the terminal thread got another interation in before it was signaled to stop. This also addresses a minor error with the order in which things are initialized - getch2_poll would previously call tcgetpgrp(tty_in) before tty_in was initialized, which did not lead to broken behavior, but was not correct either. Fixes #5195
* terminal-unix: switch back to poll(3)Drew DeVault2017-12-091-15/+9
| | | | | This leverages the new polldev shim which lets us "poll" device files on macOS with select and use the genuine article on other platforms.
* osdep: add poll shim for macOSDrew DeVault2017-12-092-0/+82
| | | | | | | This implements a poll-compatible interface, backed by select on macOS, suitable for polling on device files - which are not supported by macOS's implementation of poll. This is a (long-standing) bug in macOS, so hopefully we can eventually remove this shim.
* terminal-unix: fix busy looping on LinuxDrew DeVault2017-12-081-2/+1
| | | | | | | POSIX permits select() to modify the timeout, which can happen on the Linux implementation. This can reset the timeout, which spins this into a tight loop. A timeout isn't necessary in the first place, so just use NULL instead.
* Use /dev/tty instead of stdin for terminal inputDrew DeVault2017-12-081-18/+43
| | | | | | | Fixes #4190 This allows you to use terminal input even if you've piped something into mpv.
* build: remove nanosleep() checkwm42017-12-021-9/+0
| | | | Also guaranteed by POSIX.
* build: remove termios checkwm42017-12-021-14/+0
| | | | Also should be fully covered by POSIX.
* ao: simplify hack for float atomicswm42017-11-301-0/+3
| | | | | | | stdatomic.h defines no atomic_float typedef. We can't just use _Atomic unconditionally, because we support compilers without C11 atomics. So just create a custom atomic_float typedef in the wrapper, which uses _Atomic in the C11 code path.
* win32: fix semantics of POSIX 2008 locale stubsJames Ross-Gowan2017-11-192-4/+19
| | | | | | | | | | | | | | | | | This sliences some warnings about unused values and statements with no effect, but it also fixes a logic error with freelocale(), since previously it would not work as expected when used in the body of an if statement without braces. Uses real functions, because with macros, I don't think there is a way to silence the "statement with no effect" warnings in the case where the return value of uselocale() is ignored. As for replacing the these functions with working implementations, I don't think this is possible for mpv's use-case, since MSVCRT does not support UTF-8 locales, or any locale with multibyte characters that are three or more bytes long. See: https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/setlocale-wsetlocale
* stream_libarchive, osdep: use stubs for POSIX 2008 locale on MinGWwm42017-11-121-0/+7
|
* osx: fix the bundle $PATH yet againAkemi2017-11-111-1/+1
| | | | we have 5 parameters for the string but only 4 were being used.
* win32: add more-POSIXy versions of open() and fstat()James Ross-Gowan2017-10-252-39/+296
| | | | | | | | | | | | | | Directory-opening never worked on Windows because MSVCRT's open() doesn't open directories and its fstat() doesn't recognise directory handles. These are just MSVCRT restrictions, and the Windows API itself has no problem with opening directories as file objects, so reimplement mpv's mp_open and mp_stat to use the Windows API directly. This should fix directory playback. This also populates the st_dev and st_ino fields of struct stat, so filesystem loop checking in demux_playlist.c should now work on Windows. Fixes #4711
* osx: add right MacPorts paths to our bundle $PATHAkemi2017-10-071-2/+3
| | | | also add another path for homebrew.
* osx: add some common paths to our $PATH when started from bundleAkemi2017-10-031-0/+8
| | | | | | | | | | | with the previous commit we removed the ability of loading the standard shell environment. this exact behaviour can only be re-added by either invoking the standard shell in a background process and reading it's environment vars or by manually reading all the various shell configs. both ways are kinda dirty and the former was already rejected before. for now we will just add some commonly used paths, when started from the bundle, so it can find the binaries used by mpv again. for example the youtube-dl one for our youtube-dl hook.
* osx: fix bundle on macOS High Sierra (10.13)Akemi2017-10-032-6/+21
| | | | | | | | | | | | | | | | | | | | | | Apple slightly changed the App bundle mechanism which broke wrapper scripts that invoke the actual binary. it caused the bundle to always open a new instance of mpv instead of reusing the currently running one. just removing the wrapper script would lead to several regressions, so it was replaced with a symlink to the bundle binary. detection if mpv was started from the bundle was replaced by comparing the execution name of the binary, eg the name of the symlink "mpv-bundle". additionally, because we load a standard config from the Resources folder of the bundle again, we prevent that config from being loaded if mpv wasn't started via the bundle. the psn argument has to be removed manually again. the ability of loading your standard shell environment has been removed with the wrapper. a substitution will be added with another commit. as a side effect this fixes an issues when zsh was used with common NodeJS configuration scripts. Fixes #4926 #4866
* android: posix_spawn(p) replacementsfan52017-09-224-1/+143
| | | | Signed-off-by: wm4 <wm4@nowhere>
* osdep/io: add android related bullshitJan Ekström2017-09-181-0/+27
| | | | | | | | | | | | | This fixes >2GiB files with at least API level 21. See: https://android.googlesource.com/platform/bionic/+/master/docs/32-bit-abi.md for the gritty details. * Based on libavformat's things, except we do not care about API versions or NDKs without unistd.h, which contains all sorts of things that we utilize. * Redefines lseek to always point to the 64bit version. * Redefines fseeko to always point towards an inlined static implementation that utilizes the 64bit version of lseek underneath.
* osx: fix media keys input when other Apps steal the priorityAkemi2017-09-073-0/+27
| | | | | | | | | | | other Apps do the same as mpv and tap into the global event chain. events that are handled are not being propagated down the event chain. that can lead to mpv not getting any media key events anymore when they are held back by other Apps. we will just move mpv back to the top of the event list when mpv is refocused and is not at the top of the list any more. Fixes #4834
* osx: fix build on macOS 10.11 and earlierAkemi2017-08-262-2/+8
| | | | | | | | 98f5579 added a safeguard for the deactivation of the automatic tab bar but it still needs a compile time guard. add a forward declaration for the setAllowsAutomaticWindowTabbing method of NSWindow. Fixes #4783
* win32: fix massive memory corruption (take 2)wm42017-08-211-3/+4
| | | | | | As pointed out by uau on IRC, the pointer to info is still used outside of the lock. An extremely small race condition window, but still a race condition.
* win32: fix massive memory corruptionwm42017-08-211-2/+6
| | | | | | | | | | The struct m_thread_info pointer is part of an array, that will be reallocated if another thread is created while the run_thread is just being called. In previous versions of this code, the pointer was stable (as long as the thread existed), so this was overlooked. Fixes #4770. I'm not sure why this triggers it so reliably, while it remained undetected otherwise.
* osx: remove the standard "Show Tab Bar" menu itemAkemi2017-08-181-0/+3
| | | | | it's unused and added automatically. we need to guard the deactivation since it's a 10.12+ feature.
* osx: code cleanups and cosmetic fixesAkemi2017-08-182-5/+7
| | | | silence build warnings, clean up code style and remove unused code.
* osx: refactor menu bar creationAkemi2017-08-184-81/+686
| | | | | make the menu bar look more like a standard macOS menu bar, with all the standard menu items like About, Help, Open, etc.
* osx: move menu bar creation into its own fileAkemi2017-08-186-142/+211
|
* {demux_mf,osdep/io}: disable glob usage when it is not availableJan Ekström2017-08-051-1/+1
| | | | | | | | This currently is only limited to Android. Its stdlib contains the things that mpv's POSIX check checks for, but unfortunately not glob(). This fixes Android compilation broken in 70a70b9da .
* w32_common: handle media keysJames Ross-Gowan2017-08-052-0/+23
| | | | | | | | | | | | | | | | | This was attempted before in fc9695e63b5b, but it was reverted in 1b7ce759b1f4 because it caused conflicts with other software watching the same keys (See #2041.) It seems like some PCs ship with OEM software that watches the volume keys without consuming key events and this causes them to be handled twice, once by mpv and once by the other software. In order to prevent conflicts like this, use the WM_APPCOMMAND message to handle media keys. Returning TRUE from the WM_APPCOMMAND handler should indicate to the operating system that we consumed the key event and it should not be propogated to the shell. Also, we now only listen for keys that are directly related to multimedia playback (eg. the APPCOMMAND_MEDIA_* keys.) Keys like APPCOMMAND_VOLUME_* are ignored, so they can be handled by the shell, or by other mixer software.
* subprocess-win: fix swprintf usageJames Ross-Gowan2017-07-291-1/+2
| | | | | | | The count parameter refers to the number of wide-characters to write to the buffer (including the terminating NUL character, which is always added,) not the number of bytes. See C99 7.24.2.3 or https://msdn.microsoft.com/en-us/library/ybk95axf.aspx
* subprocess-win: don't leak pipe handle on errorJames Ross-Gowan2017-07-281-1/+3
|
* subprocess-win: remove VLA usageJames Ross-Gowan2017-07-261-2/+4
| | | | This only ever waits on four handles at most anyway.
* Universal Windows Plaform (UWP) supportPedro Pombeiro2017-06-296-3/+89
| | | | | | | | libmpv only. Some things are still missing. Heavily reworked. Signed-off-by: wm4 <wm4@nowhere>
* Avoid calling close(-1)wm42017-06-292-20/+24
| | | | | | | | | | While this is perfectly OK on Unix, it causes annoying valgrind warnings, and might be otherwise confusing to others. On Windows, the runtime can actually abort the process if this is called. push.c part taken from a patch by Pedro Pombeiro.
* build: change how some OS specific source files are selectedwm42017-06-293-10/+40
| | | | | | | | | | | | | | | | | | In a bunch of cases, we emulate highly platform specific APIs on a higher level across all OSes, such as IPC, terminal, subprocess handling, and more. We have source files for each OS, and they implement all the same mpv internal API. Selecting which source file to use on an OS can be tricky, because there is partially overlapping and emulated APIs (consider Cygwin on Windows). Add a pick_first_matching_dep() function to make this slightly easier and more structured. Also add dummy backends in some cases, to deal with APIs not being available. Clarify the Windows dependency identifiers, as these are the most confusing.
* build: replace glob() check and assume it's always in POSIXwm42017-06-291-1/+1
| | | | | POSIX requires glob(), so no need to check for it. Together with the fact that we can emulate glob() on Windows, glob() is always available.
* terminal: remove unused return valuewm42017-06-273-6/+3
|
* osx: change license of OSX and cocoa files to LGPLwm42017-06-2410-71/+71
| | | | All authors of the current code have agreed.
* w32_common, w32_keyboard: change license to LGPLwm42017-06-242-14/+14
| | | | All authors agreed.
* Revert "osdep: NetBSD pthread_setname_np()"wm42017-06-221-6/+0
| | | | | | | | | | This reverts commit 2e81698d2809836d4cd7f754a78598e7bdf96c0b. Seems like this was a patch applied from someone who can't agree to LGPL relicensing (see previous commit), with the author field not properly set. This is not so important anyway, so just revert it.
* win32: pthread: avoid using TLS, simplify pthread_twm42017-06-152-48/+89
| | | | | | | | | | | | | | | | | Don't use __thread, which requires heavy runtime in some cases (such as MinGW-w64, at least under some configurations, forcing you to link to its pthread runtime DLL). The pthread_t struct was needed over a simple thread ID, because pthread_join() needed to access some sort of context from pthread_t. Further, pthread_exit() and pthread_detach() need the context of the current thread, for which we relied on TLS. Replace these uses by a global thread array. This includes all threads created by the thread wrapper. Hopefully the number of threads created by mpv is low (say, below 20), and threads are not that often created or destroyed. So just keeping them in an array with linear search lookup should be reasonable.
* terminal: change license to LGPLwm42017-06-143-32/+25
| | | | | | | | | | | | | | | | All authors of the current code have agreed. The code probably originates from a software named GySmail (as the copyright header indicates). As far as I can tell, it was written by Arpi (who has agreed), possibly with unknown co-authors. This is most likely OK, as none of the original code is around anymore anyway. I could not find a working download of GySmail, that actually contained the original getch2.c code. This also has a wild history of random people adding ifdef guards to control ioctl() vs. tcgetattr() calls. (See for example 2b1310abba4c1.) Later, the ioctl() was removed in favor of the POSIX tcgetattr(), and the ifdeffery was removed. So these people were not contacted.
* mpv.rc, mpv.exe.manifest: change license to LGPLwm42017-06-121-9/+7
| | | | | | | | | All authors have agreed. mpv.exe.manifest probably can't have a copyright header, so it doesn't. These files don't add license info to the executables. And of course the executable license is still GPL.
* win32: pthread: use the new thread naming APIJames Ross-Gowan2017-05-183-1/+27
| | | | | | | Windows, as of the Creators Update, finally has a sane API for giving a name to a thread that can be used by debuggers. This is similar to pthread_setname_np on Linux and some Unixes. Expose it in the pthread wrapper and use it for mpthread_set_name().
* osdep/compiler.h: change license to LGPLwm42017-05-081-14/+8
| | | | | | | | | | | This didn't have a header and this was implied LGPL, but this was not entirely correct. It turns out the printf attribute code was leaked in from talloc, which is "LGPL v3 or later". talloc was added to the mplayer2 code base in 27a30e310e1. This remaining code was an oversight. Since we want to reduce LGPL v3 code, replace this code with the one from ta/ta.h. This code was explicitly written newly to get rid of talloc and its license in 0933f12d28e.
* osdep/timer*: change license to LGPLwm42017-05-053-23/+21
| | | | | | | | | | | | | | All authors have agreed, with the following exceptions: e68d7f6858: wight wasn't asked (I think...), but even if he modified the patch he applied, all code added by it was removed again later. cb7768f9bb: nick could not be reached, but the declarations he added as well as the full timer.c file were deleted again in cff81fe498 and f800a42e45 (did it really take 6 years to remove unused declarations?). ffaf4af230: it looks like this person wasn't contacted, but the code added was removed again in f544bcf105.
* osx: fix deadlock on exit with libmpv on OSXwm42017-04-191-8/+11
| | | | | | | | | | | There is explicit code to handle the libmpv case, but it expects that a dispatch queue is running. This is not necessarily the case. E.g. edit the simple.c mpv example not to do any playback and to destroy the mpv handle immediately. It will freeze on exit, because nothing will release the mpv_handle. I'm not sure how this should be fixed, so disable it for now in library mode.
* Fix use of ISC licensewm42017-04-154-2/+37
| | | | | | | | | | The license text refers a "above copyright notice", so I guess it'd be good to actually provide such a notice. Add the license to some files that were missing it (since in theory, our Copyright file says that such files are LGPL by default). Remove the questionable remarks about the license in the client API.
* win32: fix mismatched free/talloc_freewm42017-04-121-1/+1
| | | | Might fix #4315.
* win32: rewrite getcwd() using GetFullPathNameWwm42017-04-111-2/+11
| | | | _wgetcwd is apparently not available in all runtimes. Well, whatever.
* win32: add UTF-8 getcwd() wrapperwm42017-04-112-0/+20
|
* osx: fix Touch Bar access on systems without Touch Bar supportAkemi2017-04-021-4/+7
| | | | | | when building with a deployment target older than an SDK with Touch Bar support we still tried to access the TouchBar, since the compile time checks are positive. to prevent this we add two runtime checks.
* osx: fix event propagation of menu bar item key shortcutsAkemi2017-03-271-4/+3
| | | | | | a small logic error in 063ca8f broke the filtering of the menu bar item key shortcuts. they where called several times per event because the propagation wasn't stopped properly.
* osx: fix key input in certain circumstancesAkemi2017-03-265-25/+15
| | | | | | | | | | | | | for a reason i can just assume some key events can vanish from the event chain and mpv seems unresponsive. after quite some testing i could confirm that the events are present at the first entry point of the event chain, the sendEvent method of the Application, and that they vanish at a point afterwards. now we use that entry point to grab keyDown and keyUp events. we also stop propagating those key events to prevent the no key input' error sound. if we ever need the key events somewhere down the event chain we need to start propagating them again. though this is not necessary currently.
* osx: initial Touch Bar supportAkemi2017-03-267-0/+433
|
* osx: add key mappings for previous and next Media KeysAkemi2017-03-091-3/+5
| | | | Fixes #4204
* osx: drop support for OS X 10.7 and earlierAkemi2017-02-272-31/+0
|
* cocoa: fix dragging out of focus windowAkemi2017-02-211-0/+1
| | | | | | | | | | fffab30 introduced a small regression where the cursor couldn't be unhidden after refocusing. the problem is that no mouseUp event was reported in our events_view. work around this with a separate event monitor. this also fixes another regression when the window is being dragged from the title bar. #4174
* osx: improve bundle handlingAkemi2017-02-161-50/+5
| | | | | | | | | | | | | | | | | we have two problems here. first when mpv is started from the bundle it uses its own environment variables and possibly can't find for example the youtube-dl binary for our youtube-dl hook. second we couldn't reliable determine when mpv was started from the bundle, which led to the pseudo-gui usage even when the binary was invoked from a shell. to prevent this we will wrap the bundle binary with a shell script, which will only be called when we start mpv from the bundle. this way we can get the same environment variables, like $PATH, for our bundle and additional we can set the pseudo-gui only when started through this script. it is also possible to detect the bundle usage properly and accurately through the usage of another environment var. Fixes #2061
* cocoa: gracefully quit from the Dock's context menuAkemi2017-02-161-4/+10
| | | | | | | | | | | | quitting mpv from the Dock's context menu leaves the shell in a bad state where you can't see your input any more and other weirdnesses. in a big refactor (afdc9c4) the method to handle this case was actually copied over but the the code to register the event itself was removed or forgotten by accident, leaving some lines of dead code. i re-added the event and slightly adjusted the function. the function was slightly changed so the head of it is consistent with our other events and it is associated with this commit and functionality in the future.
* atomic: remove __atomic builtin usagewm42017-02-131-30/+7
| | | | | | | | Using these was a temporary solution while some compilers implemented the underlying atomic mechanisms, but not the C11 language parts (or that's what I guess). Not really useful for us anymore. Also, there is the slight risk of having subtly incorrect semantics by using potentially changing compiler internals and such.
* vo_opengl: angle: rewrite with custom swap chainJames Ross-Gowan2017-02-071-0/+8
| | | | | | | | | | | | | This replaces the old backend that exclusively used EGL windowing with one that can also use ANGLE's ability to render to directly to a texture. The advantage of this is that it allows mpv to create the swap chain itself and this allows mpv to use a flip-mode swap chain on a HWND (which avoids problems with DirectComposition) and to use a longer swap chain that has six backbuffers by default (which reportedly fixes problems with rendering 24fps video on 24Hz monitors.) Also, "screenshot window" should now work on DXGI 1.2 and up (Windows 8 and up.)
* win32: add COM-specific SAFE_RELEASE to windows_utils.hJames Ross-Gowan2017-01-301-0/+4
| | | | | | | | | | | | | | | See: https://msdn.microsoft.com/en-us/library/windows/desktop/dd743946.aspx Microsoft example code often uses a SAFE_RELEASE macro like the one in the above link. This makes it easier to avoid errors when releasing COM interfaces. It also reduces noise in COM-heavy code. ao_wasapi.h also had a macro called SAFE_RELEASE, though unlike the version above, its SAFE_RELEASE macro accepted a second parameter which allowed it to destroy arbitrary objects other than just COM interfaces. This renames ao_wasapi's SAFE_RELEASE to SAFE_DESTROY, which should more accurately reflect what it does and prevent confusion with the Microsoft version.
* atomic: drop __sync builtinswm42017-01-271-19/+0
| | | | | | | | | | The correctness of the stdatomic.h emulation via the __sync builtins is questionable, and we've been relying on exact stdatomic semantics for a while, so just get rid of it. Compilers which support __sync but not stdatomic.h will use to the slow mutex fallback. Not sure about the __atomic builtins. It doesn't seem to harm either, so leave it for now.
* Update copyright yearwm42017-01-011-1/+1
| | | | What kind of bullshit forces you to do this every year anyway.
* cocoa: cosmetic fixesAkemi2016-12-162-6/+11
|
* cocoa: fullscreen refactoringAkemi2016-12-151-0/+1
| | | | | | | | | | this replaces the old fullscreen with the native macOS fullscreen. additional the --fs-black-out-screens was removed since the new API doesn't support it in a way the old one did. it can possibly be re-added if done manually. Fixes #2857 #3272 #1352 #2062 #3864
* cocoa: support append file to paylist on dropAkemi2016-12-141-1/+4
| | | | | | | | | When dropping a file on mpv, either on the window or the App bundle icon, while holding the shift key the dropped files will be appended to the playlist. Fixes #2166
* osx: update the menu and remove conflicting itemAkemi2016-12-121-7/+5
| | | | | | | | | | | Remove 'Quit mpv & remember playback position' from the menu because it conflicts with the global logout shortcut. add separator between 'Hide' and 'Quit' for consistency with other Apps. also rename the 'Movie' menu to 'Video'. it's a bit more generic. Fixes #3865
* win32: fix some Clang warningsJames Ross-Gowan2016-11-171-3/+3
| | | | | | | | - win32-console-wrapper.c was inconsistently using the explicit Unicode versions of some Windows API functions and structures. - vo.c should use llabs for int64_t, since long is 32-bit on Windows. - vo_direct3d.c had a potential use of an uninitialized variable if it took the first goto error_exit.
* build: fix compilation with mingw-w64/ClangJames Ross-Gowan2016-11-171-1/+1
| | | | | | | | | | This fixes the build in mingw-w64/Clang on MSYS2. It also disables the use of gnu_printf in Clang, which was what was causing most of the warnings. The Clang-compiled mpv binary appears to work, but there are no guarantees yet, since until now mpv has only been tested with mingw-w64/GCC on Windows. Fixes #3800
* terminal-win: support modifier keys in console inputJames Ross-Gowan2016-10-141-2/+14
| | | | | | | | | | | | | | | | | Keyboard input in the console still isn't quite as flexible as it is in the video window. Ctrl+<letter> and Ctrl+LEFT/RIGHT work, but Ctrl+Alt+<letter> and Ctrl+<number> do not. Also, in the new Windows 10 console, a bunch of Ctrl keystrokes including Ctrl+UP/DOWN are handled by the console window and not passed to the application. Unlike in w32_common.c, we can't really translate keyboaard input ourselves because the keyboard layout of the console window (in conhost.exe) doesn't necessarily match the keyboard layout of mpv's console input thread, however, using ToUnicode as a fallback when the console doesn't return a unicode value could be a possible future improvement. Fixes #3625
* terminal-win: clean up console inputJames Ross-Gowan2016-10-141-49/+33
| | | | | | | | | | | | | | | | | | | | | | The original version of this code in getch2-win.c fetched 128 console events at once. This was probably to maximize the chance of getting a key event if there were other events in the buffer, because it returned the value of the first key event it found and ignored all others. Since that code was written, it has been modified to receive console input in an event-based way using an input thread, so it is probably not necessary to fetch so many events at once any more. Also, I'm not sure what it would have done if there were more than 128 events in the console input buffer. It's possible that fetching multiple events at a time also had performance advantages, but I can't find any other programs that do this. Even libuv just fetches one console event at a time. Change read_input() to fetch only one event at a time and to consume all available events before returning to WaitForMultipleObjects. Also remove some outdated comments and pass the console handle through to the input thread instead of calling GetStdHandle multiple times (I think this is theoretically more correct because it is possible for the handles returned by GetStdHandle to be changed by other threads.)
* win32: build with -DINITGUIDJames Ross-Gowan2016-09-281-1/+0
| | | | | | | | | | | | We always want to use __declspec(selectany) to declare GUIDs, but manually including <initguid.h> in every file that used GUIDs was error-prone. Since all <initguid.h> does is define INITGUID and include <guiddef.h>, we can remove all references to <initguid.h> and just compile with -DINITGUID to get the same effect. Also, this partially reverts 622bcb0 by re-adding libuuid.a to the build, since apparently some GUIDs (such as GUID_NULL) are not declared in the source file, even when INITGUID is set.
* player: do not let pseudo-gui override user config settingswm42016-09-231-2/+4
| | | | | | | | Seems like this confused users quite often. Instead of --profile=pseudo-gui, --player-operation-mode=pseudo-gui now has to be used to invoke pseudo GUI mode. The old way still works, and still behaves in the old way.
* cocoa: fix macOS 10.12 deprecation warningsAkemi2016-09-223-9/+42
|
* player: make --terminal freetly settable at runtimewm42016-09-192-4/+3
| | | | | | | | | | | | | | | | | | | So client API users don't have to care about whether to set this before or after mpv_initialize(). We still don't enable terminal at any point before mpv_initialize(), because reasons. This also subtly changes some behavior how terminal options are applied while parsing. This essentially reverts the behavior as it was reported in issue #2588. Originally, I was hoping to get rid of the pre-parse option pass, but it seems this is absolutely not possible due to the way config and command line parsing are entangled. Command line options take priority over configfile options, so they have to be applied later - but we also want to apply logging and terminal options as specified on the command-line, but _before_ parsing the config files. It has to be this way to see config file error messages on the terminal, or to hide them if --no-terminal is used. libmpv considerations also factor into this.
* terminal-unix: don't send quit command on terminal_uninit()wm42016-09-191-4/+8
| | | | | | | | | | | | Until now, the terminal thread always sent a quit command if the terminal thread was torn down (whether it happened via terminal_uninit() or a quit signal). This is not so good if we want to enable toggling terminal use at runtime, since disabling the terminal would always make the player quit. So we want terminal_uninit() not to send quit. This can be easily fixed by using the "death byte" sent to the pipe used for thread tear-down to indicate whether it was caused by a signal or terminal_uninit().
* osdep: rename atomics.h to atomic.hwm42016-09-072-3/+3
| | | | | The standard header is stdatomic.h, so the extra "s" freaks me out every time I look at it.
* atomics: readd some emulationwm42016-09-061-0/+43
| | | | | | | | | | | This time it's emulation that's supposed to work (not just dummied out). Unlike the previous emulation, no mpv code has to be disabled, and everything should work (albeit possibly a bit slowly). On the other hand, it's not possible to implement this kind of emulation without compiler support. We use GNU statement expressions and __typeof__ in this case. This code is inactive if stdatomic.h is available.
* build: always require atomicswm42016-08-051-21/+8
| | | | | | | | | | | | | | | Always require them, instead of just for some components which have hard requirements on correct atomic semantics. They should be widely available, and are supported by all recent gcc and clang compiler versions. We even have the fallbacks builtins, which should keep this working on very old gcc releases. In particular, w32_common.c recently added a hard requirement on atomics, but checking this properly in the build system would have been messy. This commit makes sure it always works. The fallback where weak atomic semantics are always fine is in theory rather questionable as well.
* osdep/io: introduce mp_flush_wakeup_pipe()Rostislav Pehlivanov2016-07-302-0/+9
| | | | Makes a fairly common occurence with wakeup_pipes easier to handle.
* Use - as command-name separator everywhereTimotej Lazar2016-07-141-1/+1
| | | | | | | Old-style commands using _ as separator (e.g. show_progress) were still used in some places, including documentation and configuration files. This commit updates all such instances to the new style (show-progress) so that commands are easier to find in the manual.
* win32: mpv.rc: re-add version infoJames Ross-Gowan2016-07-121-7/+25
| | | | | | | | | | | | | | | | For some reason, the lack of version info was preventing mpv from appearing in the Default Programs dialog. Re-add it, but don't set the string version numbers from version.h, because that's what was causing trouble when the version info was removed. Like the binary version numbers, these are now hardcoded to 2.0.0.0, which probably doesn't matter. The new version info block is also slightly different to the old one. It fills out all the binary VERSIONINFO fields and makes better use of macros. It also removes the \000 line terminators from the string version info, since as far as I can tell, this was just cargo-culting for an old broken version of the Microsoft resource compiler, and binutils' windres terminates the strings properly without them.
* subprocess: add a callback to ignore outputBen Boeckel2016-07-052-0/+6
| | | | This callback is equivalent to shoving data into /dev/null.
* Fix misspellingsstepshal2016-06-262-5/+5
|
* build: silence -Wunused-resultNiklas Haas2016-06-071-3/+3
| | | | | | | | For clang, it's enough to just put (void) around usages we are intentionally ignoring the result of. Since GCC does not seem to want to respect this decision, we are forced to disable the warning globally.
* win32: pthread: use SRW locks by defaultwm42016-05-242-20/+33
| | | | | | | | | SRW locks are available since Windows Vista. They work essentially like Linux futexes. In particular, they can be statically initialized, and do not require deinitialization. This makes them ideal for implementing PTHREAD_MUTEX_INITIALIZER. We still need CRITICAL_SECTION for recursive mutexes.
* mpv.rc: remove most contentswm42016-03-141-21/+0
| | | | In particular remove version.h to deal with my temporary build problem.
* glob-win: relicense to LGPLJames Ross-Gowan2016-02-181-7/+7
| | | | | | This file was rewritten from scratch in 0cef033, so it should be okay. As mentioned in #730, it's a complete rewrite referencing only MSDN and POSIX, rather than the original code.
* windows_utils: try and use FormatMessage for errors.Kevin Mitchell2016-02-172-3/+23
| | | | | | This is useful in particular for GetLastError, unfortunately, it's stil pretty dumb with regards to WASAPI or D3D specific errors, so keep the hresult_to_string switch.
* dxva2: use mp_HESULT_to_str on FAILED(hr)Kevin Mitchell2016-02-161-0/+35
|
* cocoa: fix charcode retrieving for accented charactersAlexis Nootens2016-02-151-1/+2
| | | | | The handler was retrieving an invalid charcode for accented characters, thus ignoring them.
* Initial Android supportJan Ekström2016-02-103-0/+102
| | | | | * Adds an 'android' feature, which is automatically detected. * Android has a broken strnlen, so a wrapper is added from FreeBSD.
* build: make posix_spawn optionalwm42016-02-081-0/+12
| | | | OK, Android doesn't support it.
* Relicense some non-MPlayer source files to LGPL 2.1 or laterwm42016-01-1912-84/+85
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This covers source files which were added in mplayer2 and mpv times only, and where all code is covered by LGPL relicensing agreements. There are probably more files to which this applies, but I'm being conservative here. A file named ao_sdl.c exists in MPlayer too, but the mpv one is a complete rewrite, and was added some time after the original ao_sdl.c was removed. The same applies to vo_sdl.c, for which the SDL2 API is radically different in addition (MPlayer supports SDL 1.2 only). common.c contains only code written by me. But common.h is a strange case: although it originally was named mp_common.h and exists in MPlayer too, by now it contains only definitions written by uau and me. The exceptions are the CONTROL_ defines - thus not changing the license of common.h yet. codec_tags.c contained once large tables generated from MPlayer's codecs.conf, but all of these tables were removed. From demux_playlist.c I'm removing a code fragment from someone who was not asked; this probably could be done later (see commit 15dccc37). misc.c is a bit complicated to reason about (it was split off mplayer.c and thus contains random functions out of this file), but actually all functions have been added post-MPlayer. Except get_relative_time(), which was written by uau, but looks similar to 3 different versions of something similar in each of the Unix/win32/OSX timer source files. I'm not sure what that means in regards to copyright, so I've just moved it into another still-GPL source file for now. screenshot.c once had some minor parts of MPlayer's vf_screenshot.c, but they're all gone.
* mpv_talloc.h: rename from talloc.hDmitrij D. Czarkoff2016-01-115-5/+5
| | | | This change helps avoiding conflict with talloc.h from libtalloc.
* ao_wasapi: move out some utility functionswm42016-01-112-0/+126
| | | | | | Note that hresult_to_str() (coming from wasapi_explain_err()) is mostly wasapi-specific, but since HRESULT error codes are unique, it can be extended for any other use.
* win32: fix fd://James Ross-Gowan2016-01-071-0/+7
| | | | | | | | Windows definitely supports Unix-style fd inheritance. This mostly worked when launched from mpv.exe, though mpv should change the file mode to O_BINARY. When launched from mpv.com, the wrapper must pass the list of handles (stored in the undocumented lpReserved2 and cbReserved2 fields) to the mpv process.
* Update copyright yearwm42016-01-011-1/+1
| | | | Merry christmas, or whatever the fuck is going on right now.
* path-win: include initguid.hKevin Mitchell2015-12-201-0/+1
| | | | cygwin was giving undefined reference to `FOLDERID_Desktop' at link time
* win32: add Windows 10 compatibility GUIDJames Ross-Gowan2015-12-201-0/+2
| | | | | This suppresses the Program Compatibility Assistant on Windows 10. mpv is regularly tested on Windows 10, so this should be okay.
* win32: path: use Known Folder IDsJames Ross-Gowan2015-12-201-7/+9
| | | | | | CSIDLs have been deprecated in Windows Vista and are not recommended for use in new code. They have been replaced with Known Folder IDs, which are pretty much the same thing, except they use GUIDs.
* win32: use PIPE_REJECT_REMOTE_CLIENTSJames Ross-Gowan2015-12-201-1/+2
| | | | | This partially reverts c670488. mpv only supports Vista and up, so this flag is fine.
* win32: remove ProcThreadAttributeList dynamic loadingJames Ross-Gowan2015-12-201-36/+6
| | | | | These are always available in supported Windows versions, as is the EXTENDED_STARTUPINFO_PRESENT flag.
* win32: remove SetDllDirectoryW dynamic loadingJames Ross-Gowan2015-12-201-4/+1
| | | | All Windows versions we support have this API.
* win32: fix console output with raw stdio functionsJames Ross-Gowan2015-12-061-8/+7
| | | | | | | | | | | | | | | | reopen_console_handle() was never properly tested because mpv overrides printf in most source files. Turns out that when there's no console on startup, the CRT sets the fds of stdout and stderr to -2, so the old method of using dup2 to manipulate these fds didn't work. As far as I can tell, the only way to give stdout and stderr valid fds is to use freopen, so this uses freopen to set them both to the console output. This also uses dup2 to change STDOUT_FILENO and STDERR_FILENO, so low- level functions like isatty still work. Note that this means fileno(stdout) != STDOUT_FILENO. I don't think this will cause any problems. This should fix MPV_LEAK_REPORT on the Windows console.
* input: add append argument to file drop eventKevin Mitchell2015-08-301-1/+1
| | | | | | This puts in place the machinery to merely append dropped file to the playlist instead of replacing the existing playlist. In this commit, all front-ends set this to false preserving the existing behaviour.
* atomics: cleanup HAVE_ATOMICS definewm42015-08-131-5/+0
| | | | | | | The waf build system generates this already. No point in redoing it in the header file. The legacy build system (which we really should drop) didn't; fix it.
* terminal: disable terminal foreground state pollingwm42015-08-011-2/+1
| | | | | | | This was originally done for zsh; but zsh can manage the terminal state correctly when foregrounding/backgrounding applications if you enable it with "ttyctl -f". So I see no reason to wake up the mpv process once every second anymore.
* win32: revert wchar_t changeswm42015-08-014-21/+21
| | | | | | | | | | | Revert "win32: more wchar_t -> WCHAR replacements" Revert "win32: replace wchar_t with WCHAR" Doing a "partial" port of this makes no sense anymore from my perspective. Revert the changes, as they're confusing without context, maintenance, and progress. These changes were a bit premature anyway, and might actually cause other issues (locale neutrality etc. as it was pointed out).
* win32: more wchar_t -> WCHAR replacementswm42015-07-301-1/+1
| | | | | | | | | | | | | This was essentially missing from commit 0b52ac8a. Since L"..." string literals have the type wchar_t[], we can't use them for UTF-16 strings. Use C11 u"..." string literals instead. These have the type char16_t[], but we simply assume char16_t is the same underlying type as WCHAR. In practice, they're both unsigned short. For this reason use -std=c11 on Windows. Since Windows is a "special" environment (we require either MinGW or Cygwin), we don't need to worry too much about compiler compatibility.
* win32: replace wchar_t with WCHARwm42015-07-293-20/+20
| | | | | | | | | | | | | WCHAR is more portable. While at least MinGW, Cygwin, and MSVC actually use 16 bit wchar_t, Midipix will have 32 bit wchar_t. In that context, using WCHAR instead is more portable. This affects only non-MinGW parts, so not all uses of wchar_t need to be changed. For example, terminal-win.c won't be used on Midipix at all. (Most of io.c won't either, so the search & replace here is more than necessary, but also not harmful.) (Midipix is not useable yet, so this is just preparation.)
* win32: pthread: don't play dirty tricks for mutex initwm42015-07-272-28/+10
| | | | | | | | | | | | | | | | | | | | We used double-checked locking on pthread_mutex_t.requires_init in order to lazily initialize static mutexes (since CRITICAL_SECTION has no native way to do this). This was kind of unclean: we relied on MSVC semantics for volatile (which apparently means all accesses are weakly atomic), which is not such a good idea since mpv can't even be compiled with MSVC. Since it's too much of a pain to get weak atomics, just use INIT_ONCE for initializing the CRITICAL_SECTION. Microsoft most likely implemented this in an extremely efficient way. Essentially, it provides a mechanism for correct double-checked locking without having to deal with the tricky details. We still use an extra flag to avoid calling it at all for normal locks. (To get weak atomics, we could have used stdatomic.h, which modern MinGW provides just fine. But I don't want this wrapper depend on MinGW specifics if possible.)
* win32: add portable config modewm42015-07-271-9/+30
| | | | | | | | | | | See manpage additions. The main reason for adding this is that we can't guess whether the user wants his config in his Windows profile or not. The user basically has to tell mpv what should be done, and the "portable_config" directory does this implicitly. Fixes #2042 (approximately).
* player: use exit code 0 by default for quit, 4 for signals, etc.Philip Sequeira2015-07-111-1/+1
| | | | | | Default key bindings in encoding mode also use code 4, because scripts will probably want to fail if encoding is aborted (leaving an incomplete file).
* timer: fix a corner case on clock changeswm42015-07-041-1/+4
| | | | | | | | | | | | | | | | It's conceivable that the OS time source is subject to clock changes. The time could jump back to before when mpv was started, which would cause mp_time_us() to return values smaller than 1. This is unexpected by the code and could trigger assertions. If there's no monotonic time source there's not much we can do anyway, so just sanitize the return value. It will cause strange behavior until the "lost" time offset has passed, but if you make such huge changes to the system clock while everything is running, you're asking for trouble anyway. (Normally we try to get a monotonic time source, though. This problem sometimes happened on Windows when compiled without winpthreads, when the code was falling back to gettimeofday(). This was already fixed by always using another method.)
* win32: use QueryPerformanceCounter for timingJames Ross-Gowan2015-07-041-13/+11
| | | | | | | | | | | | clock_gettime is implemented in winpthreads, so it's unavailable when mpv is compiled with its internal pthreads implementation. This makes mp_raw_time_us fall back to gettimeofday(), which can cause an assert failure in mp_add_timeout() when the system clock is changed. Use QueryPerformanceCounter instead. The clock_gettime(CLOCK_MONOTONIC) implementation in winpthreads uses QueryPerformanceCounter anyway, so there shouldn't be any change in behaviour.
* subprocess, lua: export whether the process was killed by uswm42015-06-273-3/+13
| | | | | | | | We want to distinguish actual errors, and just aborting the program intentionally. Also be a bit more careful with handling the wait() exit status: do not called WEXITSTATUS() without checking WIFEXITED() first.
* terminal-unix: set terminal mode on initwm42015-06-271-1/+1
| | | | | | | | | | | | | | | mpv usually sets the terminal to non-canonical mode (which in particular disables line buffering). But the old mode is restored if the process is not foregrounded. This is supposed to make mpv behave nicer when it is backgrounded. getch2_poll() enables canonical mode. Unfortunately, this was only called after the poll timeout elapsed, so non-canonical mode is first enabled after about a second after program start. Fix this by moving the poll call before the timeout. (As far as we're aware, there's no event-based way to determine when the FD's process group changes, thus we're polling.)
* Revert "win32: add mappings for some special keys"wm42015-06-241-9/+0
| | | | | | | This reverts commit fc9695e63b5baa1a478acb8e79c038571ee0e9b3. Users were complaining that both mpv and something else (what? I don't know) respond to some multimedia keys, such as volume change.
* Various spelling fixesMarcin Kurczewski2015-06-181-1/+1
| | | | Signed-off-by: wm4 <wm4@nowhere>
* osx: add NULL check for input context in a missing casewm42015-06-011-1/+2
| | | | Fixes a crash on exit under certain circumstances.
* osx: synchronize access to the input_ctxwm42015-05-261-18/+30
| | | | | | | | | | While all functions of input_ctx are inherently thread-safe, access to the _inputContext field itself is not. It could be unset any time by cocoa_set_input_context(). So even trivial input_ctx calls must be under a lock, so that the input_ctx can not be destroyed while the function call is "starting". (Even a function call in progress wouldn't be fine, because mp_input_uninit() requires the caller to "own" the object, i.e. no other threads can access it at this point.)
* osx: never expose input_ctx from EventsResponderwm42015-05-263-20/+33
| | | | Keep it internal, so we can synchronize access to it properly.
* win32: do not call timeEndPeriod(1) on terminationwm42015-05-211-8/+0
| | | | | | | | This was called for formal reasons at best. The way it does this is somewhat dangerous, because if libmpv is unloaded as DLL, this would attempt to call a dangling function pointer. (No, we don't want an extra DllMain entrypoint just for win32.)
* Remove trailing whitespacesMichael Vetter2015-05-152-200/+200
|
* win32: add mappings for some special keyswm42015-05-121-0/+9
| | | | Untested.
* threads: use utility+POSIX functions instead of weird wrapperswm42015-05-114-23/+11
| | | | | | | There is not much of a reason to have these wrappers around. Use POSIX standard functions directly, and use a separate utility function to take care of the timespec calculations. (Course POSIX for using this weird format for time values.)
* ao: make better use of atomicswm42015-05-111-0/+1
| | | | | The main reason for this was compatibility; but some associated problems have been solved in the previous commit.
* atomics: add atomic_fetch_and/atomic_fetch_orwm42015-05-111-7/+20
| | | | | | | | | | As usual, we prefer plain C11 names and semantics, and have to emulate them if C11 atomics are not available. For the non-atomic fallback (which is just there to make code compile in situations the atomic property is not overly important), we require a gross hack to make the generic macros work without using compiler- specific extensions.
* Always block SIGPIPE globallywm42015-05-111-3/+0
| | | | | | | | | | | | | | | OpenSSL and GnuTLS are still causing this problem (although FFmpeg could be blamed as well - but not really). In particular, it was happening to libmpv users and in cases the pseudo-gui profile is used. This was because all signal handling is in the terminal code, so if terminal is disabled, it won't be set. This was obviously a questionable shortcut. Avoid further problems by always blocking the signal. This is done even for libmpv, despite our policy of not messing with global state. Explicitly document this in the libmpv docs. It turns out that a version bump to 1.17 was forgotten for the addition of MPV_FORMAT_BYTE_ARRAY, so document that change as part of 1.16.
* build: exclude -Wredundant-declswm42015-05-091-2/+0
| | | | | | | It's useless, and creates a bogus warning in subprocess-posix.c. Since I don't know which compilers might have it by default, just change it to -Wno-redundant-decls.
* path: make mp_path_join accept normal C stringswm42015-05-092-3/+3
| | | | | Instead of bstr. Most callers of this function do not need bstr. The bstr version of this function is now mp_path_join_bstr().
* subprocess-win: use the correct pipe namespaceJames Ross-Gowan2015-05-041-1/+1
| | | | | | This was a mistake, it should definitely be using the device namespace rather than the file namespace. As it says in the docs, all pipe names must start with \\.\pipe\
* win32: fix desktop directorywm42015-05-031-1/+1
| | | | The folder argument wasn't used, so it always returned the APPDATA dir.
* win32: move platform specifics to osdepwm42015-05-021-0/+28
| | | | | This will probably disable this code for Cygwin. I don't know if this matters, since Cygwin should strictly behave like a Unix anyway.
* build: move main-fn files to osdepwm42015-05-026-7/+76
| | | | | | And split the Cocoa and Unix cases. Simplify the Cocoa case slightly by calling mpv_main directly, instead of passing a function pointer. Also add a comment explaining why Cocoa needs a special case at all.
* cocoa: always compile OSX application code with cocoawm42015-05-023-11/+15
| | | | | | | | | | | | | | This unbreaks compiling command line player and libmpv at the same time. The problem was that doing so silently disabled the OSX application thing - but the command line player can not use the vo_opengl Cocoa backend without it. The OSX application code is basically dead in libmpv, but it's not that much code anyway. If you want a mpv binary that does not create an OSX application singleton (and creates a menu etc.), you must disable cocoa completely, as cocoa can't be used anyway in this case.
* path: update path descriptionswm42015-05-021-1/+2
|
* path: add resolving desktop path to platform-specific pathswm42015-05-013-2/+14
| | | | | | | | | win32 has a special function for this. I'm not sure about OSX - it seems ~/Desktop can be hardcoded, and the OSX GUI actually localizes the _displayed_ path in its UI. For Unix, there is not much to be done, or is there.
* timer: add "static" to a variablewm42015-05-011-1/+1
|
* path: refactorwm42015-05-014-25/+98
| | | | | | | | | | | | | | Somewhat less ifdeffery, higher flexibility. Now there are 3 separate config file resolvers for 3 platforms (unix, win, osx), and they can still interact with each other somewhat. For example, OSX for now uses most of Unix, but adds the OSX bundle path. This can be extended to resolve very specific platform paths, such as location of the desktop. Most of the Unix specific code moves to path-unix.c. The behavior should be the same - if not, it is likely a bug.
* terminal: printf() is not signal-safewm42015-04-241-2/+1
| | | | We shouldn't call it from a signal handler.
* subprocess: move implementation for deatched subprocesseswm42015-04-152-0/+60
|
* subprocess-posix: always connect stdin to /dev/nullwm42015-04-151-1/+12
| | | | | | | | It appears youtube-dl sometimes asks for a password on stdin. This won't work, because mpv already uses the terminal. (I wonder if this could be simpler, like simply closing FD 0, but let's not. The FD would be reused by something random.)
* Update license headersMarcin Kurczewski2015-04-1313-49/+41
| | | | Signed-off-by: wm4 <wm4@nowhere>
* win32: only attach to the console from mpv.comJames Ross-Gowan2015-04-113-13/+44
| | | | | | | | | | | | | | | | | | | Previously, mpv.exe used the --terminal option to decide whether to attach to the parent process's console, which made it impossible to tell whether mpv would attach to the console before the config files were parsed. Instead, make mpv always attach to the console when launched from the console wrapper (mpv.com) and never attach otherwise. This will be useful for the next commit, which will use the presence of the console to decide whether to use the pseudo-gui profile. This change should also be an improvement in behavior. The old code would attach to the parent process's console, regardless of whether it was mpv.com or some other program like cmd.exe. This could be confusing, since mpv.exe is marked as a Windows GUI program and shouldn't write text to its parent process's console when launched directly. (See #768.) Visual Studio does something similar with its devenv.com wrapper. devenv.exe only attaches to the console when launched from devenv.com.
* win32: use a platform-specific unicode entry-pointJames Ross-Gowan2015-04-112-28/+0
| | | | | | | | | | Add a platform-specific entry-point for Windows. This will allow some platform-specific initialization to be added without the need for ugly ifdeffery in main.c. As an immediate advantage, mpv can now use a unicode entry-point and convert the command line arguments to UTF-8 before passing them to mpv_main, so osdep_preinit can be simplified a little bit.
* subprocess-win: clarify argument escaping logicJames Ross-Gowan2015-03-241-8/+8
| | | | This bit always seemed confusing to me.
* subprocess-win: handle empty arguments correctlyJames Ross-Gowan2015-03-241-0/+6
|
* osx: terminate argv properly when arguments are removedwm42015-03-061-1/+4
| | | | | | | The player now relies on the (slightly obscure) requirement that argv is NULL-terminated. Might fix #1652.
* cocoa: silence -Wlogical-op-parenthesesStefano Pigozzi2015-03-041-1/+1
|
* msg: use relaxed atomics for log level testwm42015-03-021-0/+5
| | | | | | This should be sufficient. If stdatomic.h is not available, we make no difference.
* cocoa: remove unused functionStefano Pigozzi2015-02-141-7/+0
|
* cocoa: fix exiting the command line playerwm42015-02-131-4/+3
| | | | | | | | Commit e920a00eb assumed that terminate_cocoa_application() actually would exit. But apparently that is not always the case; e.g. mpv --help will just hang. The old code had a dummy exit(0), which was apparently actually called. Fix by explicitly exiting if mpv_main() returns and terminate_cocoa_application() does nothing.
* osx: move cocoa specific call out of common codewm42015-02-121-0/+2
| | | | This is almost equivalent, and gets rid of the ifdef.
* win32: fix/change application namewm42015-02-092-3/+3
| | | | Pointed out in #935 (again).
* osdep/subprocess-posix: remove __GLIBC__ guardKevin Mitchell2015-02-031-3/+2
| | | | | It's the wrong thing to check. For example it doesn't work on cygwin. Just live with the warning.
* msg: add --log-file optionwm42015-01-262-1/+3
| | | | | | | | | This allows getting the log at all with --no-terminal and without having to retrieve log messages manually with the client API. The log level is hardcoded to -v. A higher log level would lead to too much log output (huge file sizes and latency issues due to waiting on the disk), and isn't too useful in general anyway. For debugging, the terminal can be used instead.
* win32: use monotonic clock on windows if possibleHiltjo Posthuma2015-01-191-0/+10
|
* subprocess-win: Always quote argv[0]James Ross-Gowan2015-01-161-3/+5
| | | | | | | | | | | | | If the program name isn't quoted and the .exe it refers to isn't found, CreateProcess will add the program arguments to the program name and continue searching, so for "program arg1 arg2", CreateProcess would try "program.exe", "program arg1.exe", then "program arg1 arg2.exe". This behaviour is weird and not really desirable, so prevent it by always quoting the program name. When quoting argv[0], escape sequences shouldn't be used. msvcrt, .NET and CommandLineToArgvW all treat argv[0] literally and end it on the trailing quote, without processing escape sequences.
* win32: request UTF-16 API variants, Vista+ APIs, and COM C macroswm42015-01-071-1/+0
| | | | | Put the Vista+ (_WIN32_WINNT) and the COM C (COBJMACROS) defines into the build system, instead of defining them over and over in the code.
* terminal: always print to stderr with --no-input-terminalwm42015-01-071-5/+6
| | | | | | | | | | | | | | | | | The function terminal_in_background() reports whether the player was backgrounded. In this case, we don't want to annoy the user by still printing the status to stderr. If no terminal interaction is assumed, this mechanism is disabled, and stderr is always used. The read_terminal variable signals this case. Oddly, just redirecting stderr will disable output to stderr, because the background check with tcgetpgrp() is done on stderr, but read_terminal is still true (because that one depends on stdin and stdout). Explicitly disable this mechanism if --no-input-terminal is used by setting read_terminal to true only if terminal input is actually initialized.
* player: use libavutil API to get number of CPUswm42015-01-052-67/+0
| | | | | | | | | | | Our own code was introduced when FFmpeg didn't provide this API (or maybe didn't even have a way to determine the CPU count). But now, av_cpu_count() is available for all FFmpeg/Libav versions we support, and there's no reason to have our own code. libavutil's code seems to be slightly more sophisticated than our's, and it's possible that the detected CPU count is different on some platforms after this change.
* subprocess: allow disabling redirection of stdout/stderrwm42015-01-012-6/+10
| | | | | | | | | If the stdout or stderr write callback is NULL, then don't redirect this stream. Preparation for the next commit. Not sure what to do on Windows; it seems STARTUPINFO doesn't allow redirection only one of them. So just let them write nothing. For our intended use-case (next commit), this is probably sensible.
* win32: add native wrappers for pthread functionswm42015-01-013-0/+380
| | | | | | | Off by default, use --enable-win32-internal-pthreads . This probably still needs a lot more testing. It also won't work on Windows XP.
* Update copyright yearwm42015-01-011-1/+1
|
* win32: add mmap() emulationwm42014-12-262-0/+74
| | | | | | | | Makes all of overlay_add work on windows/mingw. Since we now don't explicitly check for mmap() anymore (it's always present), this also requires us to make af_export.c compile, but I haven't tested it.
* client API: document requirement to block SIGPIPEwm42014-12-241-1/+1
| | | | | | | | | I noticed that the IPC code does not use MSG_NOSIGNAL or SO_NOSIGPIPE. The former is "only" POSIX 2008 and also requires switching to sendto(), while the latter is even less portable. Not going to bother with this obsolete 80ies crap, just block SIGPIPE, and instruct client API users to do the same.
* cocoa: ignore first file open events from command lineStefano Pigozzi2014-12-072-0/+9
| | | similar to some of the code deleted in 685b8b7a but simpler
* cocoa: use --idle when running inside bundleStefano Pigozzi2014-12-064-152/+56
| | | | | Previously when using the bundle we used a custom bizarro thing to wait for events. Just use `--idle` and greatly simplify the code.
* cocoa: don't create Dock icon for audio only filesStefano Pigozzi2014-12-051-17/+4
| | | | fixes #635
* cocoa: remove urlencoding for url open eventsStefano Pigozzi2014-12-021-0/+2
| | | | | | This fixes using the mpv:// custom protocol on Yosemite were apparently we receive an url which is automatically urlencoded by the system. /cc mpv-player/stable
* cocoa: fix opening reference URLs (.file/id=)Stefano Pigozzi2014-12-011-2/+4
| | | | | | Fixes #1202 /cc @mpv-player/stable
* subprocess-win: remove a Vista-only flagJames Ross-Gowan2014-11-281-3/+2
| | | | | PIPE_REJECT_REMOTE_CLIENTS isn't supported on XP. It's not really needed, so remove it. Also fix error checking for CreateNamedPipe.
* subprocess: minor cosmetic cleanupwm42014-11-223-5/+9
| | | | | Don't recursively include the whole stream.h header; only include what's minimally needed, and handle the rest with forward declarations.
* lua: subprocess: move to osdep/subprocess-{win,posix}.cJames Ross-Gowan2014-11-223-0/+547
| | | | | | The subprocess code was already split into fairly general functions, separate from the Lua code. It's getting pretty big though, especially the Windows-specific parts, so move it into its own files.
* Catch SIGPIPEwm42014-11-201-0/+3
| | | | | | | | | | | | | | Avoids a crash if OpenSSL tries to write to a broken connection with write(). Obviously OpenSSL really should use send() with MSG_NOSIGNAL, but for some reason it doesn't. This should probably be considered an OpenSSL bug, but since in this case we "own" the process, there is no harm in ignoring the signal. This is not done with libmpv, because as a library we don't want to mess with global state. It's also not done if terminal handling is disabled - this is a bit arbitrary, but I don't care much.
* terminal-unix: Add some comments about FD use.Rudolf Polzer2014-11-131-0/+8
|
* terminal-unix: Fix initial terminal state.Rudolf Polzer2014-11-131-1/+1
| | | | | | When mpv is backgrounded initially (via & in the shell), do no longer change terminal settings on startup. This fixes broken local echo after launching a backgrounded mpv.
* atomics: add atomic_compare_exchange_strong()wm42014-11-091-0/+11
| | | | | | | | | | | | | | | | As usual, we use C11 semantics, and emulate it if <stdatomic.h> is not available. It's a bit messy with __sync_val_compare_and_swap(). We assume it has "strong" semantics (it can't fail sporadically), but I'm not sure if this is really the case. On the other hand, weak semantics don't seem to be possible, since the builtin can't distinguish between the two failure cases that could occur. Also, to match the C11 interface, use of gcc builtins is unavoidable. Add a check to the build system to make sure the compiler supports them (although I don't think there's any compiler which supports __sync_*, but not these extensions). Needed for the following commit.
* win32: silence some warningsJames Ross-Gowan2014-11-081-1/+1
| | | | Signed-off-by: wm4 <wm4@nowhere>
* osdep: potentially fix compilation on OpenBSDwm42014-10-311-0/+1
| | | | | The <pthread_np.h> header expects that <pthread.h> was already included. We were including <pthread.h> only later via our threads.h.
* osdep: add helper for creating a sane pipe()wm42014-10-262-4/+21
| | | | | Or in other words, a pipe that has the CLOEXEC flag set. Needed since Linux' pipe2() is not in POSIX yet.
* terminal: drop ncurses/terminfo/termcap supportwm42014-10-231-386/+3
| | | | | | It was disabled since the last release, and nobody complained loudly. Further details see commit 4b5c3ea7.
* terminal: strictly don't read terminal input if stdout is not a terminalwm42014-10-231-5/+8
| | | | | | | | | | | | | Doing that doesn't make sense anyway: it's meant for interactive input, and if the output of the player is not on the terminal, how will you interact with it? It was also quite in the way when trying to read verbose output with e.g. less while the player was running, because the player would grab half of all input meant for less (simply because stdin is still connected to the terminal). Remove the now redundant special-casing of pipe input.
* win32: change config path prioritieswm42014-10-231-2/+2
| | | | | | | | | | | | | | | | | Assume mpv.exe is located in $mpv_exe_dir, then config files were preferably loaded from "$mpv_exe_dir/mpv". This was mostly traditional, and inherited from MPlayer times. Reverse the config path priority order, and prefer $CSIDL_APPDATA/mpv as main config path. This also fixes behavior when writing watch_later configs, and mpv is installed in a not-writable path. It's possible that this will cause regressions for some users, if the change in preference suddenly prefers stale config files (which may happen to longer around in the appdata config dir) over the user's proper config. Also explicitly document the behavior.
* osdep: NetBSD pthread_setname_np()wm42014-10-221-0/+6
| | | | | | From: bugmen0t on github Fixes #1207.
* osdep: shorten thread name on glibc onlywm42014-10-201-3/+7
| | | | | Instead of affecting every platform, do this for glibc only (where it's known to be a problem), and only if the right error is returned.
* osdep: limit thread names to 16 characterswm42014-10-201-1/+1
| | | | | | | | | | | | | | | | It turns out the glibc people are very clever and return an error if the thread name exceeds the maximum supported kernel length, instead of truncating the name. So everyone has to hardcode the currently allowed Linux kernel name length limit, even if it gets extended later. Also the Lua script filenames could get too long; use the client name instead. Another strange thing is that on Linux, unrelated threads "inherit" the name by the thread they were created. This leads to random thread names, because there's not necessarily a strong relation between these threads (e.g. script command leads to filter recreation -> the filter's threads are tagged with the script's thread name). Unfortunate.
* Set thread name for debuggingwm42014-10-195-0/+25
| | | | | | | | | | Especially with other components (libavcodec, OSX stuff), the thread list can get quite populated. Setting the thread name helps when debugging. Since this is not portable, we check the OS variants in waf configure. old-configure just gets a special-case for glibc, since doing a full check here would probably be a waste of effort.
* win32: remove an unneeded mechanismwm42014-10-192-7/+3
| | | | | Instead of relying on the macro-defined lseek(), just use _lseeki64 directly, and avoid a minor mess.
* win32: remove outdated commentwm42014-10-191-3/+0
|
* win32: get rid of mp_stat in the normal source codewm42014-10-172-7/+54
| | | | | | | | | | | mp_stat() instead of stat() was used in the normal code (i.e. even on Unix), because MinGW-w64 has an unbelievable macro-mess in place, which prevents solving this elegantly. Add some dirty workarounds to hide mp_stat() from the normal code properly. This now requires replacing all functions that use the struct stat type. This includes fstat, lstat, fstatat, and possibly others. (mpv currently uses stat and fstat only.)
* win32: make lseek() fail on pipeswm42014-10-172-0/+19
| | | | | | On MingGW seeking on pipes succeeds. This fix is quite similar to Gnulib's (lib/lseek.c).
* cocoa: allow to disable apple remote at compile timeStefano Pigozzi2014-10-171-0/+9
| | | | | Actually doesn't remove the related flags so that one can still pass the option with the option doing nothing.
* terminal: recognize ^hwm42014-10-171-0/+1
| | | | | | Fixes #1185. CC: @mpv-player/stable
* cocoa: post keydown and keyup events without event monitorStefano Pigozzi2014-10-092-0/+6
| | | | | Our code worked under the assumption that the event monitor is always active and we did remove the keydown and keyup overrides from our cocoa view.
* libmpv/cocoa: don't start the event monitorStefano Pigozzi2014-10-092-10/+21
| | | | | | The event monitor is used to get keyboard events when there is no window, but since it is a global monitor to the current process, we don't want it in a library setting.
* Remove mpbswap.hwm42014-09-251-32/+0
| | | | | | This was once central, but now it's almost unused. Only vf_divtc still uses it for extremely weird and incomprehensible reasons. The use in stream.c is trivial. Replace these, and remove mpbswap.h.
* audio: drop swapped-endian audio formatswm42014-09-231-0/+6
| | | | | | | | | | | | | | | | | | | | Until now, the audio chain could handle both little endian and big endian formats. This actually doesn't make much sense, since the audio API and the HW will most likely prefer native formats. Or at the very least, it should be trivial for audio drivers to do the byte swapping themselves. From now on, the audio chain contains native-endian formats only. All AOs and some filters are adjusted. af_convertsignendian.c is now wrongly named, but the filter name is adjusted. In some cases, the audio infrastructure was reused on the demuxer side, but that is relatively easy to rectify. This is a quite intrusive and radical change. It's possible that it will break some things (especially if they're obscure or not Linux), so watch out for regressions. It's probably still better to do it the bulldozer way, since slow transition and researching foreign platforms would take a lot of time and effort.
* osdep: hack to fix build with low quality pthreads-w32 headerswm42014-09-201-0/+1
| | | | | | | | | | | | | | | | When compiling semaphore_osx.c on win32, the following error happened: /usr/i686-w64-mingw32/include/semaphore.h:160:6: error: unknown type name 'mode_t' This is because this system header references symbols that are not not defined anywhere. This is clearly a bug in pthreads-w32, but has been known and unfixed since 2012, so add a hack to fix it. We build semaphore_osx.c this way because it saves us an extra configure check. On win32, Linux, etc. it's empty and contains "#include <semaphore.h>" only. Should fix #1108.
* osdep/semaphore_osx.c: Include osdep/semaphore.h before #ifdefDiogo Franco (Kovensky)2014-09-101-3/+2
| | | | | osdep/semaphore.h is the file that defines the very #define that is tested in the #ifdef that wraps its inclusion, so it was never compiled.
* osdep: fix windows buildwm42014-09-101-1/+2
| | | | Oops.
* osdep: add POSIX semaphore emulation for OSXwm42014-09-102-0/+179
| | | | | | | | | | | | | | | | | | | | | | | OSX is POSIX conformant, but it's a sad joke: it provides the <semaphore.h> prototype as the standard demands, but they're empty wrappers, and all functions just return ENOSYS. Emulate them similar to how osdep/io.h emulate filesystem functions on Windows. By including the header, working sem_* functions become available. To make it async-signal safe, use a pipe for wakeup (write() is AS-safe, but mutexes can't be). Actually I'm not sure anymore if we really need AS-safety, but for now the emulation can do it. On Linux, the system provides a far more efficient and robust implementation. We definitely want to avoid using the emulation if possible, so this code is active on OSX only. For convenience we always build the source file though, even if the implementation is disabled and no actual code is generated. (Linux provides working semaphores, but is formally not POSIX conformant. On OSX it's the opposite. Is POSIX a complete joke?)
* terminal-unix: don't read from stdin if it's not a terminalwm42014-09-101-1/+1
| | | | | | I'm not quite sure what we should actually do (maybe read input commands?), but interpreting input as terminal key sequences is definitely weird. So just do nothing.
* terminal-unix: move to threadwm42014-09-103-37/+73
| | | | | | | Do terminal input with a thread, instead of using the central select() loop. This also changes some details how SIGTERM is handled. Part of my crusade against mp_input_add_fd().
* terminal-win: minor simplificationwm42014-09-101-2/+2
| | | | Code should be equivalent.
* win32: add tmpfile() replacementJames Ross-Gowan2014-09-052-0/+37
| | | | | | | | | | | The Windows version of tmpfile is actually pretty broken. It tries to create the file in the root directory of the current drive, which means on Vista and up, it normally fails due to insufficient permissions. Replace it with a version that uses GetTempPath. Also remove the Windows-specific note about automatic deletion of the cache file. FILE_FLAG_DELETE_ON_CLOSE is available in NT, and it should be pretty reliable.
* Move compat/ and bstr/ directory contents somewhere elsewm42014-08-294-2/+137
| | | | | | | | | bstr.c doesn't really deserve its own directory, and compat had just a few files, most of which may as well be in osdep. There isn't really any justification for these extra directories, so get rid of them. The compat/libav.h was empty - just delete it. We changed our approach to API compatibility, and will likely not need it anymore.
* bstr: preparation for next commitwm42014-08-291-0/+1
| | | | | | | | Just so I can move this file without modifying its contents in the next commit. compat/compiler.h is to be moved to osdep/ with the next commit, so add a dummy header.
* posix: use STD*_FILENO constantsBen Boeckel2014-08-281-4/+4
| | | | | Rather than "magic" numbers, use meaningful constant names provided by unistd.h.
* win32: correct SGR sequence handlingJames Ross-Gowan2014-08-241-5/+13
| | | | | | This should get colour working again on the Windows console. Fixes #1032.
* win32: correct HANDLE typeJames Ross-Gowan2014-08-243-5/+5
| | | | | The correct type is HANDLE, not HANDLE*, though this change shouldn't affect functionality.
* terminal-unix: new input handling codewm42014-08-211-33/+246
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is independent of terminfo/termcap, and supports more keys. Originally, the goal was just extending the set of supported key sequences, but since the terminfo stuff actually makes this much harder, and since it's a big blob of bloated legacy crap, just drop it. Instead, use hardcoded tables. It's pretty easy to get on the same level as the old code (with fewer LOC), and we avoid additional error situations, such as mallocs which could fail (the old code just ignores malloc failures). We also try to support some xterm escape sequences, which are in relatively widespread use. (I'm not sure about the urxvt ones.) Trying to deal with xterm shift/ctrl/alt modifiers is probably a bit overcomplicated, and only deals with prefixes - xterm randomly uses prefix sequences for some keys, and suffixes for others (what the heck). Additionally, try to drop unknown escape codes. This basically relies on a trick: in almost 100% of all situations, a read() call will actually return complete sequences (possibly because of pipe semantics and atomic writes from the terminal emulator?), so it's easy to drop unknown sequences. This prevents that they trigger random key bindings as the code interprets the part after ESC as normal keys. This also drops the use of terminfo for sending smkx/rmkx. It seems even vt100 (to which virtually everything non-legacy is reasonably compatible with) supports the codes we hardcode, so it should be fine. This commit actually changes only the code if terminfo/termcap are not found. The next commit will make this code default.
* terminal-win: read input from a threadwm42014-08-212-29/+51
| | | | | | | | | Surprisingly, WaitFor* works on console handles. We can simply run the code for reading the console in a thread, and don't have to worry about crazy win32 crap in the rest of the player's input code anymore. This also fixes the issue that you couldn't unpause the player from the terminal, because the player would stop polling for input.
* terminal: some cleanupswm42014-08-213-64/+32
| | | | In particular, remove all the stupid debug printfs from the win code.
* terminal-win: remove nonsensical codewm42014-08-211-9/+0
| | | | | Something about a non-working MinGW thing? Really, I don't care. It also prevents using the console API properly.
* win32: emulate some ANSI terminal escape codeswm42014-08-214-41/+82
| | | | | | | | | | | | | | We already redirect all terminal output through our own wrappers (for the sake of UTF-8), so we might as well use it to handle ANSI escape codes. This also changes behavior on UNIX: we don't retrieve some escape codes per terminfo anymore, and just hardcode them. Every terminal should understand them. The advantage is that we can pretend to have a real terminal in the normal player code, and Windows atrocities are locked away in glue code.
* terminal-unix: eliminate unnecessary variablewm42014-08-201-5/+2
|
* cocoa: move handleFilesArray: to macosx_eventsFRAU KOUJIRO2014-08-064-17/+18
|
* cocoa: move set_input_context to macosx_eventsFRAU KOUJIRO2014-08-064-9/+9
|
* cocoa: sync inputContext inside EventsResponderFRAU KOUJIRO2014-08-063-12/+28
|
* cocoa: decouple events from application somewhatFRAU KOUJIRO2014-08-064-64/+118
|
* Remove the last remains of slave modewm42014-08-013-32/+2
| | | | | | | | | | | Almost nothing was left of it. The only thing this commit actually removes is support for reading input commands from stdin. But you can emulate this via: --input-file=/dev/stdin --input-terminal=no However, this won't work on Windows. Just use a named pipe.
* cocoa: fix key equivalent dispatchingStefano Pigozzi2014-07-302-22/+7
| | | | | | | | | | Prior to this commit we had a list of key modifiers and checked against that. Actually, the Cocoa framework has a built in way to do it and it involves calling performKeyEquivalent: on the menu instance. Fixes #946 cc @mpv-player/stable: this should apply with no conflicts
* osdep: don't assume errno is positivewm42014-07-251-2/+2
| | | | | Apparently this is not necessarily the case, so just drop the silly idea that depended on this assumption.
* cocoa: fix compilation on OS X 10.8Stefano Pigozzi2014-07-142-4/+30
|
* build: deal with endian messwm42014-07-101-0/+31
| | | | | | | | | | | | | | | | | | | | There is no standard mechanism for detecting endianess. Doing it at compile time in a portable way is probably hard. Doing it properly with a configure check is probably hard too. Using the endian definitions in <sys/types.h> (usually includes <endian.h>, which is not available everywhere) works under circumstances, but the previous commit broke it on OSX. Ideally all code should be endian dependent, but that is not possible due to the dependencies (such as FFmpeg, some video output APIs, some audio output APIs). Create a header osdep/endian.h, which contains various fallbacks. Note that the last fallback uses libavutil; however, it's not clear whether AV_HAVE_BIGENDIAN is a public symbol, or whether including <libavutil/bswap.h> really makes it visible. And in fact we don't want to pollute the namespace with libavutil definitions either. Thus it's only the last fallback.
* config: use the same signature for win32/OSX specific path functionswm42014-06-263-8/+12
| | | | | | | | Seems like a good idea, even if it's basically unused (yet). Also document requirements on the functions (they're not obvious). OSX changes untested.
* config: make passing talloc context optional for some functionswm42014-06-262-14/+7
| | | | | | | | | | | | | | | | Until now, the config functions added various allocations to the user- provided talloc context. Make it so that they're all under the returned allocation instead. This allows avoiding having to create an extra temporary context for some callers, and also avoids adding random memory leaks by accidentally passing a NULL context. mp_find_all_config_files() has to be changed not to return a pointer into the middle array for this to work. Make it add paths in order (instead of reverse), and then reverse the array entries after that. Also remove the declarations for the win-specific private functions. Remove STRNULL(); it's barely needed anymore and the functions are not called with NULL filenames anymore.
* Basic xdg directory implementationKenneth Zhou2014-06-263-40/+39
| | | | | | | | | | Search $XDG_CONFIG_HOME and $XDG_CONFIG_DIRS for config files. This also negates the need to have separate user and global variants of mp_find_config_file() Closes #864, #109. Signed-off-by: wm4 <wm4@nowhere>
* win32: implement --priority differentlywm42014-06-122-94/+0
| | | | | | | Does anyone actually use this? For now, update it, because it's the only case left where an option points to a global variable (and not a struct offset).
* input: separate wakeup pipe creation into a separate functionwm42014-05-302-0/+26
| | | | | Error handling is slightly reduced: we assume that setting a pipe to non-blocking can never fail.
* timer: remove unneeded time_t overflow checkwm42014-05-241-12/+1
| | | | | | | This is mostly covered by the OSX workaround, if the timeout is very high. It also means that with systems using 32 bit time_t, the time will overflow 2036 already, instead of 2037, but we don't consider this a problem.
* timer: workaround for crappy operating systemswm42014-05-231-0/+1
| | | | | | | | | | Some operating systems apparently can't deal with really long timeouts in pthread_cond_timedwait(). Passing a time about 300000 in the future makes the call return immediately. (tv_sec/time_t doesn't overflow in this situation.) Reduce the wait time to about 100 days, which seems to work fine. The list of affected OSes follows: OSX
* timer: fix previous commitwm42014-05-221-1/+1
| | | | | Sigh... of course the type of the (?:) exprsssion is double, so INT64_MAX was converted to double, which is a problem.
* timer: improve overflow checkswm42014-05-221-4/+5
| | | | | | | Probably more correct and better readable. Although the special-casing of 0x1p63 is weird in terms of readability (the value itself is INT64_MAX+1, so it's already outside of range, but INT64_MAX is not exactly representable with double precision).
* timer: fix (usually impossible) timespec.tv_sec overflowwm42014-05-221-1/+13
| | | | | | | This usually can't happen, because even if time_us (first input value) is INT64_MAX, the value added to tv_sec will be about 2^43, and tv_sec will be <2^31, far below a possible overflow in 64 bits. But should time_t be 32 bits (32 bit Linux/Windows?), an overflow could happen.
* osdep: silence a -Wshadow warningwm42014-05-211-2/+2
|
* timer: account for negative time valueswm42014-05-181-2/+6
| | | | | | | | It can easily happen that mp_time_us_to_timespec() gets a time in the past, and then the time difference will be negative. Regression introduced in commit f47a4fc3. Also fix an underflow check in mp_add_timeout().
* threads: use mpv time for mpthread_cond_timedwait wrapperwm42014-05-184-53/+87
| | | | | | Use the time as returned by mp_time_us() for mpthread_cond_timedwait(), instead of calculating the struct timespec value based on a timeout. This (probably) makes it easier to wait for a specific deadline.
* terminal: always use SA_RESTART with sigaction()wm42014-04-261-1/+1
| | | | | | | One problem is that for example stdio functions won't restart syscalls manually, and instead treat EINTR as an error. So passing SA_RESTART is the only sane thing to do, unless you have special requirements, which we don't.
* threads: fix function namewm42014-04-232-4/+4
| | | | Closer to the corresponding standard function pthread_cond_timedwait.
* dispatch: move into its own source filewm42014-04-232-249/+0
| | | | | | | This was part of osdep/threads.c out of laziness. But it doesn't contain anything OS dependent. Note that the rest of threads.c actually isn't all that OS dependent either (just some minor ifdeffery to work around the lack of clock_gettime() on OSX).
* glob-win: support UnicodeJames Ross-Gowan2014-04-213-103/+151
| | | | | | | | | | | | | | | | glob-win.c wasn't big, so it was easier to rewrite it. The new version supports Unicode, handles directories properly, sorts the output and puts all its allocations in the same talloc context to simplify the implementation of globfree. Notably, the old glob had error checking code, but didn't do anything with the errors since the error reporting code was commented out. The new glob doesn't copy this behaviour. It just treats errors as if there were no more matching files, which shouldn't matter for mpv, since it ignores glob errors too. To match the other Windows I/O helper functions, the definition is moved to osdep/io.h.
* Kill all tabswm42014-04-132-1865/+1865
| | | | | | | | | | | I hate tabs. This replaces all tabs in all source files with spaces. The only exception is old-makefile. The replacement was made by running the GNU coreutils "expand" command on every file. Since the replacement was automatic, it's possible that some formatting was destroyed (but perhaps only if it was assuming that the end of a tab does not correspond to aligning the end to multiples of 8 spaces).
* client API: add mpv_get_wakeup_pipe convenience functionwm42014-04-122-1/+4
| | | | Should make integreating with some event loops easier. Untested.
* terminal-unix: reject overlong termcap stringswm42014-04-101-0/+3
| | | | | | | | Our own tables have size for only 8 chars, so these sequences must be rejected. It seems strings of length 8 are still ok, because the code uses memcmp and not strcmp, so still allow these. Based on mplayer-svn commit r37129.
* timer: reduce ifdef headsplitting-factorwm42014-03-091-3/+8
| | | | | I'd rather duplicate some trivial code, rather than split functions in the middle with ifdefs.
* timer: switch to CLOCK_MONOTONICwm42014-03-091-0/+10
| | | | | | | | | | | | | | | | | | | | | | | Apparently, this is always _really_ monotonic, despite what the Linux manpages say. So this should be much better than gettimeofday(). (At times there were kernel bugs which broke the monotonic property.) From the perspective of the player, time can still be discontinuous (you could just stop the process with ^Z), but at least it's guaranteed to be monotonic without further hacks required. Also note that clock_gettime() returns the time in nanoseconds. We want microseconds only, because that's the unit we chose internally. Another problem is that nanoseconds can wrap pretty quickly (less than 300 years in 63 bits), so it's just better to use microseconds. The devision won't make the code that much slower (compilers can avoid a real division). Note: this expects that the system provides clock_gettime() as well as CLOCK_MONOTONIC. Both are optional according to POSIX. The only system I know which doesn't have these, OSX, has seperate timer code anyway, but I still don't know whether more obscure (yet supported) platforms have a problem with this, so I'm playing safely. But this still expects that CLOCK_MONOTONIC always works at runtime if it's defined.
* timer: add utility function to get relative timewm42014-02-282-0/+17
|
* threads: fix wait time overflow checkwm42014-02-261-2/+2
| | | | | | | | | | | | | When passing a very large timeout to mpthread_cond_timed_wait(), the calculations could overflow, setting tv_sec to a negative value, and making the pthread_cond_timed_wait() call return immediately. This accidentally made Lua support poll and burn CPU for no reason. The existing overflow check was ineffective on 32 bit systems. tv_sec is usually a long, so adding INT_MAX to it will usually not overflow on 64 bit systems, but on 32 bit systems it's guaranteed to overflow. Simply fix by clamping against a relatively high value. This will work until 1 week before the UNIX time wraps around in 32 bits.
* win32: restore support for exe directory as config directoryelevengu2014-02-141-1/+5
| | | | | | | | Same rationale as b2c2fe7a but updated to work with path-win.c Signed-off-by: wm4 <wm4@nowhere> Merges/closes #543.
* cocoa: fix deadlock during initialization [2]Stefano Pigozzi2014-02-131-6/+3
| | | | Fixup commit for 20fa191ad.
* cocoa: fix deadlock during initializationStefano Pigozzi2014-02-131-1/+2
| | | | | | Thanks to @wm4 for catching the bug. Fixes #405
* timer: init only oncewm42014-02-102-3/+18
| | | | | | | | | | This avoids trouble if another mpv instance is initialized in the same process. Since timeBeginPeriod/timeEndPeriod are hereby not easily matched anymore, use an atexit() handler to call timeEndPeriod, so that we can be sure these calls are matched, even if we allow multiple initializations later when introducing the client API.
* threads: add a dispatch queue thingwm42014-02-102-0/+250
| | | | | | Makes working with the (still) single-threaded playback thread easier. Might be reusable for other stuff.
* threads: avoid timeout calculation overflowwm42014-02-101-0/+3
| | | | | | | | | It's quite possible to overflow the calculation by setting the timeout to high values. Limit it to INT_MAX, which should be safe. The issue is mainly the secs variable. timespec.tv_sec will normally be 64 bit on sane systems, and we assume it can't overflow by adding INT_MAX to it.
* io: make MP_PATH_MAX private to win32 codewm42014-02-032-12/+10
| | | | | The win32 code is the only thing which actually needs this (and it's used to make emulation of UTF-8 filename APIs easier).
* threads: add function to calculate deadline for timed waitswm42014-01-312-3/+14
| | | | | | | | | | | | Usually, you have to call pthread_cond_timedwait() in a loop (because it can wake up sporadically). If this function is used by another higher level function, which uses a relative timeout, we actually have to reduce the timeout on each iteration - or, simpler, compute the "deadline" at the beginning of the function, and always pass the same absolute time to the waiting function. Might be unsafe if the system time is changed. On the other hand, this is a fundamental race condition with these APIs.
* threads: add wrapper for initializing recursive mutexeswm42014-01-312-0/+13
| | | | Damn this overly verbose pthread API.
* cocoa: sort files opened from Finder the same way Finder doesBilal Syed Hussain2014-01-201-1/+2
| | | | Fixes #497
* w32: use the w32_common keymap in terminal-win tooJames Ross-Gowan2014-01-193-40/+130
|
* io/win32: move mp_attach_console to terminal-win.cMartin Herkt2014-01-163-23/+17
| | | | Why didn't I put it there from the start?
* cocoa: add application icon to the Dock when run from CLIStefano Pigozzi2014-01-141-0/+16
| | | | | | | | | | Application icon was added to the Dock only when run inside of a bundle. That was handled automatically by OS X using the Info.plist definition. To add the Application icon when run as a CLI program, I used the samme approach in the X11 code and loaded the icon as a static binary blob inside of mpv's binary. This is the simplest approach as it avoid headackes when relocating the binary and such.
* terminal-unix: fix terminfo/termcap name for cursor upwm42014-01-141-1/+1
| | | | | "ku" is for input, not output. This happened to work on urxvt, but broke on xterm (and probably a dozen of other terminals).
* terminal-unix: add fallback for enter keywm42014-01-131-0/+3
| | | | This worked just fine if terminfo or termcap was available.
* terminal-unix: fix fallbacks in case terminfo/termcap are disabledwm42014-01-131-2/+2
| | | | | These two escape sequences were swapped. (They are used only if terminfo/termcap are not available.)
* terminal-unix: add termcap/terminfo documentation linkswm42014-01-131-0/+4
| | | | | | | Apparently, some people are not clever enough to google this information. Proper googling to find these links done by Kovensky.
* player: redo terminal OSD and status line handlingwm42014-01-133-8/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The terminal OSD code includes the handling of the terminal status line, showing player OSD messages on the terminal, and showing subtitles on terminal (the latter two only if there is no video window, or if terminal OSD is forced). This didn't handle some corner cases correctly. For example, showing an OSD message on the terminal always cleared the previous line, even if the line was an important message (or even just the command prompt, if most other messages were silenced). Attempt to handle this correctly by keeping track of how many lines the terminal OSD currently consists of. Since there could be race conditions with other messages being printed, implement this in msg.c. Now msg.c expects that MSGL_STATUS messages rewrite the status line, so the caller is forced to use a single mp_msg() call to set the status line. Instead of littering print_status() all over the place, update the status only once per playloop iteration in update_osd_msg(). In audio- only mode, the status line might now be a little bit off, but it's perhaps ok. Print the status line only if it has changed, or if another message was printed. This might help with extremely slow terminals, although in audio+video mode, it'll still be updated very often (A-V sync display changes on every frame). Instead of hardcoding the terminal sequences, use terminfo/termcap to get the sequences. Remove the --term-osd-esc option, which allowed to override the hardcoded escapes - it's useless now. The fallback for terminals with no escape sequences for moving the cursor and clearing a line is removed. This somewhat breaks status line display on these terminals, including the MS Windows console: instead of querying the terminal size and clearing the line manually by padding the output with spaces, the line is simply not cleared. I don't expect this to be a problem on UNIX, and on MS Windows we could emulate escape sequences. Note that terminal OSD (other than the status line) was broken anyway on these terminals. In osd.c, the function get_term_width() is not used anymore, so remove it. To remind us that the MS Windows console apparently adds a line break when writint the last column, adjust screen_width in terminal- win.c accordingly.
* terminal: don't initialize termcap etc. if stdout is not a terminalwm42014-01-071-2/+6
| | | | | Otherwise, it seems one of the term* libraries will write escape sequences to stdout, for whatever reason.
* Windows: use roaming AppData instead of localMartin Herkt2014-01-061-1/+1
| | | | Whatever. Fixes #458.
* win32-console-wrapper: use child process exit codeMartin Herkt2014-01-061-4/+6
|
* win32-console-wrapper: remove command line manglingMartin Herkt2014-01-061-11/+2
| | | | This wasn't really necessary and caused a lot of problems.
* win32-console-wrapper: Fix heap corruptionMartin Herkt2014-01-061-1/+1
| | | | FUCK the Windows API.
* cocoa: handle files drag and drop on the player video viewStefano Pigozzi2014-01-041-0/+1
|
* cocoa: refactor files drag and drop on the Dock iconStefano Pigozzi2014-01-041-24/+16
| | | | | Use the newly added `mp_event_drop_files` core function instead of having logic in the platform dependent code.
* Add Windows console wrapper program (mpv.com)Martin Herkt2014-01-021-0/+83
|
* Windows: use the GUI subsystem, attach to consoleMartin Herkt2014-01-022-0/+23
| | | | | | | | This is necessary to start mpv without forcing a console window, but also breaks console usability. A workaround is to call mpv from a wrapper process that uses the console subsystem and helps redirecting the standard streams and WriteConsole output to where they belong.
* osdep/io, mp_vfprintf: split out console detectionMartin Herkt2014-01-021-42/+43
|
* Update copyright yearwm42014-01-011-1/+1
|
* path-macosx: attempt to fix buildwm42013-12-221-1/+1
| | | | Untested... no OSX here.
* macosx_application: replace mp_msg with stderr for semi-fatal errorwm42013-12-211-3/+4
| | | | Apparently this should never be run anyway.
* path lookup functions: mp_msg conversionswm42013-12-212-3/+7
| | | | | | | | | | | | | | | | | There's a single mp_msg() in path.c, but all path lookup functions seem to depend on it, so we get a rat-tail of stuff we have to change. This is probably a good thing though, because we can have the path lookup functions also access options, so we could allow overriding the default config path, or ignore the MPV_HOME environment variable, and such things. Also take the chance to consistently add talloc_ctx parameters to the path lookup functions. Also, this change causes a big mess on configfiles.c. It's the same issue: everything suddenly needs a (different) context argument. Make it less wild by providing a mp_load_auto_profiles() function, which isolates most of it to configfiles.c.
* input: rework how input sources are addedwm42013-12-213-20/+48
| | | | | | | | | | | | | | Until now, there were two functions to add input sources (stuff like stdin input, slave mode, lirc, joystick). Unify them to a single function (mp_input_add_fd()), and make sure the associated callbacks always have a context parameter. Change the lirc and joystick code such that they take store their state in a context struct (probably worthless), and use the new mp_msg replacements (the point of this refactoring). Additionally, get rid of the ugly USE_FD0_CMD_SELECT etc. ifdeffery in the terminal handling code.
* osdep/priority: drop message output when setting prioritywm42013-12-211-2/+0
|
* terminal: abstract terminal color handlingwm42013-12-203-9/+75
| | | | | | | | Instead of making msg.c an ifdef hell for unix vs. windows code, move the code to separate functions defined in terminal-unix.c/terminal- win.c. Drop the code that selects random colors for --msgmodule prefixes.
* terminal: move SIGTTOU signal handler setup codewm42013-12-191-0/+2
| | | | | | This comes with a real change in behavior: now the signal handler is set only when the terminal input code is active (e.g. not with --no-consolecontrols), but this should be ok.
* Rename getch2....c/h to terminal....c/hwm42013-12-193-2/+2
| | | | | "getch2" really tells nothing about what the heck this code does. It'd be even worse when moving the rest of terminal handling code there.
* Reduce recursive config.h inclusions in headerswm42013-12-182-3/+0
| | | | | | In my opinion, config.h inclusions should be kept to a minimum. MPlayer code really liked including config.h everywhere, though, even in often used header files. Try to reduce this.
* stream: move O_BINARY dummy definitionwm42013-12-181-0/+4
|
* Fix OSX build; remove all remaining mpvcore references11rcombs2013-12-173-5/+5
|
* Split mpvcore/ into common/, misc/, bstr/wm42013-12-173-4/+4
|
* Merge mp_talloc.h into ta/ta_talloc.hwm42013-12-171-4/+2
|
* Move options/config related files from mpvcore/ to options/wm42013-12-171-1/+1
| | | | | | | | | Since m_option.h and options.h are extremely often included, a lot of files have to be changed. Moving path.c/h to options/ is a bit questionable, but since this is mainly about access to config files (which are also handled in options/), it's probably ok.
* Move mpvcore/input/ to input/wm42013-12-173-5/+5
|
* Replace mp_tmsg, mp_dbg -> mp_msg, remove mp_gtext(), remove set_osd_tmsgwm42013-12-161-1/+1
| | | | | | | | | The tmsg stuff was for the internal gettext() based translation system, which nobody ever attempted to use and thus was removed. mp_gtext() and set_osd_tmsg() were also for this. mp_dbg was once enabled in debug mode only, but since we have log level for enabling debug messages, it seems utterly useless.
* macosx_events: fix null dereference on uninitStefano Pigozzi2013-12-071-1/+4
| | | | | | | Bug introduced by commit 6fb020f5. It doesn't always happen, since it is caused by the playloop and cocoa UI code running in separate threads. Fixes #398.
* options: add option to disable using right Alt key as Alt GrVivek Jain2013-12-021-2/+8
| | | | | | | | | mpv was hardcoded to always consider the right Alt key as Alt Gr, but there are parituclar combinations of platforms and keyboard layouts where it's more convenient to treat the right Alt as a keyboard modifier just like the left one. Fixes #388
* osdep/io: also include unistd.hwm42013-11-301-0/+2
| | | | Might be needed by fcntl() usage.
* Use O_CLOEXEC when creating FDswm42013-11-302-1/+28
| | | | | | | | | | | | | | This is needed so that new processes (created with fork+exec) don't inherit open files, which can be important for a number of reasons. Since O_CLOEXEC is relatively new (POSIX.1-2008, before that Linux specific), we #define it to 0 in io.h to prevent compilation errors on older/crappy systems. At least this is the plan. input.c creates a pipe. For that, add a mp_set_cloexec() function (which is based on Weston's code in vo_wayland.c, but more correct). We could use pipe2() instead, but that is Linux specific. Technically, we have a race condition, but it won't matter.
* build: make pthreads mandatorywm42013-11-281-7/+0
| | | | | | | | | | | pthreads should be available anywhere. Even if not, for environment without threads a pthread wrapper could be provided that can't actually start threads, thus disabling features that require threads. Make pthreads mandatory in order to simplify build dependencies and to reduce ifdeffery. (Admittedly, there wasn't much complexity, but maybe we will use pthreads more in the future, and then it'd become a real bother.)
* switch the build system to wafStefano Pigozzi2013-11-211-1/+0
| | | | | | | | | | | | | | | | | | | | | | | This commit adds a new build system based on waf. configure and Makefile are deprecated effective immediately and someday in the future they will be removed (they are still available by running ./old-configure). You can find how the choice for waf came to be in `DOCS/waf-buildsystem.rst`. TL;DR: we couldn't get the same level of abstraction and customization with other build systems we tried (CMake and autotools). For guidance on how to build the software now, take a look at README.md and the cross compilation guide. CREDITS: This is a squash of ~250 commits. Some of them are not by me, so here is the deserved attribution: - @wm4 contributed some Windows fixes, renamed configure to old-configure and contributed to the bootstrap script. Also, GNU/Linux testing. - @lachs0r contributed some Windows fixes and the bootstrap script. - @Nikoli contributed a lot of testing and discovered many bugs. - @CrimsonVoid contributed changes to the bootstrap script.
* osdep/io.c: include config.hwm42013-11-201-0/+2
| | | | | This possibly enables code that has never been tested before (accidentally), so let's hope this works out ok.
* stream: split out pthread helper functionwm42013-11-172-0/+66
| | | | Also split the function itself into 3.
* osdep: handle SIGTERMwm42013-11-061-0/+2
| | | | | | There's no reason why we should e.g. handle SIGQUIT, but not SIGTERM. Note that sending SIGTERM twice still kills the player.
* osx: fix -Wshadow warnings on platform specific codeStefano Pigozzi2013-11-041-4/+4
|
* configure: uniform the defines to #define HAVE_xxx (0|1)Stefano Pigozzi2013-11-033-16/+17
| | | | | | | | | | | | | | | | | | | | | The configure followed 5 different convetions of defines because the next guy always wanted to introduce a new better way to uniform it[1]. For an hypothetic feature 'hurr' you could have had: * #define HAVE_HURR 1 / #undef HAVE_DURR * #define HAVE_HURR / #undef HAVE_DURR * #define CONFIG_HURR 1 / #undef CONFIG_DURR * #define HAVE_HURR 1 / #define HAVE_DURR 0 * #define CONFIG_HURR 1 / #define CONFIG_DURR 0 All is now uniform and uses: * #define HAVE_HURR 1 * #define HAVE_DURR 0 We like definining to 0 as opposed to `undef` bcause it can help spot typos and is very helpful when doing big reorganizations in the code. [1]: http://xkcd.com/927/ related
* getch2: assume EOF when input file descriptor is invalidwm42013-10-281-2/+5
| | | | | | | | | | | | | When starting mpv with nohup, file descriptor 0 seems to be invalid for some reason. (I'm not quite sure why it should be... /proc/pid/fd/0 seems to indicate it's just /dev/null, and using /dev/null explicitly shows that it works just fine.) select() will always immediately return, and this causes mpv to burn CPU without reason. Fix this by treating it as EOF when read() returns EBADF. Also add EINVAL to this condition, because it seems like a good idea.
* getch2: move global state to file scope variableswm42013-10-281-6/+5
| | | | | Using static variables for mutable state inside functions is a bad idea, because it's not immediately obvious that it is what it is.
* cocoa: fix opening quarantined files on 10.9 with the bundle [2]Stefano Pigozzi2013-10-251-2/+2
| | | | Fixup commit for bbc146927
* cocoa: fix opening quarantined files on 10.9 with the bundleStefano Pigozzi2013-10-241-2/+7
| | | | | | | It looks like on Mavericks the Finder is passing different arguments to mpv depending on whether the opened file is quarantined or not. Fixes #285
* cocoa: fix race condition with input context creationStefano Pigozzi2013-10-242-0/+14
| | | | | | | | | | This seems to be a problem only in OS X 10.9. I guess they improved the general speed of the Cocoa startup and suddenly mpv core takes more time than the Cocoa thread to initialize. Fixes #285 (hopefully!)
* getch2: remove pointless ifdefferywm42013-10-171-8/+0
| | | | | Apparently this was for MorphOS. If you really want to use that, ask the devs to provide dummy headers and declarations for ioctl() instead.
* Copyright, LICENSE: switch to GPL version 2 or laterwm42013-10-131-1/+1
| | | | | | | | | | | | | | | Now that talloc has been removed, the license can be switched back to GPLv2+. Actually, there never was a GPLv2+ licensed MPlayer (fork or not) until now, but removal of some GPLv2-only code makes this possible now. Rewrite the Copyright file to explain the reasons for the licenses MPlayer and forks use. The old Copyright file didn't contain anything interesting anymore, and all information it contained is available at other places in the source tree. The reason for the license change itself is that it should improve interoperability with differently licensed code in general. This essentially reverts commit 1752808.
* osx: fix buildwm42013-09-271-2/+2
| | | | | | Or at least I hope it fixes it, since I can't test. Broken by commit 0d90dd0.
* win32: edit resource files, in particular set CompanyNamewm42013-09-232-5/+5
| | | | | | | Setting CompanyName (probably) helps with issue #256. Update some other fields as well, because why not. (They're full of MPlayer remnants.)
* macosx_application: fix regression causing crashStefano Pigozzi2013-09-191-2/+11
| | | | | 95a2151d1 introduced a crash on systems lower than 10.9 when opening files with a single argument.
* osdep/path: remove ifdefswm42013-09-181-6/+0
| | | | They're not really needed, so kill them.
* macosx: move bundle path stuff to path-macosx.mStefano Pigozzi2013-09-183-33/+14
| | | | This makes the code uniform to how stuff was handled for Windows in 1cb55ceb.
* path, win32: redo user configfile path handlingwm42013-09-183-2/+86
| | | | | | | | | | | | | | | | | Remove the ifdef hell from mp_find_user_config_file(). Move the win32 specific code (for MinGW and Cygwin) to path-win.c. The behavior should be about the same, but I can't be sure due to lack of testing and because the old path.c code was hard to follow. (I expect those who care about windows will fix things, should issues pop up - sorry.) One difference is that the new code will always force MPV_HOME. It looks like the old code preferred the mpv config dir in the exe dir if it exists. Also, make sure MP_PATH_MAX has enough space, even if the equivalent wchar_t string is not 0-terminated with PATH_MAX (because apparently the winapi doesn't require this). (Actually, maybe we should just kill all uses of PATH_MAX/MP_PATH_MAX.)
* win32: add getenv() UTF-8 variantwm42013-09-182-0/+62
| | | | | | | This is a bit "hard", because getenv() returns a static string, and we can't just return an allocated string. We also want getenv() to be thread-safe if possible. (If the mpv core is going to be more threaded, we sure do want the lower layers to be thread-safe as well.)
* HIDRemote: remove OS X version checksStefano Pigozzi2013-09-171-44/+1
| | | | | | Turns out that these checks were for versions of OS X that mpv doesn't even support anymore. So just remove the checks since they cause a deprecation warning.
* macosx_application: remove deprecation warning on OS X 10.9Nyx0uf2013-09-161-15/+29
| | | | | | | | | | | | GetCurrentProcess() is deprecated on 10.9. Make a universal solution by checking OS version number. get_system_version() function is the recommended Apple way of getting the OS version, since Gestalt is also deprecated (and does pretty much the same thing anyway) Updating HIDRemote.m to use a similar function would allow to get rid of the 2 other warnings.
* macosx_application: fix file opening on 10.9 (for real this time)Stefano Pigozzi2013-09-131-1/+1
| | | | | | | | I did commit 86c05655d by thinking `mpv` already removed the `mpv` from argc/argv. It actually is still there, so the argc must be 1 to check for no arguments. Thanks to @Nyx0uf for pointing out the bug and for testing on 10.9!
* macosx_application: fix file opening on OS X 10.9 (hopefully)Stefano Pigozzi2013-09-121-1/+10
| | | | | | | | File opening through Finder, apparently drops `--psn` arguments on Mavericks and just uses no args. Modify the code to account for that case. This wasn't tested on 10.9 itself (I don't have a paid dev account), but it *should* work if I understood the problem correctly.
* macosx_application: handle mpv:// linksStefano Pigozzi2013-09-071-0/+7
| | | | | | | Pretty useful for people writing userscripts for web browsers. Links starting with 'mpv://' are forwarded to the mpv OSX bundle. The leading 'mpv://' is stripped from the recived url and the rest of the string is inserted as is in the playlist.
* macosx_application: handle URL events as fileopen eventsStefano Pigozzi2013-09-071-0/+30
| | | | | This allows to open URLs directly with mpv. This is useful for streaming and libquvi supported sites.
* macosx_events: fix modifiers handling with media keysStefano Pigozzi2013-09-051-1/+1
| | | | | | This was caused by a typo. Regression from add7c2955df. Fixes #213
* macosx_events: send a `release all` after key up eventsStefano Pigozzi2013-09-021-0/+2
| | | | | | | | This prevents keys to become stuck due to changing keyboard modifiers during the key down. Not the prettiest approach but event `x11_common` does it like this. Fixes #210
* macosx_events: remove duplicationStefano Pigozzi2013-09-021-29/+33
| | | | refactoring: extract method `handleMPKey:withMask:`
* cocoa: enqueue events only if input context is presentStefano Pigozzi2013-09-011-1/+2
|
* osx: use MP_KEY_* instead of MK_* for media keysStefano Pigozzi2013-09-011-3/+3
| | | | | In 213ad5d6c I added `MK_*` key bindings overlooking the fact that mpv already has `MP_KEY_*` for media keys.
* cocoa: let the core handle key repeatsStefano Pigozzi2013-08-303-6/+17
| | | | | Report key down and key up modifiers to the core so that it can issue it's own key repeats (instead of relying on Cocoa's ones).
* macosx: remove platform specific input queueStefano Pigozzi2013-08-134-65/+3
| | | | | Since last commit the input queue in the core is thread safe, so there is no need for all this platform specific stuff anymore.
* core: move contents to mpvcore (2/2)Stefano Pigozzi2013-08-068-14/+14
| | | | Followup commit. Fixes all the files references.
* mpv.rc: update Windows iconJames Ross-Gowan2013-07-301-1/+1
| | | | Based on the OSX bundle icon.
* getch2: Load the "ce", "ks" and "ke" caps into a static bufferDiogo Franco (Kovensky)2013-07-261-3/+6
| | | | | | Fixes reports of printing of garbage (or anything else) other than clearing the status line to the end of line: the buffer returned by termcap_get could get moved, and if that happened then these 3 caps pointed to garbage.
* getch2: Deactivate getch2 on SIGINT; also handle SIGQUITDiogo Franco (Kovensky)2013-07-261-0/+4
|
* getch2: Only send ESC if it was typed twiceDiogo Franco (Kovensky)2013-07-261-3/+5
| | | | Avoids quitting mpv if any unknown escape is entered.
* getch2: Handle setupterm errorsDiogo Franco (Kovensky)2013-07-261-1/+18
| | | | | | setupterm abort()s if it can't initialize the terminal and the last parameter is NULL; handle setupterm errors and retry with "ansi" if the TERM env var was unset.
* getch2: fix compilationwm42013-07-261-1/+1
|
* getch2: Support ESC keypresses againDiogo Franco (Kovensky)2013-07-251-1/+9
| | | | | | Due to the termcap matching and the hardcoded fallbacks, the ESC keypress has to be followed by another non-matching keypress (such as another ESC) for it to be accepted. We drop the second ESC in case it was typed twice.
* getch2: Doing it right this timeDiogo Franco (Kovensky)2013-07-251-1/+1
| | | | | getch2_pos should be set to 1, not 0, when backtracking. Avoids the possible infinite loop but correctly.
* Revert "getch2: Avoid possible infinite loop"Diogo Franco (Kovensky)2013-07-251-4/+4
| | | | This reverts commit ba95aed6f1067dc577d8813625233982157167d9.
* getch2: Avoid possible infinite loopDiogo Franco (Kovensky)2013-07-251-4/+4
| | | | | | If the first character is not a valid UTF-8 start code nor is in termcap, getch2 would enter an infinite loop. Always walk 1 byte in the UTF-8 case unless it's a valid start code.
* getch2, mplayer: Always call load_termcapDiogo Franco (Kovensky)2013-07-251-0/+5
| | | | | getch2 now deals with the cases where we don't have termcap. Add a dummy load_termcap to getch2-win so we don't get linking errors on mingw.
* getch2: Remove unused function, fix possible crashDiogo Franco (Kovensky)2013-07-251-25/+19
| | | | | | | | | If we still haven't read the full key from the input but it's regardless a unique match in the database, we could receive a NULL keycode from keys_search (it's not a full match after all) and proceed to use it. Don't disable the keycode matching code if we don't have termcap as we can still match against the hardcoded sequences.
* getch2: Refactor/rewriteDiogo Franco (Kovensky)2013-07-251-192/+344
| | | | | | | | | | | | | | | | | | | | | | Still uses termcap, but uses terminfo for loading the termcap database if possible. Adds configure test to find terminfo; skips the termcap test if terminfo is found since terminfo provides termcap. Use termcap completely for special keys; if we can't get it from termcap and it isn't one of the known fallbacks, we ignore its specialness and treat as a sequence of UTF-8 codes. Further hardcoded fallbacks can be added by calling keys_push_once in load_termcap; there is no limit to the amount of keys pushed. Uses the "ke" and "ks" capabilities to start / exit application mode, which is necessary on vt100 emulators (including screen, xterm and all terminals that emulate either of those) to correctly receive arrow keys. It's now possible to compile getch2 even without termcap, though it won't be of much use since it'll be unable to detect special keys. Converted to 4 spaces per tab, prettified some statements.
* cocoa_common: handle keyboard modifiers for mouse eventsStefano Pigozzi2013-07-213-13/+24
|
* w32: update manifest for high DPI and Windows 8.1James Ross-Gowan2013-07-141-0/+18
| | | | | | | | | | | | | | | | | Since Windows Vista, when running at 144 DPI or higher with composition switched on, applications that don't declare themselves to be DPI aware are stretched by the window manager, kind of like low resolution apps in OSX. To avoid this, declare DPI awareness in the manifest. Since mpv is practically resolution independent this shouldn't cause any trouble. The 'True/PM' value declares per-monitor DPI awareness in Windows 8.1, so that the mpv isn't shrunk when moved from a high DPI screen to one with a lower DPI. Also, avoid compatibility shims by declaring compatibility with all Windows versions from Vista to 8.1 and add the missing uiAccess attribute to the requestedExecutionLevel element.
* getch2-win: uncrustifywm42013-07-141-116/+118
|
* osdep: remove unused mmap compatibility hackswm42013-07-073-168/+0
| | | | | | | Not sure how this worked. Only af_export.c and tvi_v4l2.c were using mmap, but they didn't include osdep/mmap.h or mmap_anon.h. In any case, we trust that the target system is sufficiently POSIX compliant if mmap is actually defined (as checked by configure).
* cocoa: remove usage of mp_fifoStefano Pigozzi2013-07-034-11/+2
| | | | | | Update Cocoa parts to remove usage of the mp_fifo internal API to send events to the core and use the input context directly. This is to follow commits the work in commits 70a8079c and d603e73c.
* core: cleanup more mp_fifo leftoverswm42013-07-023-8/+6
| | | | Now only the OSX and Wayland parts are using this.
* OSX: fix compilation with 10.7 SDKStefano Pigozzi2013-06-193-1/+61
| | | | | | | | | | | | | | | | | | | | | | | | Recent work in the OS X parts of the code started using clang's support for Obj-C's support for Literals and Subscripting. These particular language features remove a lot of boilerplate code and allow to interact with collections as consicely as one would do in scripting languages like Ruby or Python. Even if these are compiler features, Subscripting needs some runtime support. This is provided with libarclite (coming with the compiler), but we need to add the proper method definitions since the 10.7 SDK headers do not include them. That is because 10.7 shipped before this language features. This will cause some warnings when compiling with the 10.7 SDK because the commit also redefines BOOL to make autoboxing/unboxing of BOOL literals to work. If you need to test this for whatever reason on 10.8, just pass in the correct SDK to configure's extra cflags: ./configure --extra-cflags='-mmacosx-version-min=10.7 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk' Fixes #117
* osdep: remove shmem wrapperwm42013-06-182-164/+0
| | | | This is unused now that the cache is always threaded.
* macosx_events: handle key modifiers with media keysStefano Pigozzi2013-06-062-27/+56
| | | | | | This was overlooked in the previous inplementation. Adding it required some refactoring of the `handleKeyDown:` method in order to extract common parts with `handleMediaKey:`.
* macosx_events: DRY up key lookup over dictionaryStefano Pigozzi2013-06-051-10/+12
| | | | | Two methods duplicated very similar behaviour. Extract method with the common behaviour.
* macosx_events: make remote property an instance variableStefano Pigozzi2013-06-052-7/+8
| | | | There was no reason for it to be public.
* osx: improve Media Keys supportStefano Pigozzi2013-06-044-31/+109
| | | | | | | | | | | | | | | | | | | | | | | This commit addresses some issues with the users had with the previous implementation in commit c39efb9. Here's the changes: * Use Quartz Event Taps to remove Media Key events mpv handles from the global OS X queue. This prevents conflicts with iTunes. I did this on the main thread since it is mostly idling. It's the playloop thread that actually does all the work so there is no danger of blocking the event tap callback. * Introduce `--no-media-keys` switch so that users can disable all of mpv's media key handling at runtime (some prefer iTunes for example). * Use mpv's bindings so that users can customize what the media keys do via input.conf. Current bindings are: MK_PLAY cycle pause MK_PREV playlist_prev MK_NEXT playlist_next An additional benefit of this implementation is that it is completly handled by the `macosx_events` file instead of `macosx_application` making the project organization more straightforward.
* osx: add Apple Remote supportStefano Pigozzi2013-06-035-3/+2512
| | | | | | | | | | | | | | | | | After killing the non functional AR support in c8fd9e5 I got much complaints so this adds AR support back in (and it works). I am using the HIDRemote class by Felix Schwarz and that part of the code is under the BSD license. I slightly modified it replacing [NSApplication sharedApplication] with NSApp. The code of the class is quite complex (probably because it had to deal with all the edge cases with IOKit) but it works nicely as a black box. In a later commit I'll remove the deprecation warnings caused by HIDRemote's usage of Gestalt. Check out `etc/input.conf` for the default bindings. Apple Remote functionality is automatically compiled in when cocoa is enabled. It can be disabled at runtime with the `--no-ar` option.
* osx: implement media keysStefano Pigozzi2013-06-033-1/+33
| | | | | | | | | | | | | | | Media keys are pretty handy if you use mpv as a music player (yes I'm one of those people that do). These are the bindings (which lead to the same behaviour as iTunes): * NX_KEYTYPE_PLAY -> MP_KEY_PLAY * NX_KEYTYPE_FAST -> MP_KEY_NEXT * NX_KEYTYPE_REWIND -> MP_KEY_PREV I just handled these ones as the volume one would be pretty invasive. I could maybe change it to increase the application's volume instead of system volume only when mpv is frontmost (iTunes does this), but some users would probably hate it.
* macosx_events: send all queued eventsStefano Pigozzi2013-06-031-2/+3
| | | | | Seeking feels a little faster or it may be self suggestion. There's really no reason to just send only one event at a time.
* osx: cocoa_common: use default wakeup periodStefano Pigozzi2013-06-031-0/+8
| | | | | Now that Cocoa's input handling is done on a separate thread from the playloop it is ridicolously simple to have longer asynchronous sleeps when paused.
* osx: create macosx_events to deal with keyDown eventsStefano Pigozzi2013-06-035-26/+268
| | | | | | On OSX with Cocoa enabled keyDown events are now handled with addLocalMonitorForEventsMatchingMask:handler:. This allows to respond to events even when there is no VO initialized but the GUI is focused.
* macosx_application: refactor psn matching codeStefano Pigozzi2013-05-301-7/+5
| | | | Objective-C is shorter / more readable than snprintf.
* macosx_application: refactor filename escapeStefano Pigozzi2013-05-301-14/+8
| | | | Use Objective-C's new literal syntax to make the code simpler.
* macosx_application: use @autoreleasepoolStefano Pigozzi2013-05-302-35/+25
| | | | I don't even want to know how this worked. It scares me a lot.
* macosx_application: move escape_loadfile_name in this fileStefano Pigozzi2013-05-301-0/+21
| | | | This allows to move back osx_common to raw C.
* macosx_application: fix menu 'ghosting'Stefano Pigozzi2013-05-261-0/+7
| | | | | | | This fixes a bug that caused the application to never leave it's frontmost position. The idea is stolen from @donmelton who used it in MPlayerShell. Thanks!
* Replace calls to usec_sleep()wm42013-05-262-9/+0
| | | | | | This is just dumb sed replacement to mp_sleep_us(). Also remove the now unused usec_sleep() wrapper.
* Replace all calls to GetTimer()/GetTimerMS()wm42013-05-262-12/+0
| | | | | | | | | | | | | | | | | | | | | | GetTimer() is generally replaced with mp_time_us(). Both calls return microseconds, but the latter uses int64_t, us defined to never wrap, and never returns 0 or negative values. GetTimerMS() has no direct replacement. Instead the other functions are used. For some code, switch to mp_time_sec(), which returns the time as double float value in seconds. The returned time is offset to program start time, so there is enough precision left to deliver microsecond resolution for at least 100 years. Unless it's casted to a float (or the CPU reduces precision), which is why we still use mp_time_us() out of paranoia in places where precision is clearly needed. Always switch to the correct time. The whole point of the new timer calls is that they don't wrap, and storing microseconds in unsigned int variables would negate this. In some cases, remove wrap-around handling for time values.
* timer: use gettimeofday() on Windowswm42013-05-261-1/+4
| | | | | | | MinGW-w64 emulates this via GetSystemTimeAsFileTime(), which has supposedly the best and most stable timer source out of most others. http://mingw-w64.svn.sourceforge.net/viewvc/mingw-w64/trunk/mingw-w64-crt/misc/gettimeofday.c
* timer: refactor, add 64 bit timer functionwm42013-05-265-96/+138
| | | | | | | | | | | | | | Make OS specific timer code export a mp_raw_time_us() function, and add generic implementations of GetTimer()/GetTimerMS() using this function. New mpv code is supposed to call mp_time_us() in situations where precision is absolutely needed, or mp_time_s() otherwise. Make it so that mp_time_us() will return a value near program start. We don't set it to 0 though to avoid confusion with relative vs. absolute time. Instead, pick an arbitrary offset. Move the test program in timer-darwin.c to timer.c, and modify it to work with the generic timer functions.
* macosx_application: implement "Quit & remember position"Stefano Pigozzi2013-05-232-7/+20
| | | | | | | Add a menu item to quit and save the current playback position using the code added with commit ce9a854. Fixes #85
* input: do property expansion for all input command string argumentswm42013-05-181-1/+1
| | | | | | Also add a "raw" prefix for commands, which prevents property expansion. The idea is that if the commands are generated by a program, it doesn't have to know whether the command expands properties or not.
* macosx_application: fix crash when quitting playerStefano Pigozzi2013-05-121-1/+5
| | | | | | | | | mpv crashed on quit when it was run using the bundle functionality and started without any files thus waiting for file open events. In that case, since there is no key_fifo initialized yet, short circuit to `terminate_cocoa_application()` which is generally called from `exit_player()` during normal lifecycle. Fixes bug report from user `eng` on IRC.
* macosx_application: add menu item for hide operationStefano Pigozzi2013-05-121-0/+2
| | | | Fixes #35
* OSX: run native event loop in a separate threadStefano Pigozzi2013-05-123-59/+71
| | | | | | | | | | | | | | This commit is a followup on the previous one and uses a solution I like more since it totally decouples the Cocoa code from mpv's core and tries to emulate a generic Cocoa application's lifecycle as much as possible without fighting the framework. mpv's main is executed in a pthread while the main thread runs the native cocoa event loop. All of the thread safety is mainly accomplished with additional logic in cocoa_common as to not increase complexity on the crossplatform parts of the code.
* OSX: use native Cocoa's event loopStefano Pigozzi2013-05-125-126/+446
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Schedule mpv's playloop as a high frequency timer inside the main Cocoa event loop. This has the benefit to allow accessing menus as well as resizing the window without the playback being blocked and allows to remove countless hacks from the code that involved manually pumping the event loop as well simulating manually some of the Cocoa default behaviours. A huge improvement consists in removing NSApplicationLoad. This is a C function defined in the Cocoa header and implements a minimal OSX application under ther hood so that you can use the Cocoa GUI toolkit from C/C++ without having to respect the Cocoa standards in terms of application initialization. This was bad because the behaviour implemented by NSApplicationLoad was hard to customize and had several gotchas especially in the menu department. mpv was changed to be just a nib-less application. All the Cocoa part is still generated in code but the event handling is now not dissimilar to what is present in a stock Mac application. As a part of reviewing the initialization process, I also removed all of `osdep/macosx_finder_args`. The useful parts of the code were moved to `osdep/macosx_appication` which has the broaded responsibility of managing the full lifecycle of the Cocoa application. By consequence the `--enable-macosx-finder` configure switch was killed as well, as this feature is always enabled. Another change the users will notice is that when using a bundle the `--quiet` option will be inserted much earlier in the initializaion process. This results in mpv not spamming mpv.log anymore with all the initialization outputs.
* mp_msg: fix status output disappearing when redirecting INPUT.Rudolf Polzer2013-03-181-2/+2
| | | | | Instead, we now check stderr's destination against the foreground tty for deciding whether we want status output or not.
* Prefix keycode defines with MP_wm42013-02-122-52/+52
| | | | | | | | | | Do this to reduce conflicts with <linux/input.h>, which contains some conflicting defines. This changes the meaning of MP_KEY_DOWN: KEY_DOWN is renamed to MP_KEY_DOWN (cursor down key) MP_KEY_DOWN is renamed to MP_KEY_STATE_DOWN (modifier for key down state)
* cocoa_events: remove this functionalityStefano Pigozzi2013-02-022-167/+0
| | | | | | | | | | | | | This functionality looked smart but created problems with some kinds of multi touch events. Moreover some events coming from the windows server – like hovering a corner for window resize – didn't cause the player to wake up immediately. The "correct" non hacky way to implement async event polling with cocoa would be having the vanilla cocoa event loop driving the player and setting up mpv's terminal FDs as event sources for the cocoa event loop. Fixes #20
* mp_msg, getch2: unix tty background supportRudolf Polzer2013-01-233-17/+104
| | | | | | | | Now, when backgrounded, mpv plays and outputs messages to stdout, but statusline is not output. Background<->foreground transitions are detected by signals and polling the process groups.
* Replace strsep() useswm42013-01-132-88/+0
| | | | | | This function sucks and apparently is not very portable (at least on mingw, the configure check fails). Also remove the emulation of that function from osdep/strsep*, and remove the configure check.
* windows support: fix _wstat misusagewm42013-01-132-2/+2
| | | | | | | I have no idea when or how this broke, but _wstati64() is the function we want anyway (64 bit filesize). Possibly this was a mingw-w64 bug. It's unknown why "wstat()" just doesn't work in this case, as it's not defined by MSDN and could be defined by mingw as it needs.
* osdep: remove gettimeofday() emulationwm42013-01-131-29/+0
| | | | Guaranteed by POSIX, and mingw provides it as well.
* osdep: remove setenv() emulationwm42013-01-131-43/+0
| | | | | mpv doesn't use setenv() anymore. The configure check was actually removed earlier; maybe it was forgotten to remove this completely.
* osdep: remove broken vsscanf() emulationwm42013-01-131-36/+0
| | | | | | vsscanf() is in POSIX, C99, mingw, etc. Further, the implementation in osdep/vsscanf.c was completely broken, and if it worked, it worked only by chance.
* Update copyright yearwm42013-01-041-1/+1
|
* path: add mp_find_config_file and reorganize some of the codeStefano Pigozzi2012-12-152-0/+56
| | | | | | | | | | | | | | Add `mp_find_config_file` to search different known paths and use that in ass_mp to look for the fontconfig configuration file. Some incidental changes spawned by this feature where: * Buffer allocation for the strings containing the paths is now performed with talloc. All of the allocations are done on a NULL context, but it still improves readability of the code. * Move the OSX function for lookup inside of a bundle: this code path was currently not used by the bundle generated with `make osxbundle`. The plan is to use it again in a future commit to get a fontconfig config file.
* Rename directories, move files (step 2 of 2)wm42012-11-129-13/+13
| | | | | | | | | | | | Finish renaming directories and moving files. Adjust all include statements to make the previous commit compile. The two commits are separate, because git is bad at tracking renames and content changes at the same time. Also take this as an opportunity to remove the separation between "common" and "mplayer" sources in the Makefile. ("common" used to be shared between mplayer and mencoder.)
* build: fix compilation on Windows (manifest files)wm42012-10-202-0/+0
|
* Rename to "mpv"wm42012-10-124-10/+10
| | | | | | | | | | | | | | | | | | This changes the name of this project to mpv. Most user-visible mentions of "MPlayer" and "mplayer" are changed to "mpv". The binary name and the default config file location are changed as well. The new default config file location is: ~/.mpv/ Remove etc/mplayer.desktop. Apparently this was for the MPlayer GUI, which has been removed from mplayer2 ages ago. We don't have a logo, and the MS Windows resource files sort-of require one, so leave etc/mplayer.ico/.xpm as-is. Remove the debian and rpm packaging scripts. These contained outdated dependencies and likely were more harmful than useful. (Patches which add working and well-tested packaging are welcome.)
* windows support: include io.h when building on CygwinKovensky2012-09-301-0/+4
|
* getch2: request at least 1 byte of input each readRudolf Polzer2012-09-191-1/+1
| | | | | | | | fixes issue with | less, where mplayer broke less's terminal expectations and made less quit Note this means that read() will be blocking again. Should be ok, as we always check via select() before reading.
* timer: remove timer_namewm42012-09-074-14/+0
| | | | This was unreferenced and useless.
* macosx_finder_args: fix file open orderStefano Pigozzi2012-08-161-1/+3
| | | | | | | When files are double clicked or drag and dropped to the mplayer2 icon they can be in random order. This commit forces alphabetical order. Opening them with command + down arrow already worked correctly.
* macosx_finder_args: make work with recent changesStefano Pigozzi2012-08-162-4/+4
|
* cache2: allow cache sizes up to 4 TBmplayer-svn2012-08-032-9/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove variable that is only assigned but never used. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@34791 b3059339-0415-0410-9bf9-f77b7e298cf2 Allow using a cache size of up to 4 TB. Obviously anything close to 4 GB will always fail on 32 bit systems. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@34792 b3059339-0415-0410-9bf9-f77b7e298cf2 Replace off_t by int64_t in cache code. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@34793 b3059339-0415-0410-9bf9-f77b7e298cf2 Remove casts that are no longer necessary. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@34794 b3059339-0415-0410-9bf9-f77b7e298cf2 Fix header file after r34793. Patch by Stephen Sheldon, sfsheldo gmail com. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@34802 b3059339-0415-0410-9bf9-f77b7e298cf2 Put #include <inttypes.h> into the header file where it should be. Reported by Stephen Sheldon, sfsheldo gmail com. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@34798 b3059339-0415-0410-9bf9-f77b7e298cf2 Correct r34798. The header only needs stdint.h while the C file needs inttypes.h. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@34799 b3059339-0415-0410-9bf9-f77b7e298cf2 Author: reimar
* osdep:/glob-win.c: reformatmplayer-svn2012-08-031-55/+47
| | | | | | | Use uncrustify on glob-win.c to fix the indentation mess in it. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@34239 b3059339-0415-0410-9bf9-f77b7e298cf2 Author: reimar
* Remove leftover BeOS support stuffwm42012-08-033-38/+0
| | | | As by mplayer-svn commit 33972. Their BeOS removal was more thorough.
* mplayer: turn playtree into a list, and change per-file option handlingwm42012-07-312-18/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: - There is no playtree anymore. It's reduced to a simple list. - Options are now always global. You can still have per-file options, but these are optional and require special syntax. - The slave command pt_step has been removed, and playlist_next and playlist_prev added. (See etc/input.conf changes.) This is a user visible incompatible change, and will break slave-mode applications. - The pt_clear slave command is renamed to playlist_clear. - Playtree entries could have multiple files. This is not the case anymore, and playlist entries have always exactly one entry. Whenever something adds more than one file (like ASX playlists or dvd:// or dvdnav:// on the command line), all files are added as separate playlist entries. Note that some of the changes are quite deep and violent. Expect regressions. The playlist parsing code in particular is of low quality. I didn't try to improve it, and merely spent to least effort necessary to keep it somehow working. (Especially ASX playlist handling.) The playtree code was complicated and bloated. It was also barely used. Most users don't even know that mplayer manages the playlist as tree, or how to use it. The most obscure features was probably specifying a tree on command line (with '{' and '}' to create/close tree nodes). It filled the player code with complexity and confused users with weird slave commands like pt_up. Replace the playtree with a simple flat playlist. Playlist parsers that actually return trees are changed to append all files to the playlist pre-order. It used to be the responsibility of the playtree code to change per-file config options. Now this is done by the player core, and the playlist code is free of such details. Options are not per-file by default anymore. This was a very obscure and complicated feature that confused even experienced users. Consider the following command line: mplayer file1.mkv file2.mkv --no-audio file3.mkv This will disable the audio for file2.mkv only, because options are per-file by default. To make the option affect all files, you're supposed to put it before the first file. This is bad, because normally you don't need per-file options. They are very rarely needed, and the only reasonable use cases I can imagine are use of the encode backend (mplayer encode branch), or for debugging. The normal use case is made harder, and the feature is perceived as bug. Even worse, correct usage is hard to explain for users. Make all options global by default. The position of an option isn't significant anymore (except for options that compensate each other, consider --shuffle --no-shuffle). One other important change is that no options are reset anymore if a new file is started. If you change settings with slave mode commands, they will not be changed by playing a new file. (Exceptions include settings that are too file specific, like audio/subtitle stream selection.) There is still some need for per-file options. Debugging and encoding are use cases that profit from per-file options. Per-file profiles (as well as per-protocol and per-VO/AO options) need the implementation related mechanisms to backup and restore options when the playback file changes. Simplify the save-slot stuff, which is possible because there is no hierarchical play tree anymore. Now there's a simple backup field. Add a way to specify per-file options on command line. Example: mplayer f1.mkv -o0 --{ -o1 f2.mkv -o2 f3.mkv --} f4.mkv -o3 will have the following options per file set: f1.mkv, f4.mkv: -o0 -o3 f2.mkv, f3.mkv: -o0 -o3 -o1 -o2 The options --{ and --} start and end per-file options. All files inside the { } will be affected by the options equally (similar to how global options and multiple files are handled). When playback of a file starts, the per-file options are set according to the command line. When playback ends, the per-file options are restored to the values when playback started.
* mp_msg: remove filename_recodewm42012-07-313-69/+0
| | | | | | | | | | This was intended for translating filenames from filesystem charset to the terminal charset. Modern sane platforms use UTF-8 for everything, and on Windows we use unicode APIs, so this is not needed anymore. Remove filename_recode, all uses of it, options and configure checks related to terminal output charset, and code that tries to determine the same.
* Merge remote-tracking branch 'origin/master'wm42012-04-292-0/+167
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: bstr.c bstr.h libvo/cocoa_common.m libvo/gl_common.c libvo/video_out.c mplayer.c screenshot.c sub/subassconvert.c Merge of cocoa_common.m done by pigoz. Picking my version of screenshot.c. The fix in commit aadf1002f8a will be redone in a follow-up commit, as the original commit causes too many conflicts with the work done locally in this branch, and other work in progress.
| * OSX, input: implement wakeup in response to Cocoa eventsStefano Pigozzi2012-04-262-0/+167
| | | | | | | | | | | | | | | | | | Add code to wake up the select() call in input.c when an OSX event is available and a Cocoa OpenGL backend is initialized. Fixes the slow response to input or other events in Cocoa-based VOs during long select() sleeps (e.g., when mplayer2 is paused) introduced by commit 7040968.
* | win32: simplify icon loadingwm42012-04-141-3/+3
| | | | | | | | | | I have no idea why the code used this roundabout method. Also detab mplayer.rc.
* | Merge remote-tracking branch 'origin/master'wm42012-04-137-470/+17
|\| | | | | | | | | Conflicts: libvo/vo_kva.c
| * build: remove OS/2 supportUoti Urpala2012-04-066-466/+3
| |
| * input: stop trying to read terminal input on EOFUoti Urpala2012-04-063-4/+14
| | | | | | | | | | | | | | | | | | | | | | | | Stop trying to read terminal input if a read attempt returns EOF. The most important case where this matters is when someone runs the player with stdin redirected from /dev/null and without specifying --no-consolecontrols. This used to cause 100% CPU load while paused, as select() would continuously trigger on stdin (the need for --no-consolecontrols was not apparent to people with older mplayer versions, as input reading was less efficient and latencies like hardcoded sleeps kept CPU use well below 100%). Now this will only cause a "Dead key input" error message.
* | win32: use more unicode functionswm42012-04-062-5/+22
| | | | | | | | | | | | | | | | Use the *W variants instead of the implicit *A functions. (One could define the UNICODE macro to switch the functions without suffix from A to W, but I'm too lazy to figure out how portable that is, etc.) Also make sure io.h defines a unicode aware printf().
* | Merge remote-tracking branch 'origin/master'wm42012-04-013-132/+99
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: bstr.c bstr.h etc/input.conf input/input.c input/input.h libao2/ao_pulse.c libmpcodecs/vf_ass.c libmpcodecs/vf_vo.c libvo/gl_common.c libvo/x11_common.c mixer.c mixer.h mplayer.c
| * macosx_finder_args: use a custom logfile instead of system.logStefano Pigozzi2012-03-251-0/+12
| | | | | | | | | | | | | | | | | | | | Change the macosx_finder_args function so that when mplayer2 is invoked from the Finder in a Mac application bundle, it redirects the output to ~/Library/Logs/mplayer2.log instead of cluttering the global system.log. This doesn't affect terminal use which keeps writing to stdout and stderr.
| * macosx_finder_args: use cocoa instead of carbonStefano Pigozzi2012-03-253-132/+87
| | | | | | | | | | | | | | | | | | | | | | | | macosx_finder_args was using Carbon and wasn't usable any longer on modern versions of MacOSX. This is very useful to embed mplayer in a mac application bundle. When using application bundles, the operating system will call the main function with only one argument that identifies the process serial number (this is some additional process identifier in osx other than the pid). File open events are then dispatched to the application through events that must be handled accordingly.
| * input: handle UTF-8 terminal inputwm42012-03-251-0/+11
| | | | | | | | | | | | | | | | | | | | | | This assumes the terminal uses UTF-8. If invalid UTF-8 is encountered (for example because the terminal uses a legacy encoding), the code falls back to the old method and feeds each byte as key code to the input code. In theory, UTF-8 input could randomly fail, because the code in getch2.c doesn't try to fill the input buffer correctly with input sequences longer than a byte. This is a problem with the design of the existing code.
| * input: allow unicode keys and reassign internal key codeswm42012-03-251-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This moves all key codes above the highest valid unicode code point (which is 0x10FFFF). All key codes below MP_KEY_BASE now directly map to unicode (KEY_ENTER is 13, carriage return). Configuration files (input.conf) can contain unicode characters in UTF-8 to map non-ASCII characters/keys. This shouldn't change anything user visible, except that "direct key codes" (as used in input.conf) will change their meaning. Parts of the bstr functions taken from libavutil's GET_UTF8 and slightly modified.
* | Merge remote-tracking branch 'origin/master' into my_masterwm42012-03-164-2/+331
|\| | | | | | | | | | | | | | | Conflicts: command.c mp_core.h mplayer.c screenshot.c
| * windows: terminal: unicode, --msgcolor, size changeMartin Herkt2012-03-093-0/+66
| | | | | | | | | | | | | | Make mp_msg() support unicode output, --msgcolor and variable screen sizes. Patch reintegrated by wm4.
| * windows support: unicode filenameswm42012-03-092-0/+261
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Windows uses a legacy codepage for char* / runtime functions accepting char *. Using UTF-8 as the codepage with setlocale() is explicitly forbidden. Work this around by overriding the MSVCRT functions with wrapper macros, that assume UTF-8 and use "proper" API calls like _wopen etc. to deal with unicode filenames. All code that uses standard functions that take or return filenames must now include osdep/io.h. stat() can't be overridden, because MinGW-w64 itself defines "stat" as a macro. Change code to use use mp_stat() instead. This is not perfectly clean, but still somewhat sane, and much better than littering the rest of the mplayer code with MinGW specific hacks. It's also a bit fragile, but that's actually little different from the previous situation. Also, MinGW is unlikely to ever include a nice way of dealing with this.
| * cleanup: Silence compilation warnings on MinGW-w64wm42012-03-012-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some of the code, especially the dshow and windows codec loader parts, are extremely hacky and likely full of bugs. The goal is merely getting rid of warnings that could obscure more important warnings and actual bugs, instead of fixing actual problems. This reduces the number of warnings from over 500 to almost the same as when compiling on Linux. Note that many problems stem from using the ancient wine-derived windows headers. There are some differences to the "proper" windows header. Changing the code to compile with the proper headers would be too much trouble, and it still has to work on Unix. Some of the changes might actually break compilation on legacy MinGW, but we don't support that anymore. Always use MinGW-w64, even when compiling to 32 bit. Fixes some warnings in the win32 loader code on Linux too.
* | input: restore terminal attributes after resumewm42012-02-251-6/+21
| | | | | | | | | | | | | | | | | | | | Install a signal handler on SIGCONT, and restore the terminal attributes with tcsetattr() if it happens. This is needed with some shells (such as tcsh) that don't restore the terminal attributes set by mplayer. Without this, terminal I/O doesn't work as intended after resume with these shells. Fixes #155.
* | Merge remote-tracking branch 'origin/master' into my_masterwm42012-02-191-1/+1
|\|
| * Update copyright yearUoti Urpala2012-01-281-1/+1
| |
* | input: fix "enter" on consolewm42012-02-191-8/+9
| | | | | | | | | | | | | | The commit "input: handle UTF-8 terminal input" accidentally messed up the handling of certain special keys. Apparently only KEY_ENTER was affected by this, because the code was valid UTF-8, but didn't directly map to the keycode.
* | input: handle UTF-8 terminal inputwm42012-01-181-0/+10
| | | | | | | | | | | | | | | | | | | | | | This assumes the terminal uses UTF-8. If invalid UTF-8 is encountered (for example because the terminal uses a legacy encoding), the code falls back to the old method and feeds each byte as key code to the input code. In theory, UTF-8 input could randomly fail, because the code in getch2.c doesn't try to fill the input buffer correctly with input sequences longer than a byte. This is a problem with the design of the existing code.
* | input: allow unicode keys and reassign internal key codeswm42012-01-181-1/+1
|/ | | | | | | | | | This moves all key codes above the highest valid unicode code point (which is 0x10FFFF). All key codes below MP_KEY_BASE now directly map to unicode. Configuration files (input.conf) can contain unicode characters in UTF-8 to map non-ASCII characters/keys. This shouldn't change anything user visible, except that "direct key codes" (as used in input.conf) will change their meaning.
* getch2.c: fix negative keycodes returned for non-asciiUoti Urpala2011-10-031-1/+1
| | | | | | | | | | | | | | | | | | getch2.c read data into a "char" array, and returned values other than escape sequences directly from there. This meant that it could return negative values (except on platforms where "char" is unsigned) if the input contained bytes >= 128. This would break later parsing in input.c as the values would be interpreted as having the MP_KEY_DOWN flag set, which would make the key binding code think a key is held down (and never released). Fix by changing the buffer type to unsigned char. The bug itself was very old, but started triggering visible breakage more easily after commit 82b8f89baea ("input: rework event reading and command queuing"). Before that the key values would be passed through the input.c "key read function" interface, which (mis)interpreted the negative values as errors from the function, and in most cases discarded them without much visible effect.
* osdep/mplayer.rc: change to use "mplayer2" nameMartin Herkt2011-08-211-7/+6
|
* build: fix --enable-debug, remove some "#ifdef MP_DEBUG"Uoti Urpala2011-07-301-3/+0
| | | | | | | | | | | Recent commit 5d5ca22a6d ("options: commandline: accept --foo=xyz style options") left some bad code under "#ifdef MP_DEBUG" in playtree.c, which caused a compilation failure if configured with "--enable-debug". Fix this. Having the "#ifdef MP_DEBUG" there was completely unnecessary; it only increased the risk for this kind of problems for no real benefit - executing the asserts under it would have no noticeable performance or other penalty in default builds either. Remove several cases of such harmful "#ifdef MP_DEBUG".
* options: change option parsing to use bstrUoti Urpala2011-07-291-1/+1
| | | | | | Using bstr allows simpler parsing code, especially because it avoids the need to modify or copy strings just to terminate extracted substrings.
* options: indicate ambiguous option parameters explicitlyUoti Urpala2011-07-291-1/+1
| | | | | | | | Command line options like "-foo xyz" are ambiguous: "xyz" may be a parameter to the option "foo" or an unrelated argument. Instead of relying on the struct m_config mode field (commandline/file) pass parameters to specify ambiguous mode explicitly. Meant for "--foo" options which are never ambiguous on command line either.
* input: don't make fd 0 nonblockingUoti Urpala2011-07-171-5/+0
| | | | | | | | | | | | | | | Setting O_NONBLOCK on a file descriptor also affects all other fds that share the same underlying open file description, and in case of stdin such sharing is likely. Making stdin nonblocking can also make stdout nonblocking (they may be the same connection to a terminal), and it can also affect other processes (in "program1 | program2", the shell may give the same terminal connection to program1 as stdin and to program2 as stdout, thus program1 making its stdin nonblocking also turns program2's stdout nonblocking). To avoid these problems stop making fd 0 nonblocking. After the previous commit this should no longer cause problems as long as select() does not spuriously report the fd as readable.
* input: make slave command file descriptors nonblockingUoti Urpala2011-05-041-2/+2
| | | | | | | Neither fd 0 slave input (-slave) nor additional opened fds (-input file=X) were set to nonblocking mode as they should have been. Fix. Also rename the horribly generic USE_SELECT #define used for a specific slave input detail.
* input: move all key code lists to input/keycodes.hUoti Urpala2011-05-024-106/+3
| | | | | | | | | | | | | Move the definitions of all special key codes (those not passed by ASCII value) to input/keycodes.h. Before they were spread between osdep/keycodes.h, input/joystick.h, input/mouse.h and input/ar.h, plus some special values in input.h. This was especially inconvenient as the codes had to be coordinated to not conflict between the files. The change requires a bit of ugliness as appleir.c includes <linux/input.h> which contains various conflicting KEY_* definitions. Work around this by adding a special preprocessor variable which can be used to avoid defining these in keycodes.h.
* input: make stdin non-blocking for terminal inputUoti Urpala2011-04-281-1/+7
| | | | | | | getch2.c did not make stdin non-blocking, and relied on only being called after select() had shown readability. Stop relying on that assumption and set stdin to non-blocking mode. Hopefully no relevant platform has problems with this...
* tl_matroska.c: move the find_files() function hereUoti Urpala2011-03-032-79/+0
| | | | | | Move the find_files() function from findfiles.c to tl_matroska.c. Delete the findfiles.c file. Add a check against opendir() failure in find_files().
* bstr.[ch], path.[ch]: add string and path handling functionsUoti Urpala2011-02-261-27/+7
| | | | | | | Add some new string and path handling functions to be used in following commits. Use new path handling functions to simplify find_files().
* osdep: tweak some #includesdiego2011-01-315-1/+6
| | | | | | Add/remove a few standard header #includes in osdep files. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32762 b3059339-0415-0410-9bf9-f77b7e298cf2
* build: cygwin: don't rely on _WIN32 being definedreimar2011-01-291-1/+1
| | | | | | | | | | | | | | | configure: Compilation fixes for current Cygwin git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32724 b3059339-0415-0410-9bf9-f77b7e298cf2 Do not #define _WIN32 on the command line for Cygwin. Newer Cygwin versions no longer do this and hopefully we should be able to survive without this hack as well. This change necessitates adapting two #ifdefs in the MPlayer codebase. It is committed untested as I do not have access to a Cygwin system. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32763 b3059339-0415-0410-9bf9-f77b7e298cf2
* Merge branch 'hr-seek'Uoti Urpala2010-12-201-0/+6
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * hr-seek: input: add default keybindings Shift+[arrow] for small exact seeks input: support bindings with modifier keys for X input core: audio: make ogg missing audio timing workaround more complex core: add support for precise non-keyframe-limited seeks core: add struct for queued seek info commands: add generic option -> property wrapper options: add "choice" option type, use for -pts-association-mode core: remove looping in update_video(), modify command handling a bit core: seek: use accurate seek mode with audio-only files core: avoid using sh_video->pts as "current pts" libvo: register X11 connection fd in input event system core: timing: add special handling of long frame intervals core: move central play loop to a separate function Conflicts: DOCS/tech/slave.txt
| * input: support bindings with modifier keys for X inputUoti Urpala2010-12-201-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add support for binding commands to modifier+key combinations like "Shift+Left" or "Ctrl+Alt+x", and support reading such combinations from the output window of X VOs. The recognized modifier names are Shift, Ctrl, Alt and Meta. Any combination of those and then a non-modifier key name, separated by '+', is accepted as a key name in input.conf. For non-special keys that produce characters shift is ignored as a modifier. For example "A" is handled as a key without modifiers even if you use shift to write the capital letter; 'a' vs 'A' already distinguishes the combinations with a normal keymap, and having separate 'a', 'Shift+A' and 'A' (written with caps lock for example) would bring more confusion than benefit. Currently reading the modifier+key combinations is only supported in the output window of those VOs that use x11_common.c event handling. It's not possible to input the key combinations in other VOs or in a terminal window.
* | vd_ffmpeg: set thread count to number of cores on machine by defaultUoti Urpala2010-12-202-0/+67
|/ | | | | | | | | | | Make "-lavdopts threads=0" mean an autodetected number of threads, and make that the default value of the option. Also increase the upper limit of the option from 8 to 16. Add new file osdep/numcores.c which tries to determine the number of cores available on the machine. numcores.c is based (heavily modified) on public domain numcpus.c by Philip Willoughby <pgw99@doc.ic.ac.uk>, downloaded from http://csgsoft.doc.ic.ac.uk/numcpus/
* cleanup: remove NULL checks before free() all over the codecboesch2010-11-141-2/+1
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32624 b3059339-0415-0410-9bf9-f77b7e298cf2
* osdep/macosx_finder_args.h: include required header m_config.hdiego2010-11-021-0/+1
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32166 b3059339-0415-0410-9bf9-f77b7e298cf2
* osdep: Fix gettimeofday type to match the real onereimar2010-11-021-1/+2
| | | | | | | Avoids issues if the system headers have a declaration for gettimeofday but there's just no implementation there. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31733 b3059339-0415-0410-9bf9-f77b7e298cf2
* Windows support: add a manifest filereimar2010-11-022-0/+22
| | | | | | | Add a manifest file to disable file and registry "virtualization" on Windows. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31630 b3059339-0415-0410-9bf9-f77b7e298cf2
* Delete things related to old translation systemUoti Urpala2010-03-101-1/+0
| | | | | Remove the help/ subdirectory, configure code to create toplevel help_mp.h, and all the '#include "help_mp.h"' lines from .c files.
* Merge svn changes up to r30848Uoti Urpala2010-03-102-23/+21
|\
| * 1. Move the macros for priority classes for OS/2 from priority.c to osdep.hkomh2010-03-042-23/+21
| | | | | | | | | | | | | | | | | | | | | | 2. Define SetPriorityClass() and GetCurrentProcess() in osdep.h 3. Include osdep.h in priority.c This removes OS2-platform check in priority.c git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30828 b3059339-0415-0410-9bf9-f77b7e298cf2
* | Merge svn changes up to r30798Uoti Urpala2010-03-102-13/+57
|\|
| * Add cddb:// support for OS/2komh2010-02-281-0/+33
| | | | | | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30788 b3059339-0415-0410-9bf9-f77b7e298cf2
| * Add support for reading key events from MinGW xterm.reimar2010-02-281-1/+10
| | | | | | | | | | | | | | | | Unfortunately keys only arrive after enter was pressed and SetNamedPipeHandleState does not seem to help. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30784 b3059339-0415-0410-9bf9-f77b7e298cf2
| * Make -slave also work with the normal console on Windows.reimar2010-02-271-3/+8
| | | | | | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30780 b3059339-0415-0410-9bf9-f77b7e298cf2
| * Do not misuse the stdin name.reimar2010-02-271-10/+8
| | | | | | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30777 b3059339-0415-0410-9bf9-f77b7e298cf2
| * Include getch2.h to get rid of some warnings.reimar2010-02-271-0/+1
| | | | | | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30776 b3059339-0415-0410-9bf9-f77b7e298cf2
* | Merge svn changes up to r30748Uoti Urpala2010-03-101-1/+1
|\|
| * Do not cast the results of malloc/calloc/realloc.diego2010-02-261-1/+1
| | | | | | | | | | | | | | | | These functions return void*, which is compatible with any pointer, so there is no need for casts. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30744 b3059339-0415-0410-9bf9-f77b7e298cf2
* | Merge svn changes up to r30732Uoti Urpala2010-03-104-3/+42
|\|
| * Add header for macosx_finder_args() instead of forward declaring it.diego2010-02-232-0/+27
| | | | | | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30717 b3059339-0415-0410-9bf9-f77b7e298cf2
| * Mark sleep_accurate() as static, it is only used within the file.diego2010-02-221-1/+1
| | | | | | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30715 b3059339-0415-0410-9bf9-f77b7e298cf2
| * Conditionally declare mp_input_slave_cmd_func().diego2010-02-221-2/+1
| | | | | | | | | | | | | | It does only get compiled on MinGW and OS/2. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30711 b3059339-0415-0410-9bf9-f77b7e298cf2
| * Properly declare get_term_charset() instead of forward declaring it.diego2010-02-221-0/+13
| | | | | | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30710 b3059339-0415-0410-9bf9-f77b7e298cf2
| * cosmetics: Remove pointless empty lines at EOF.diego2010-02-205-5/+0
| | | | | | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30675 b3059339-0415-0410-9bf9-f77b7e298cf2
| * #include corresponding .h files in .c files.diego2010-02-164-0/+5
| | | | | | | | | | | | | | This ensures that function declarations in both files always match. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30596 b3059339-0415-0410-9bf9-f77b7e298cf2
* | Merge svn changes up to r30375Uoti Urpala2010-01-252-0/+31
|\|
| * Add a proper header for our strsep implementation so strsep willreimar2010-01-172-0/+31
| | | | | | | | | | | | | | not be used without a declaration, causing issues on 64 bit systems. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30355 b3059339-0415-0410-9bf9-f77b7e298cf2
* | Merge svn changes up to r30236Uoti Urpala2010-01-081-1/+1
|\|
| * Happy new year!zuxy2010-01-071-1/+1
| | | | | | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30235 b3059339-0415-0410-9bf9-f77b7e298cf2
* | Merge svn changes up to r29412Uoti Urpala2009-07-073-5/+7
|\|
| * Use a malloced string for the get_term_charset return value.reimar2009-05-313-5/+7
| | | | | | | | | | | | | | | | This is necessary at least on POSIX systems since the buffer returned by nl_langinfo may change its contents with e.g. each setlocale call. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29332 b3059339-0415-0410-9bf9-f77b7e298cf2
| * whitespace cosmetics: Remove all trailing whitespace.diego2009-05-139-42/+42
| | | | | | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29305 b3059339-0415-0410-9bf9-f77b7e298cf2
* | Remove trailing whitespace from most filesUoti Urpala2009-07-0714-46/+41
| |
* | Translation system changes part 2: replace macros by stringsAmar Takhar2009-07-071-1/+1
| | | | | | | | | | Replace all MSGTR_ macros in the source by the corresponding English string.
* | Translation system changes part 1: wrap translated stringsAmar Takhar2009-07-071-1/+1
| | | | | | | | | | Replace mp_msg() calls which have a translated string as the format argument with mp_tmsg and add _() around all other translated strings.
* | Merge svn changes up to r29277Uoti Urpala2009-05-082-8/+11
|\|
| * Add missing 'void' to parameterless function declarations.diego2009-05-042-5/+5
| | | | | | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29254 b3059339-0415-0410-9bf9-f77b7e298cf2
| * cosmetics: reindentdiego2009-04-191-31/+38
| | | | | | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29198 b3059339-0415-0410-9bf9-f77b7e298cf2
* | Merge branch 'ordered_chapters'Uoti Urpala2009-04-082-0/+99
|\ \
| * | Initial ordered chapters supportUoti Urpala2009-04-022-0/+99
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add basic support for Matroska ordered chapters. The switching between segments is implemented as a general edit timeline that could also be used for other purposes. Some things still need improvement. In particular the current code does not try to do any proper mapping between audio/video/subtitle streams of different files and there should be options for better control of how MPlayer searches other files for the required content.
* | | Merge svn changes up to r29117Uoti Urpala2009-04-011-1/+1
|\ \ \ | |/ / |/| / | |/
| * cosmetics: Remove file names from file header, it only causes trouble.diego2009-03-151-1/+1
| | | | | | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28959 b3059339-0415-0410-9bf9-f77b7e298cf2
* | Merge svn changes up to r28862Uoti Urpala2009-03-0720-20/+383
|\|
| * Add back mistakenly removed copyright notice.diego2009-03-031-0/+2
| | | | | | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28802 b3059339-0415-0410-9bf9-f77b7e298cf2
| * Add standard license headers to files.diego2009-03-0120-20/+381
| | | | | | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28779 b3059339-0415-0410-9bf9-f77b7e298cf2
* | Merge svn changes up to r28537Uoti Urpala2009-02-122-0/+120
|\|
| * Remove unnecessary _UWIN #define.diego2009-02-111-3/+0
| | | | | | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28529 b3059339-0415-0410-9bf9-f77b7e298cf2
| * Add priority support for OS/2 and factorize the Windows priority support.diego2009-02-102-0/+123
| | | | | | | | | | | | | | patch by KO Myung-Hun, komh chollian net git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28520 b3059339-0415-0410-9bf9-f77b7e298cf2
* | Merge svn changes up to r28341Uoti Urpala2009-01-191-1/+1
|\| | | | | | | | | | | Conflicts: configure libmpcodecs/native/rtjpegn.c
| * Update copyright year, patch by Zhou Zongyi, zhouzongyi pset.suntec net.diego2009-01-151-1/+1
| | | | | | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28312 b3059339-0415-0410-9bf9-f77b7e298cf2
* | Merge svn changes up to r28310Uoti Urpala2009-01-152-6/+11
|\| | | | | | | | | | | | | | | The libdvdread4 and libdvdnav directories, which are externals in the svn repository, are at least for now not included in any form. I added configure checks to automatically disable internal libdvdread and libdvdnav if the corresponding directories are not present; if they're added manually then things work the same as in svn.
| * timer-win2.c: Fix "voi" (void) typo breaking Windows compilationuau2009-01-051-1/+1
| | | | | | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28269 b3059339-0415-0410-9bf9-f77b7e298cf2
| * Add missing 'void' keyword to parameterless function declarations.diego2009-01-052-7/+13
| | | | | | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28267 b3059339-0415-0410-9bf9-f77b7e298cf2
* | Merge svn changes up to r28087Uoti Urpala2008-12-042-10/+10
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: command.c libao2/ao_ivtv.c libao2/ao_v4l2.c libmpcodecs/dec_video.h libvo/aspect.h libvo/sub.c libvo/sub.h libvo/vo_directx.c libvo/vo_macosx.m libvo/vo_quartz.c mp_core.h mplayer.c mplayer.h osdep/getch2.h osdep/timer.h
| * Get rid of pointless 'extern' keywords.diego2008-12-033-12/+12
| | | | | | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28085 b3059339-0415-0410-9bf9-f77b7e298cf2
* | Use correct terminal "clear line" codeUoti Urpala2008-08-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The "erase_to_end_of_line" string used to clear the terminal status line was initialized with the termcap id "cd", which means to clear all lines below the cursor. Change it to the correct "ce" to clear the current line. Usually the status line is on the bottommost line of the terminal so the behaviour wouldn't differ much. However it did make a difference when I tested starting MPlayer at the top of a huge gnome-terminal window so the status line was not at the bottom; in that case clearing just the current line used less CPU than clearing the part of the huge window below the status line.
* | Include corresponding .h in some .c filesUoti Urpala2008-08-121-0/+1
| |
* | Merge svn changes up to r27441Uoti Urpala2008-08-083-5/+5
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: cfg-common-opts.h command.c configure input/input.c libmpcodecs/dec_video.c libmpcodecs/vd.c libmpdemux/stheader.h libvo/sub.c libvo/video_out.c libvo/vo_xv.c libvo/vosub_vidix.c libvo/x11_common.c libvo/x11_common.h mp_core.h mplayer.c stream/stream.h
| * Rename font-related preprocessor directives.diego2008-08-073-5/+5
| | | | | | | | | | | | | | Switch them from a HAVE_ to a CONFIG_ prefix. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@27425 b3059339-0415-0410-9bf9-f77b7e298cf2
* | Merge svn changes up to r27399Uoti Urpala2008-08-023-9/+9
|\| | | | | | | | | | | | | | | | | | | Conflicts: libmpcodecs/vd.c libmpcodecs/ve_raw.c libvo/video_out.c libvo/x11_common.c mplayer.c
| * Rename some preprocessor directives from CONFIG_* to HAVE_* where appropriate;diego2008-08-013-9/+9
| | | | | | | | | | | | | | CONFIG_ prefix for configurable options, HAVE_ for system-dependent stuff. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@27391 b3059339-0415-0410-9bf9-f77b7e298cf2
* | Merge svn changes up to r27374Uoti Urpala2008-07-303-12/+12
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: cfg-common-opts.h cfg-mplayer.h command.c configure libmpcodecs/dec_video.c libmpcodecs/vd.c libmpcodecs/vf_vo.c libmpdemux/demuxer.h libmpdemux/stheader.h mp_core.h mplayer.c stream/stream_radio.c
| * Start unifying names of internal preprocessor directives.diego2008-07-303-12/+12
| | | | | | | | | | | | | | | | Replace all USE_ prefixes by CONFIG_ prefixes to indicate options which are configurable. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@27373 b3059339-0415-0410-9bf9-f77b7e298cf2
* | Merge svn changes up to r26979Uoti Urpala2008-06-043-4/+4
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Most of the conflicts are trivial. Conflicts: Makefile cfg-mplayer.h input/input.c libmenu/vf_menu.c libmpcodecs/dec_video.c libmpcodecs/vf_expand.c libmpcodecs/vf_vo.c libmpdemux/demux_mkv.c libmpdemux/demuxer.c libmpdemux/demuxer.h libvo/vo_directfb2.c libvo/vo_gl.c libvo/vo_winvidix.c libvo/vo_xv.c libvo/vo_xvidix.c libvo/vo_xvmc.c libvo/x11_common.c mplayer.c osdep/timer-linux.c stream/cache2.c
| * cosmetics: Remove useless parentheses from return statements.diego2008-05-163-4/+4
| | | | | | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@26791 b3059339-0415-0410-9bf9-f77b7e298cf2
| * Remove useless variable startup_time, since we do not need it any more.ulion2008-05-051-5/+4
| | | | | | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@26672 b3059339-0415-0410-9bf9-f77b7e298cf2
* | Merge svn changes up to r26624Uoti Urpala2008-05-011-2/+2
|\| | | | | | | | | | | Conflicts: Makefile
| * Use consistent include paths, we always build from the top level now.diego2008-04-301-2/+2
| | | | | | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@26603 b3059339-0415-0410-9bf9-f77b7e298cf2
* | Add a context for mp_fifoUoti Urpala2008-04-294-7/+8
| | | | | | | | | | Store data in an allocated context and take it as an argument instead of using static variables.
* | mp_fifo.c, osdep/: Include corresponding .h in .c filesUoti Urpala2008-04-295-0/+8
| |
* | Merge svn changes up to r26587Uoti Urpala2008-04-291-4/+2
|\| | | | | | | | | | | | | | | Conflicts: Makefile configure osdep/timer-darwin.c
| * Force to uint64_t first to avoid direct conversion from double to unsigned int.ulion2008-04-281-4/+2
| | | | | | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@26582 b3059339-0415-0410-9bf9-f77b7e298cf2
* | osdep: Remove cruftUoti Urpala2008-04-282-21/+0
| | | | | | | | Delete some commented out or otherwise unused lines.
* | timers: Remove GetRelativeTime()Uoti Urpala2008-04-284-44/+2
| | | | | | | | | | | | | | | | | | | | Move the code calculating time delta since last query out of the platform-specific drivers and into mplayer.c. The platform-specific drivers now return absolute values only. The way the code in timer-darwin.c uses doubles in wrapping arithmetic looks questionable and this change might make problems in it more visible.
* | osdep: Change timer_name to a saner typeUoti Urpala2008-04-284-4/+4
|/ | | | | timer_name was a (non-const) pointer to a const char array. Make the symbol the array itself.
* Merge osdep/Makefile into the top-level Makefile, thus getting riddiego2008-04-081-23/+0
| | | | | | | of recursive make in the osdep/ subdirectory. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@26352 b3059339-0415-0410-9bf9-f77b7e298cf2
* Move decision about which getch2 and timer file to compile to configure.diego2008-04-081-17/+3
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@26351 b3059339-0415-0410-9bf9-f77b7e298cf2
* Move decision about whether or not to compile osdep/mmap_os2.c to configure.diego2008-04-081-3/+1
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@26350 b3059339-0415-0410-9bf9-f77b7e298cf2
* Add missing header #includes to fix 'make checkheaders'.diego2008-03-072-0/+3
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@26196 b3059339-0415-0410-9bf9-f77b7e298cf2
* mmap() support for OS/2diego2008-02-273-0/+269
| | | | | | | patch by KO Myung-Hun, komh chollian net git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@26108 b3059339-0415-0410-9bf9-f77b7e298cf2
* Add MPLAYER_ prefix to multiple inclusion guards.diego2008-02-225-15/+15
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@26061 b3059339-0415-0410-9bf9-f77b7e298cf2
* OS/2 getch2() supportdiego2008-02-213-0/+211
| | | | | | | patch by KO Myung-Hun, komh chollian net git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@26048 b3059339-0415-0410-9bf9-f77b7e298cf2
* Rename mp_input_win32_slave_cmd_func to mp_input_slave_cmd_func.diego2008-02-212-2/+2
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@26047 b3059339-0415-0410-9bf9-f77b7e298cf2
* Remove pointless #ifdefs around extern declarations.diego2008-02-201-2/+0
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@26039 b3059339-0415-0410-9bf9-f77b7e298cf2
* Happy New Year!zuxy2008-01-021-1/+1
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@25583 b3059339-0415-0410-9bf9-f77b7e298cf2
* Add multiple inclusion guards to all header files that lack them.diego2008-01-014-0/+18
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@25581 b3059339-0415-0410-9bf9-f77b7e298cf2
* Replace multiple inclusion guards with leading underscores by default names.diego2008-01-011-3/+3
| | | | | | | Leading underscores are reserved for system identifiers. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@25579 b3059339-0415-0410-9bf9-f77b7e298cf2
* Fix warnings when compiling test application.diego2007-12-281-1/+2
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@25538 b3059339-0415-0410-9bf9-f77b7e298cf2
* Make windres binary name configurable, useful for cross-compiling.diego2007-12-281-1/+1
| | | | | | | patch by sheba, sheba469 yahoo com git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@25534 b3059339-0415-0410-9bf9-f77b7e298cf2
* Rename timer-lx.c --> timer-linux.c.diego2007-11-212-1/+1
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@25129 b3059339-0415-0410-9bf9-f77b7e298cf2
* main() --> main(void)diego2007-11-213-3/+3
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@25128 b3059339-0415-0410-9bf9-f77b7e298cf2
* Fix GetTimerMS() discontinuous return value bug caused by GetTimer() overflowulion2007-10-231-1/+2
| | | | | | | on darwin. This bug will cause osd stuck on darwin. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@24843 b3059339-0415-0410-9bf9-f77b7e298cf2
* getch2: Fix incorrect testuau2007-09-151-1/+1
| | | | | | | | | | | Keycode length wasn't checked in one case because of missing parentheses. This was accidentally broken in my previous commit to the file. Most likely the error had no practical effect; the length checks are unreliable in any case as they can be satisfied by unrelated data corresponding to other keypresses. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@24535 b3059339-0415-0410-9bf9-f77b7e298cf2
* warning fix:diego2007-08-251-1/+1
| | | | | | | | mmap_anon.c: In function 'mmap_anon': mmap_anon.c:37: warning: unused variable 'fd' git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@24194 b3059339-0415-0410-9bf9-f77b7e298cf2
* Clean up getch2() code somewhatuau2007-08-251-69/+102
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@24150 b3059339-0415-0410-9bf9-f77b7e298cf2
* Make terminal input work more like VO key inputuau2007-08-253-17/+18
| | | | | | | | | | | | | | | | | The Unix version of getch2() could either return an internally buffered key or do a second-level select() in addition to the input.c one and then read more data. Change getch2() to always add all read keys with mplayer_put_key() (like video output window keyboard input does) and remove the internal select() from the Unix version. Make input.c call mplayer_get_key() directly. The primary motivation for this change is to make combining multiple event sources under one select() easier. Now getch2() only needs to be called when the corresponding fd is readable, and it will be possible to handle events from X-based VOs with the same code. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@24149 b3059339-0415-0410-9bf9-f77b7e298cf2
* Identifiers starting with underscores are reserved.diego2007-07-311-3/+3
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@23954 b3059339-0415-0410-9bf9-f77b7e298cf2
* Remove unused scandir() check and fallback implementation.diego2007-07-172-134/+0
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@23799 b3059339-0415-0410-9bf9-f77b7e298cf2
* Remove unused ftello() check and fallback implementation.diego2007-07-172-20/+0
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@23798 b3059339-0415-0410-9bf9-f77b7e298cf2
* Remove unused fseeko() check and fallback implementation.diego2007-07-172-68/+0
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@23797 b3059339-0415-0410-9bf9-f77b7e298cf2
* Remove empty strlcat and strlcpy filesreimar2007-07-062-0/+0
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@23725 b3059339-0415-0410-9bf9-f77b7e298cf2
* Avoid code duplication and ugly config.h hack by using av_strlcat/av_strlcpyreimar2007-07-053-39/+0
| | | | | | | instead of plain strlcat/strlcpy git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@23723 b3059339-0415-0410-9bf9-f77b7e298cf2
* "()" to "(void)" function param list fixesuau2007-04-012-2/+2
| | | | | | | patch from Stefan Huehner, stefan huehner org git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@22904 b3059339-0415-0410-9bf9-f77b7e298cf2
* Update copyright year.diego2007-03-241-1/+1
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@22794 b3059339-0415-0410-9bf9-f77b7e298cf2
* Do not disable cache on MinGW, just disable shmem compilation.diego2007-03-171-1/+1
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@22705 b3059339-0415-0410-9bf9-f77b7e298cf2
* cosmetics: Fix indentation, reorder some lines for consistency.diego2007-03-131-1/+0
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@22549 b3059339-0415-0410-9bf9-f77b7e298cf2
* Give more descriptive names to the source and library variables and splitdiego2007-03-131-17/+17
| | | | | | | between common, MPlayer-specific and MEncoder-specific parts. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@22546 b3059339-0415-0410-9bf9-f77b7e298cf2
* Add code to detect and convert to console codepage on Windows.reimar2007-03-042-0/+58
| | | | | | | Patch by Zuxy Meng [zuxy.meng at gmail com] git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@22460 b3059339-0415-0410-9bf9-f77b7e298cf2
* Include stdio.h for printfreimar2007-03-041-0/+3
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@22459 b3059339-0415-0410-9bf9-f77b7e298cf2
* Move the decision about stream cache compilation to configure.diego2007-02-271-2/+0
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@22366 b3059339-0415-0410-9bf9-f77b7e298cf2
* Move glob-win.c out of MinGW section, configure handles it.diego2007-02-271-1/+1
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@22365 b3059339-0415-0410-9bf9-f77b7e298cf2
* 100l misplaced #endifdiego2007-01-121-1/+1
| | | | | | | patch by elupus, elupus ecce se git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@21883 b3059339-0415-0410-9bf9-f77b7e298cf2
* Remove superfluous #ifdefs.diego2007-01-111-5/+0
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@21880 b3059339-0415-0410-9bf9-f77b7e298cf2
* Split strl.c into strl(cat|cpy).c and move #ifdefs into the build system.diego2007-01-104-38/+39
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@21875 b3059339-0415-0410-9bf9-f77b7e298cf2
* Split fseeko.c into fseeko.c and ftello.c, move #ifdefs into the build system.diego2007-01-103-19/+22
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@21874 b3059339-0415-0410-9bf9-f77b7e298cf2
* Move #ifdef directives around complete files into the build system.diego2007-01-1010-33/+13
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@21873 b3059339-0415-0410-9bf9-f77b7e298cf2
* Remove redundant ifdef, this file is only ever compiled on MinGW.diego2007-01-101-2/+0
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@21872 b3059339-0415-0410-9bf9-f77b7e298cf2
* consistent include pathdiego2007-01-101-1/+1
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@21871 b3059339-0415-0410-9bf9-f77b7e298cf2
* bswap.h --> mpbswap.hdiego2007-01-101-1/+1
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@21870 b3059339-0415-0410-9bf9-f77b7e298cf2
* Always use tcgetattr/tcsetattr instead of #ifdef messreimar2006-12-121-18/+0
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@21605 b3059339-0415-0410-9bf9-f77b7e298cf2
* fix include clash for mmap_anon on darwin ppcnplourde2006-12-051-1/+1
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@21505 b3059339-0415-0410-9bf9-f77b7e298cf2
* Move the generation of osdep/mplayer-rc.o back to the top-level Makefile,diego2006-12-041-1/+0
| | | | | | | | having it as a part of osdep/libosdep.a is not enough. based on a patch by Zuxy Meng, zuxy.meng gmail com git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@21489 b3059339-0415-0410-9bf9-f77b7e298cf2
* FFmpeg-style dependency declarationdiego2006-11-271-4/+3
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@21325 b3059339-0415-0410-9bf9-f77b7e298cf2
* Simplify, TARGET_WIN32 is both Cygwin and MinGW.diego2006-11-271-4/+1
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@21313 b3059339-0415-0410-9bf9-f77b7e298cf2
* Merge common parts of all Makefiles into one file included by all.diego2006-11-261-27/+1
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@21275 b3059339-0415-0410-9bf9-f77b7e298cf2
* Disable when HAVE_SYS_MMAN_H is not defined, since it can not be compiled then.reimar2006-11-261-0/+3
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@21269 b3059339-0415-0410-9bf9-f77b7e298cf2
* Adjust icon path since windres is now called from osdep subdirreimar2006-11-261-1/+1
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@21268 b3059339-0415-0410-9bf9-f77b7e298cf2
* Remove useless fd parameter for mmap_anonreimar2006-11-262-6/+3
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@21264 b3059339-0415-0410-9bf9-f77b7e298cf2
* Remove superfluous comment.diego2006-11-251-3/+0
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@21222 b3059339-0415-0410-9bf9-f77b7e298cf2
* all should be the first target.diego2006-11-251-2/+2
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@21210 b3059339-0415-0410-9bf9-f77b7e298cf2
* 10l copy + paste typodiego2006-11-251-1/+1
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@21208 b3059339-0415-0410-9bf9-f77b7e298cf2
* Simplify LIBNAME target with $@ and $^.diego2006-11-251-2/+2
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@21207 b3059339-0415-0410-9bf9-f77b7e298cf2
* Remove commented-out cruft.diego2006-11-251-4/+0
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@21206 b3059339-0415-0410-9bf9-f77b7e298cf2
* Move osdep/mplayer.rc handling to the osdep Makefile.diego2006-11-251-0/+6
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@21205 b3059339-0415-0410-9bf9-f77b7e298cf2
* added mmap_anon to osdep lib. Used in loader for nownplourde2006-11-253-0/+76
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@21203 b3059339-0415-0410-9bf9-f77b7e298cf2
* Unify dep/depend targets.diego2006-11-201-3/+1
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@21096 b3059339-0415-0410-9bf9-f77b7e298cf2
* * remove extern definitions of functions in .c filesattila2006-09-121-0/+3
| | | | | | | | | | | | | | | | | * create new .h files where necessary todo: * go trough other files than mplayer.c * vf_menu_pause_update() * mp_input_register_options() * import_playtree_playlist_into_gui() * import_initial_playtree_into_gui() For more infos see http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/2006-September/045683.html ( 20060902133225.2cc82aec.attila@kinali.ch on -dev-eng ) git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@19814 b3059339-0415-0410-9bf9-f77b7e298cf2
* Move all internal -I parameters to the front of CFLAGS to avoid using externaldiego2006-08-171-1/+1
| | | | | | | | header files that happen to have the same name as internal ones. based on a patch by Vladislav Naumov, vladislav.naumov **at** gmail **dot** com git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@19426 b3059339-0415-0410-9bf9-f77b7e298cf2
* introduce new 'stream' directory for all stream layer related components and ↵ben2006-07-311-1/+1
| | | | | | split them from libmpdemux git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@19277 b3059339-0415-0410-9bf9-f77b7e298cf2
* OPTFLAGS already includes EXTRA_INC.diego2006-07-121-1/+1
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@19042 b3059339-0415-0410-9bf9-f77b7e298cf2
* Remove now obsolete .cvsignore files.diego2006-06-021-1/+0
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@18556 b3059339-0415-0410-9bf9-f77b7e298cf2
* remove useless cruft (caused error tz undefined)rfelker2006-05-131-4/+2
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@18468 b3059339-0415-0410-9bf9-f77b7e298cf2
* 10l, fix broken if (X >= Y >= Z) comparison, probably stopped F-keys from ↵reimar2006-04-151-1/+1
| | | | | | working git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@18108 b3059339-0415-0410-9bf9-f77b7e298cf2
* getch2 should wait for input. Fixes 100% CPU usage during cache fill.reimar2006-04-101-0/+1
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@18071 b3059339-0415-0410-9bf9-f77b7e298cf2
* cosmetics: Shorten overly long lines, put SRCS/OBJS on individual linesdiego2006-03-251-3/+10
| | | | | | | to ease patching in the future. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@17944 b3059339-0415-0410-9bf9-f77b7e298cf2
* Missing initializationreimar2006-03-081-1/+1
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@17768 b3059339-0415-0410-9bf9-f77b7e298cf2
* Patch by Stefan Huehner / stefan % huehner ! org \rathann2006-02-094-14/+14
| | | | | | | | | | | | | | | | | | | | | | patch replaces '()' for the correct '(void)' in function declarations/prototypes which have no parameters. The '()' syntax tell thats there is a variable list of arguments, so that the compiler cannot check this. The extra CFLAG '-Wstrict-declarations' shows those cases. Comments about a similar patch applied to ffmpeg: That in C++ these mean the same, but in ANSI C the semantics are different; function() is an (obsolete) K&R C style forward declaration, it basically means that the function can have any number and any types of parameters, effectively completely preventing the compiler from doing any sort of type checking. -- Erik Slagter Defining functions with unspecified arguments is allowed but bad. With arguments unspecified the compiler can't report an error/warning if the function is called with incorrect arguments. -- Måns Rullgård git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@17567 b3059339-0415-0410-9bf9-f77b7e298cf2
* Make clean/distclean behave uniformly in all directories.diego2006-01-271-2/+2
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@17489 b3059339-0415-0410-9bf9-f77b7e298cf2
* AIX PPC portdiego2005-12-291-3/+3
| | | | | | | patch by "Derek E. Lewis" < -- dlewis -- @ -- solnetworks -- . -- net -- > git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@17265 b3059339-0415-0410-9bf9-f77b7e298cf2
* change erase to end of line, fall back to old behavior if no termcap foundods152005-12-292-4/+3
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@17259 b3059339-0415-0410-9bf9-f77b7e298cf2
* Fix erase to end of line with windows, windows terminal does not supportods152005-12-271-1/+1
| | | | | | | control codes. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@17252 b3059339-0415-0410-9bf9-f77b7e298cf2
* 10000l to me, broke compilation on mingw, erase_to_end_of_line needs to beods152005-12-261-0/+1
| | | | | | | in both getch2 and getch2-win because only one of them is linked to. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@17248 b3059339-0415-0410-9bf9-f77b7e298cf2
* - move our setenv() fallback implementation to osdepal2005-12-262-1/+30
| | | | | | | | | | | - assert that the override param is nonzero (zero is not implemented) - correct return value type to int based on a patch by Diego fixes bugzilla bug #342 git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@17246 b3059339-0415-0410-9bf9-f77b7e298cf2
* Use termcap "erase to end of line" character code instead of using spacesods152005-12-252-0/+6
| | | | | | | to end of screen. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@17241 b3059339-0415-0410-9bf9-f77b7e298cf2
* Unify include paths, -I.. is in CFLAGS.diego2005-11-1414-17/+17
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@16986 b3059339-0415-0410-9bf9-f77b7e298cf2
* libvo input cleanup: remove the dependency on libinput,albeu2005-11-021-6/+19
| | | | | | | remove most of the crappy mappings (like O->o or ESC->q). git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@16893 b3059339-0415-0410-9bf9-f77b7e298cf2
* fix broken (off-by-one) behavior of our strl* functions (patch by reimar)rfelker2005-10-251-17/+5
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@16854 b3059339-0415-0410-9bf9-f77b7e298cf2
* use libvbe from vesautilsalex2005-08-185-2027/+0
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@16257 b3059339-0415-0410-9bf9-f77b7e298cf2
* add some closedir() to fix some opendir() leaksaurel2005-07-221-1/+3
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@16062 b3059339-0415-0410-9bf9-f77b7e298cf2
* proper disabling/enabling of console output for vo_vesaaurel2005-07-161-21/+26
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@15981 b3059339-0415-0410-9bf9-f77b7e298cf2
* not used anymorereimar2005-05-271-9/+0
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@15578 b3059339-0415-0410-9bf9-f77b7e298cf2
* DragonFly BSD supportdiego2005-05-251-3/+3
| | | | | | | patch by Joerg Sonnenberger <joerg - at - britannica - dot - bec - dot - de> git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@15567 b3059339-0415-0410-9bf9-f77b7e298cf2
* use sleep_accurate darwin timernplourde2005-04-271-1/+11
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@15276 b3059339-0415-0410-9bf9-f77b7e298cf2
* - fix gcc warnings, strlcat/strlcpy prototypesrathann2005-04-061-3/+4
| | | | | | | - fix bad sscanf usage in geometry.c git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@15059 b3059339-0415-0410-9bf9-f77b7e298cf2
* add support for macosx finder argument support (let you bundle mplayer to be ↵nplourde2004-11-102-0/+111
| | | | | | a finder compliant .app) patch by Chris Roccati <roccati@pobox.com> git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@13910 b3059339-0415-0410-9bf9-f77b7e298cf2
* repace call to sleep_accurate to usleep which fix hang while using -cache ↵nplourde2004-10-271-9/+1
| | | | | | option on osx git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@13777 b3059339-0415-0410-9bf9-f77b7e298cf2
* Zeta OS support, mostly working.reimar2004-10-114-0/+23
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@13613 b3059339-0415-0410-9bf9-f77b7e298cf2
* Currently vbeGetProtModeInfo call the 0x4f0a function of int 10h the getfaust32004-10-061-8/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | a simple 32 bits protected mode interface to some VESA functions. This protected mode interface is interesting because it's quicker than the raw int 10h interface. Unfortunatly, begining with VBE 3.0, the 0x4f0a function is optional, and some video cards don't implement it (3dfx, intel 845/855/865...). This protected mode interface is then only used in vbeSetWindow and vbeSetDisplayStart :  - vbeSetWindow already implement an alternative methode if protected mode interface is not available.  - vbeSetDisplayStart also contain an alternative implementation, but this one is disabled with a #if 0. I don't exactly know why because it works well ! So currently, cards which don't have the 0x4f0a function are not supported. This patch correct this.  - vbeGetProtModeInfo failure is not fatal.  - vbeSetDisplayStart has it's alternative implementation reenabled.    it's used only with cards which don't have the 0x4f0a function    so this won't make any difference for cards which were already    working. This patch also make the failure of vbeGetModeInfo not fatal. The VBE 3.0 standard state that GetModeInfo can fail with some mode which are listed as supported if the mode can't be used in the current situation (not enough video memory for example). So a failure of vbeGetModeInfo don't mean that other modes won't work and should really not be fatal. patch by Aurelien Jacobs <aurel@gnuage.org> git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@13569 b3059339-0415-0410-9bf9-f77b7e298cf2
* stdout and stderr are macros --- you can't assign to them. Assignment ↵faust32004-09-161-2/+2
| | | | | | doesn't make sense anyway, because freopen will always return the same FILE * structure that it got in parameter. patch by Mikulas Patocka <mikulas@artax.karlin.mff.cuni.cz> git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@13353 b3059339-0415-0410-9bf9-f77b7e298cf2
* fix slave mode for mingw, patch by Anton Ragnarsson <anton.ragnarsson.1093 ↵faust32004-08-131-12/+6
| | | | | | at student.uu.se> some cleanup by be git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@13016 b3059339-0415-0410-9bf9-f77b7e298cf2
* And a tiny compile fix.wight2004-08-041-1/+1
| | | | | | | I should learn to test before apply. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@12956 b3059339-0415-0410-9bf9-f77b7e298cf2
* Native darwin timer update.wight2004-08-044-107/+63
| | | | | | | Patch by Dan Christiansen <danchr@daimi.au.dk> git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@12955 b3059339-0415-0410-9bf9-f77b7e298cf2
* typodiego2004-06-281-1/+1
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@12720 b3059339-0415-0410-9bf9-f77b7e298cf2
* mingw crosscompiling step 1faust32004-06-271-2/+2
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@12707 b3059339-0415-0410-9bf9-f77b7e298cf2
* 10lfaust32004-06-261-1/+1
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@12678 b3059339-0415-0410-9bf9-f77b7e298cf2
* neomagic tv out support throught vesa vbe, patch by Rudolf Marekalex2004-06-252-0/+44
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@12661 b3059339-0415-0410-9bf9-f77b7e298cf2
* string handling security fixesdiego2004-06-252-1/+49
| | | | | | | | patch by Nicholas Kain, Alexander Strasser <eclipse7@gmx.net> reviewed by Pontscho, Alex, Rich git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@12647 b3059339-0415-0410-9bf9-f77b7e298cf2
* name changediego2004-06-251-2/+2
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@12646 b3059339-0415-0410-9bf9-f77b7e298cf2
* ranlib cleanup by Dan Christiansenalex2004-06-241-0/+1
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@12633 b3059339-0415-0410-9bf9-f77b7e298cf2
* morphos support by Nicolas Detalex2004-04-051-1/+1
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@12123 b3059339-0415-0410-9bf9-f77b7e298cf2
* 10l for the orignial author and 1000l for me for commiting a broken workaroundfaust32004-04-041-2/+2
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@12116 b3059339-0415-0410-9bf9-f77b7e298cf2
* fseeko emulation patch by Steven M. Schultz <sms at 2bsd.com>faust32004-03-262-1/+85
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@12072 b3059339-0415-0410-9bf9-f77b7e298cf2
* The attached patch fixes a minor build problem on GNU/k*BSD: getch2.c shoulddiego2004-03-241-3/+3
| | | | | | | | check for Glibc, not GNU. patch by Robert Millan <zeratul2@wanadoo.es> git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@12064 b3059339-0415-0410-9bf9-f77b7e298cf2
* disable buggy code, patch by Romain Dolbeaualex2004-01-281-0/+4
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@11868 b3059339-0415-0410-9bf9-f77b7e298cf2
* Modification statement added.diego2004-01-161-0/+2
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@11796 b3059339-0415-0410-9bf9-f77b7e298cf2
* happy new year, copyright is MPlayer team now, naming cosmeticsdiego2004-01-121-2/+2
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@11780 b3059339-0415-0410-9bf9-f77b7e298cf2
* linux 2.6 patch by "ismail 'cartman' dönmez" <ismail.donmez@boun.edu.tr>attila2004-01-101-0/+9
| | | | | | | no idea whether this really works :) git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@11766 b3059339-0415-0410-9bf9-f77b7e298cf2
* Save fs before calling vm86, this might eleminate bugs (if there were any) ↵alex2003-11-241-1/+3
| | | | | | in cooperation of using vesa with win32 dlls. Patch by Peter Kosinar <goober@ksp.sk> git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@11520 b3059339-0415-0410-9bf9-f77b7e298cf2
* Sleep(0) != usleep(0), bugreport by Paul-Kenji Cahierfaust32003-11-161-0/+4
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@11481 b3059339-0415-0410-9bf9-f77b7e298cf2
* cumulative libc5 compatibility patch ;)gabucino2003-11-132-0/+10
| | | | | | | | - VESA detection by sys/io.h header - workaround a missing define on libc5 git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@11456 b3059339-0415-0410-9bf9-f77b7e298cf2
* Fix pthread & lrmi segfault issue. ("Oleg I. Vdovikin" <vdovikin@jscc.ru>)ranma2003-11-111-0/+8
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@11435 b3059339-0415-0410-9bf9-f77b7e298cf2
* add a read function for slave mode on mingwfaust32003-09-221-0/+19
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@10929 b3059339-0415-0410-9bf9-f77b7e298cf2
* warning fix (missing C initializer)pl2003-09-121-2/+2
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@10858 b3059339-0415-0410-9bf9-f77b7e298cf2
* 10lalex2003-08-031-3/+0
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@10516 b3059339-0415-0410-9bf9-f77b7e298cf2
* Obsoleted by timer-win2.c.diego2003-06-181-71/+0
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@10308 b3059339-0415-0410-9bf9-f77b7e298cf2
* obsoleted by timer-darwin.cdiego2003-06-111-64/+0
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@10281 b3059339-0415-0410-9bf9-f77b7e298cf2
* renames: DATADIR->MPLAYER_DATADIR, CONFDIR->MPLAYER_CONFDIR, ↵arpi2003-06-091-1/+0
| | | | | | LIBDIR->MPLAYER_LIBDIR git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@10273 b3059339-0415-0410-9bf9-f77b7e298cf2
* fix volume increasingfaust32003-06-011-1/+3
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@10231 b3059339-0415-0410-9bf9-f77b7e298cf2
* use threads on windowsfaust32003-05-261-1/+1
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@10198 b3059339-0415-0410-9bf9-f77b7e298cf2
* Precise timer for Darwin (it's more accurate than timer-macosx.c)alex2003-05-212-2/+171
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@10149 b3059339-0415-0410-9bf9-f77b7e298cf2
* uninit fix by Aurelien JACOBS <aurel at gnuage.org>faust32003-05-161-1/+1
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@10115 b3059339-0415-0410-9bf9-f77b7e298cf2
* alternative timer and glob emulation code for mingw32 portfaust32003-04-255-3/+145
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@9984 b3059339-0415-0410-9bf9-f77b7e298cf2
* windows resource file for versioninfo and iconfaust32003-04-201-0/+39
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@9945 b3059339-0415-0410-9bf9-f77b7e298cf2
* disable getch2 on windows when we can't read stdin (msys)faust32003-04-191-3/+10
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@9937 b3059339-0415-0410-9bf9-f77b7e298cf2
* mem mapped area need to be unmapped.albeu2003-04-122-2/+9
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@9915 b3059339-0415-0410-9bf9-f77b7e298cf2
* keypad and function (f1-f10) suppport (currently only vo_sdl and the ↵alex2003-04-091-0/+17
| | | | | | terminal input code supports it). Patch by Vladimir Mosgalin <mosgalin@VM10124.spb.edu> git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@9892 b3059339-0415-0410-9bf9-f77b7e298cf2
* Unbreakrguyom2003-04-041-0/+1
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@9835 b3059339-0415-0410-9bf9-f77b7e298cf2
* enable timer-win and getch2-win for mingw32faust32003-04-041-4/+13
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@9831 b3059339-0415-0410-9bf9-f77b7e298cf2
* gettimeofday() emulation using ftime()faust32003-04-041-0/+11
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@9830 b3059339-0415-0410-9bf9-f77b7e298cf2
* Support for "internet" or "multimedia" keyboards in X11.albeu2003-04-041-0/+6
| | | | | | | Patch from Jason Tackaberry <tack at auc dot ca>. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@9823 b3059339-0415-0410-9bf9-f77b7e298cf2
* atm shmem.c is only needed for cache2faust32003-04-021-0/+4
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@9798 b3059339-0415-0410-9bf9-f77b7e298cf2
* windows getch2 for MINGW32 portfaust32003-03-301-0/+109
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@9767 b3059339-0415-0410-9bf9-f77b7e298cf2
* high precision timer for windows patch by Frodo <csharprules at hotmail.com>faust32003-03-301-0/+71
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@9766 b3059339-0415-0410-9bf9-f77b7e298cf2
* precise macosx timer by Dan Christiansen <danchr@daimi.au.dk> and 10l fix by mealex2003-02-192-2/+73
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@9466 b3059339-0415-0410-9bf9-f77b7e298cf2
* linux->osdeparpi2003-02-0916-0/+2705
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@9381 b3059339-0415-0410-9bf9-f77b7e298cf2