summaryrefslogtreecommitdiffstats
path: root/player/main.c
Commit message (Collapse)AuthorAgeFilesLines
* audio: refactor mixer code and delete mixer.cwm42016-07-171-2/+0
| | | | | | | | | | | | | | | | | mixer.c didn't really deserve to be separate anymore, as half of its contents were unnecessary glue code after recent changes. It also created a weird split between audio.c and af.c due to the fact that mixer.c could insert audio filters. With the code being in audio.c directly, together with other code that unserts filters during runtime, it will be possible to cleanup this code a bit and make it work like the video filter code. As part of this change, make the balance code work like the volume code, and add an option to back the current balance value. Also, since the balance semantics are unexpected for most users (panning between the audio channels, instead of just changing the relative volume), and there are some other volumes, formally deprecate both the old property and the new option.
* player: add missing space to error messagewm42016-07-021-1/+1
|
* player: fatal error if linked and compiled FFmpeg versions mismatchwm42016-07-011-0/+12
| | | | | | | | | We don't support this anymore. This tries to exit in a controlled way after command line options are applied in order to honor logging options and, in case of libmpv, not to kill the host. Not sure if it would be better to just vomit text to stderr and call abort().
* ipc: add Windows implementation with named pipesJames Ross-Gowan2016-03-231-2/+0
| | | | | | | | | | | | | | | This implements the JSON IPC protocol with named pipes, which are probably the closest Windows equivalent to Unix domain sockets in terms of functionality. Like with Unix sockets, this will allow mpv to listen for IPC connections and handle multiple IPC clients at once. A few cross platform libraries and frameworks (Qt, node.js) use named pipes for IPC on Windows and Unix sockets on Linux and Unix, so hopefully this will ease the creation of portable JSON IPC clients. Unlike the Unix implementation, this doesn't share code with --input-file, meaning --input-file on Windows won't understand JSON commands (yet.) Sharing code and removing the separate implementation in pipe-win32.c is definitely a possible future improvement.
* options: set fs=yes by default on RPI, and change RPI defaults handlingwm42016-02-051-0/+5
| | | | | The main reason for changing the fullscreen default is that not doing it would change the vo_rpi default behavior with the previous commit.
* mpv_talloc.h: rename from talloc.hDmitrij D. Czarkoff2016-01-111-1/+1
| | | | This change helps avoiding conflict with talloc.h from libtalloc.
* Update copyright yearwm42016-01-011-1/+1
| | | | Merry christmas, or whatever the fuck is going on right now.
* sub: always recreate ASS_Renderer on subtitle decoder reinitwm42015-12-261-3/+0
| | | | | | | This includes the case of switching ordered chapter boundaries. It will now be recreated on each timeline part switch. This shouldn't be much of a problem with modern libass. (Older libass versions use fontconfig for memory fonts, and will be very slow to reinitialize memory fonts.)
* options: handle terminal/logging settings eagerlywm42015-11-041-0/+1
| | | | | | | | | | | Update msg.c state immediately if a terminal or logging setting is set. Until now, this was delayed until mp[v]_initialize() was called. When using the client API, you could easily miss logged error messages, even when logging was initialized early on by calling mpv_request_log_messages(). (Properties can't be used for this either, because properties do not work before mpv_initialize().)
* player: fix another --force-window bugwm42015-09-231-1/+1
| | | | | | Will this shit ever actually work? Fixes #2339.
* player: make force-window in auto-profiles actually workwm42015-09-201-16/+2
| | | | | | | | | | | The previous commit was incomplete (and I didn't notice due to a broken test procedure). The annoying part is that actually creating the VO was separate; redo this and merge the code for this into handle_force_window() as well. This will also make implementing proper reaction to runtime option changes easier. (Only the part for actually listening to option changes is missing.)
* player: add missing \n to a messagewm42015-07-131-1/+1
|
* sub: protect ASS_Renderer statewm42015-07-061-0/+3
| | | | | | | | | | | | | | | | | | | Each subtitle track gets its own decoder instance (sd_ass). But they use a shared ASS_Renderer. This is done mainly because of fontconfig. Initializing fontconfig is very slow when using it with memory fonts, so there's a practical need to cache this memory font state, which is done by not creating separate ASS_Renderers. This is very dirty and very evil, but we probably can't get rid of it any time soon. The shared ASS_Renderer was not properly synchronized. While the program logic guarantees that only one sd_ass instance is visible at a time, there are other interactions that require synchronization. In particular, I suspect concurrent execution of mp_ass_configure_fonts() and sd_ass.get_bitmaps cause issues in a newer libass development branch. So here's a shitty hack that hopefully fixes things, hopefully only until libass becomes less dependent on fontconfig.
* audio: add --audio-spdif as new method for enabling passthroughwm42015-06-051-0/+4
| | | | | | | | | | | | | This provides a new method for enabling spdif passthrough. The old method via --ad (--ad=spdif:ac3 etc.) is deprecated. The deprecated method will probably stop working at some point. This also supports PCM fallback. One caveat is that it will lose at least 1 audio packet in doing so. (I don't care enough to prevent this.) (This is named after the old S/PDIF connector, because it uses the same underlying technology as far as the higher level protoco is concerned. Also, the user should be renamed that passthrough is backwards.)
* options: remove --slave-brokenwm42015-05-271-6/+0
| | | | It has been deprecated for ages.
* player: set cocoa input context at an earlier pointwm42015-05-271-4/+4
| | | | | There is not much of a reason to do this later. (Since some time ago, the input_ctx is created right at the start, so this can be done now.)
* player: load scripts at an earlier pointwm42015-05-271-4/+4
| | | | This is about as early as possible.
* Always block SIGPIPE globallywm42015-05-111-0/+7
| | | | | | | | | | | | | | | 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.
* player: add --force-window=immediate modewm42015-05-081-0/+2
| | | | | | | This creates the window before the first file is loaded. This was requested a bunch of times, but on the other hand a change to make this behavior the default was reverted some time ago, because other users hated it.
* player: use profiles for libmpv and encoding defaultswm42015-05-071-10/+31
| | | | | | | | The client API (libmpv) and encoding (--o) have slightly different defaults from the command line player. Instead of doing a bunch of calls to set the options explicitly, use profiles. This is simpler and has the advantage that they can be listed on command line (instead of possibly forcing the user to find and read the code to know all the details).
* path: start special espansion with ~~name instead of ~namewm42015-05-031-1/+1
| | | | | | | Since commit 7381db60, strings like "~desktop/" were expanded as platform-specific paths by mpv. Apparently this similarity to standard Unix shell expansion caused confusion, so change it to "~~desktop/". The shell doesn't expand this, so it should be better.
* options: remove --leak-reportwm42015-05-021-11/+3
| | | | Use the environment variable instead.
* win32: move platform specifics to osdepwm42015-05-021-25/+0
| | | | | 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-021-0/+1
| | | | | | 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.
* screenshots: change default directory in pseudo-gui mode to desktopwm42015-05-011-1/+2
| | | | | | | | This should take care of the endless complaints about the default location for screenshots (and will of course create new ones). If the screenshot-template is set to an absolute path, the directory won't be used. So this should be reasonably compatible.
* Update license headersMarcin Kurczewski2015-04-131-5/+4
| | | | Signed-off-by: wm4 <wm4@nowhere>
* win32: use a platform-specific unicode entry-pointJames Ross-Gowan2015-04-111-8/+4
| | | | | | | | | | 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.
* player: use config parser for setting up pseudo-gui profilewm42015-04-101-9/+7
|
* player: change pseudo-gui settingswm42015-04-101-2/+1
| | | | | | Remove --keep-open. Switch to --idle=once. This effectively makes the player quit after end of playback, but still shows the idle screen if it was started with no files.
* player: do not accidentally init terminalwm42015-04-101-2/+1
| | | | | | | Starting the command line player with --no-terminal, the terminal was sitll initialized. This happened because update_logging() used the option value before the options were parsed. Fix by moving down the initialization to before the point where it's actually needed.
* player: add --idle --keep-open to pseudo-gui profilewm42015-04-021-0/+2
|
* player: add "pseudo-gui" profilewm42015-04-021-0/+8
| | | | | | | | | | | | | | This can be set to select a number of default settings that help mpv pretend that it has a GUI. I haven't decided yet whether I really want to use the profile mechanism for this. There are a number of weird details that are not so easy to handle with profiles, such as disabling pseudo-gui mode again (you can't unset profiles directly). So this might change. But for now it will do. There also should be a better way to store builtin profiles. Unfortunately, the old crappy MPlayer config file parser needs on-disk files, so just use a bunch of function calls for now.
* encode: make --audio-channels=auto workwm42015-03-231-2/+4
| | | | Basically requested. Not that anyone cares.
* player: dump list of satisfied deps instead of config.h with -vwm42015-03-111-1/+1
| | | | | | Starting to get tired of seeing the full config.h in verbose output every time. Make it slightly more elegant by outputting the list of satisfied dependencies instead.
* player: restore --dump-statswm42015-03-101-6/+6
| | | | | Since the recent refactoring, it was initialized _before_ the command line player options were set, and consequently could not be enabled.
* player: fix operation if command line is emptywm42015-03-061-10/+11
| | | | | | | main() being called with argc==0 is probably possible. Fix by skipping the program name early. (I already changed and reverted this once, but this time we make sure that it's less likely to confuse the skipped argv with main()'s argv by naming it "options".)
* player, client API: refactor cplayer init, reduce client API differenceswm42015-03-051-44/+49
| | | | | | | | | | | | | Move the command line parsing and some other things to the common init routine shared between command line player and client API. This means they're using almost exactly the same code now. The main intended side effect is that the client API will load mpv.conf; though still only if config loading is enabled. (The cplayer still avoids creating an extra thread, passes a command line, and prints an exit status to the terminal. It also has some different defaults.)
* player: minor simplificationwm42015-03-051-3/+3
| | | | | argv is always terminated with a NULL, so we don't need to drag argc along. Simplifies the following commit a little bit.
* encoding: allow encoding to channel configurations other than stereowm42015-02-231-1/+3
| | | | | | | | | | A while ago, we made mpv output the native number of channels by default, instead of stereo. I assumed this was not wanted for encode mode. This commit keeps the assumption, but allows setting the number of audio output channels at all, instead of always forcing stereo. (Pretty much a hack.)
* encoding: fixed-vo option was removedwm42015-02-131-1/+0
|
* osx: move code to unset input context to the right placewm42015-02-121-4/+4
| | | | | | | Setting the input context is always called, both in cplayer and libmpv, and under HAVE_COCOA. Unsetting the input context was done only the cplayer uninit call. Also it was under HAVE_COCOA_APPLICATION, so it was not unset in libmpv (dangling pointer).
* osx: move cocoa specific call out of common codewm42015-02-121-8/+0
| | | | This is almost equivalent, and gets rid of the ifdef.
* player: drop explicit exit() callswm42015-02-121-14/+9
| | | | | | | | | The code in main.c calls exit() explicitly, but the code is actually easier to follow by simply exiting from main() instead. The exit() call in av_log.c happens only on severely broken builds, so replace it with abort(). (Shuts up rpmlint warnings.)
* Revert "player: make --force-window create the window immediately on start"wm42015-02-121-1/+0
| | | | | | | | | | | This reverts commit acc5e8f57419debdb74234a228b44db75023e28b. As expected, some didn't like this. Others won't like this revert. Whatever. See #1561. This should go into mpv 0.8.0 before it's released.
* player: make --force-window create the window immediately on startwm42015-02-031-0/+1
| | | | | | | | | | | | | | | | Before this change, window creation was delayed until the video was initialized. This guaranteed that the first window size was that of the video, so the WM would place it correctly. Some time ago, it was requested on the IRC channel that --force-window should not do this. Sometimes, it can take a while until video is initialized, e.g. when youtube-dl is used (which incurs lots of network delay). In this case, it's awkward that it takes so long until a window (any window) is shown. On the other hand, this can cause incorrect window placement with some WMs. We simply hope that this won't happen with modern WMs. (Although it does with the WM I use, crappy old IceWM.)
* player: remove --fixed-vowm42015-02-031-1/+0
| | | | | | | In ancient times, this was needed because it was not default, and many VOs had problems with it. But it was always default in mpv, and all VOs are required to deal with it. Also, running --fixed-vo=no is not useful and just creates weird corner cases. Get rid of it.
* win32: remove check for SetPriorityClass()wm42015-01-201-3/+3
| | | | | | | | | | This function is always available, which is reflected by the fact that the configure check doesn't actually bother to check for its existence. Instead, MinGW and Cygwin imply it. The check was probably "needed" when the priority code was still in a separate source file. Remove the check, and use _WIN32 for testing for the win32 API (in a bunch of other places too).
* win32: drop hacks for possibly broken static pthreads-win32 linkingwm42015-01-111-14/+0
| | | | | | | | | | | | We now use threads and other pthread API a lot, and not always we use it from threads created with pthread_create() (or the main thread). As I understand, with static linking we would have to use pthread_win32_thread_attach/detach_np() every time we enter or leave a foreign thread. We don't do this, and it's not feasible either, so it's just broken. This still should work with dynamic pthreads-win32. The MinGW pthread implementation should be unaffected from all of this.
* video: better pipelining with vf_vapoursynthwm42015-01-031-1/+1
| | | | | | | | | | Most of this is explained in the code comments. This change should improve performance with vapoursynth, especially if concurrent requests are used. This should change nothing if vf_vapoursynth is not in the filter chain, since non-threaded filters obviously can not asynchronously finish filtering of frames.
* player: move terminal input init to a better placewm42015-01-021-3/+3
| | | | | | Mostly of cosmetic nature. Move initialization to the same place where another component (cocoa) will start accessing the input context from a foreign thread.
* player: print config.h contents in verbose modewm42015-01-021-6/+14
| | | | | | | | | It was requested that mpv should print what features etc. have been enabled at compile time. It can print the configure command line, but it obviously doesn't include autodetected features. I tried to think of a nicer way than dumping the config.h as text, but this was still the simplest way.
* Update copyright yearwm42015-01-011-1/+1
|
* video: pass some VO params as structwm42014-12-311-3/+6
| | | | | Not particularly elegant, but better than adding more and more stuff to the relevant function signatures.
* options: expand ~ for the include optionStefano Pigozzi2014-12-301-1/+5
| | | | Fixes #1406
* player: make --shuffle/--merge-files affect runtime loaded playlistswm42014-12-291-9/+1
| | | | | | | Until now, these options took effect only at program start. This could be confusing when e.g. doing "mpv list.m3u --shuffle". Make them always take effect when a playlist is loaded either via a playlist file, or with the "loadlist" command.
* player: force stereo as default when encodingwm42014-12-271-0/+1
| | | | | | I think the new default for this option might be rather bad in encoding mode. For starters, we don't even know what layers an encoder supports at all.
* vo_opengl_cb: free context on exitwm42014-12-221-0/+3
| | | | | | | Minor memory leak. Actually, this also exposes some problems in the QtQuick example. This will have to be fixed in the example.
* client API: allow multiple mpv instances with terminal=yeswm42014-12-021-16/+20
| | | | | | | | | | | | | | | This is simply not allowed, and doing it triggered an assertion. It's still not allowed, because the terminal and related functionality is a global resource, and there doesn't seem to be a sane way to manage the signal handlers. But be a bit nicer, and just the terminal if it's already in use. Note that terminal _output_ happens anyway. This becomes usable with this commit. To facilitate logging-only usage further, also explicitly disable terminal input, so that "terminal=yes" can be used for logging without much interference with other things. (It'll still overwrite some signal handlers, though.)
* player: improve exit message in some scenarioswm42014-10-311-33/+37
| | | | | | | | | | | | | | If you played e.g. an audio-only file and something bad happened that interrupted playback, the exit message could say "No files played". This was awkward, so show a different message in this case. Also overhaul how the exit status is reported in order to make this easier. This includes things such as not reporting a playback error when loading playlists (playlists contain no video or audio, which was considered an error). Not sure if I'm happy with this, but for now it seems like a slight improvement.
* player: adjust uninit order of componentswm42014-10-241-6/+7
| | | | | | | | Most things should be allowed to access the client API unconditionally (for example for sending events), so move destroying the client API down. Also, mp_uninit_ipc() should happen before the point at which all clients are shutdown, or there will be a small time window in which new clients can be created after destroying them all.
* player: shutdown all clients before actual uninitwm42014-10-191-2/+2
| | | | | This seems safer. It might be possible that commands sent by the clients could recreate e.g. audio or video outputs.
* ipc: decouple from MPContextwm42014-10-191-5/+3
| | |