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