summaryrefslogtreecommitdiffstats
path: root/osdep
Commit message (Collapse)AuthorAgeFilesLines
* 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
| | | | | | | | | | | | | | | | | | | | |