aboutsummaryrefslogtreecommitdiffhomepage
path: root/osdep
Commit message (Collapse)AuthorAge
* win32: restore support for exe directory as config directoryGravatar elevengu2014-02-14
| | | | | | | | 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]Gravatar Stefano Pigozzi2014-02-13
| | | | Fixup commit for 20fa191ad.
* cocoa: fix deadlock during initializationGravatar Stefano Pigozzi2014-02-13
| | | | | | Thanks to @wm4 for catching the bug. Fixes #405
* timer: init only onceGravatar wm42014-02-10
| | | | | | | | | | 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 thingGravatar wm42014-02-10
| | | | | | Makes working with the (still) single-threaded playback thread easier. Might be reusable for other stuff.
* threads: avoid timeout calculation overflowGravatar wm42014-02-10
| | | | | | | | | 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 codeGravatar wm42014-02-03
| | | | | 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 waitsGravatar wm42014-01-31
| | | | | | | | | | | | 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 mutexesGravatar wm42014-01-31
| | | | Damn this overly verbose pthread API.
* cocoa: sort files opened from Finder the same way Finder doesGravatar Bilal Syed Hussain2014-01-20
| | | | Fixes #497
* w32: use the w32_common keymap in terminal-win tooGravatar James Ross-Gowan2014-01-19
|
* io/win32: move mp_attach_console to terminal-win.cGravatar Martin Herkt2014-01-16
| | | | Why didn't I put it there from the start?
* cocoa: add application icon to the Dock when run from CLIGravatar Stefano Pigozzi2014-01-14
| | | | | | | | | | 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 upGravatar wm42014-01-14
| | | | | "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 keyGravatar wm42014-01-13
| | | | This worked just fine if terminfo or termcap was available.
* terminal-unix: fix fallbacks in case terminfo/termcap are disabledGravatar wm42014-01-13
| | | | | These two escape sequences were swapped. (They are used only if terminfo/termcap are not available.)
* terminal-unix: add termcap/terminfo documentation linksGravatar wm42014-01-13
| | | | | | | 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 handlingGravatar wm42014-01-13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 terminalGravatar wm42014-01-07
| | | | | Otherwise, it seems one of the term* libraries will write escape sequences to stdout, for whatever reason.
* Windows: use roaming AppData instead of localGravatar Martin Herkt2014-01-06
| | | | Whatever. Fixes #458.
* win32-console-wrapper: use child process exit codeGravatar Martin Herkt2014-01-06
|
* win32-console-wrapper: remove command line manglingGravatar Martin Herkt2014-01-06
| | | | This wasn't really necessary and caused a lot of problems.
* win32-console-wrapper: Fix heap corruptionGravatar Martin Herkt2014-01-06
| | | | FUCK the Windows API.
* cocoa: handle files drag and drop on the player video viewGravatar Stefano Pigozzi2014-01-04
|
* cocoa: refactor files drag and drop on the Dock iconGravatar Stefano Pigozzi2014-01-04
| | | | | 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)Gravatar Martin Herkt2014-01-02
|
* Windows: use the GUI subsystem, attach to consoleGravatar Martin Herkt2014-01-02
| | | | | | | | 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 detectionGravatar Martin Herkt2014-01-02
|
* Update copyright yearGravatar wm42014-01-01
|
* path-macosx: attempt to fix buildGravatar wm42013-12-22
| | | | Untested... no OSX here.
* macosx_application: replace mp_msg with stderr for semi-fatal errorGravatar wm42013-12-21
| | | | Apparently this should never be run anyway.
* path lookup functions: mp_msg conversionsGravatar wm42013-12-21
| | | | | | | | | | | | | | | | | 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 addedGravatar wm42013-12-21
| | | | | | | | | | | | | | 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 priorityGravatar wm42013-12-21
|
* terminal: abstract terminal color handlingGravatar wm42013-12-20
| | | | | | | | 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 codeGravatar wm42013-12-19
| | | | | | 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/hGravatar wm42013-12-19
| | | | | "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 headersGravatar wm42013-12-18
| | | | | | 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 definitionGravatar wm42013-12-18
|
* Fix OSX build; remove all remaining mpvcore referencesGravatar 11rcombs2013-12-17
|
* Split mpvcore/ into common/, misc/, bstr/Gravatar wm42013-12-17
|
* Merge mp_talloc.h into ta/ta_talloc.hGravatar wm42013-12-17
|
* Move options/config related files from mpvcore/ to options/Gravatar wm42013-12-17
| | | | | | | | | 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/Gravatar wm42013-12-17
|
* Replace mp_tmsg, mp_dbg -> mp_msg, remove mp_gtext(), remove set_osd_tmsgGravatar wm42013-12-16
| | | | | | | | | 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 uninitGravatar Stefano Pigozzi2013-12-07
| | | | | | | 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 GrGravatar Vivek Jain2013-12-02
| | | | | | | | | 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.hGravatar wm42013-11-30
| | | | Might be needed by fcntl() usage.
* Use O_CLOEXEC when creating FDsGravatar wm42013-11-30
| | | | | | | | | | | | | | 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 mandatoryGravatar wm42013-11-28
| | | | | | | | | | | 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.)