summaryrefslogtreecommitdiffstats
path: root/player
Commit message (Collapse)AuthorAgeFilesLines
* player: enable reading from stdin after loading input.confwm42016-09-293-7/+8
| | | | Someone requested this.
* ytdl_hook: Set aspect ratio for anamorphic videoRicardo Constantino2016-09-281-0/+6
|
* win32: make --priority runtime-settableJames Ross-Gowan2016-09-282-9/+16
| | | | | | | | | | I'm not sure if this option affects anything or if it's a placebo, especially since the VO thread is now registered with MMCSS. Still, I think --priority=high may have helped back when I used mplayer2 on a netbook. It's also possible that encoding-mode users would want to set --priority=idle. Anyway, it was one of the last M_OPT_FIXED options, so fix that.
* command: fix inverted condition in sub-reload commandwm42016-09-261-1/+1
| | | | Fixes #3586 (probably). Untested.
* player: allow opts in pseudo-gui set by the user to override user's defaultRicardo Constantino2016-09-261-2/+5
| | | | | | | | | | | | | | | | | | | | | This should still allow user-set default options to override built-in pseudo-gui while respecting user-set pseudo-gui options. Pros: - user option in default profile overrides built-in pseudo-gui's options Ex: screenshot-directory overrides built-in pseudo-gui's - user can "fix" pseudo-gui if some option like "force-window=no" is set in default by setting "force-window=yes" in [pseudo-gui] - `mpv --profile=pseudo-gui` will work as before Cons: - --show-profile=pseudo-gui won't display the built-in's options Original idea from wm4. Documentation edits mostly by wm4. Signed-off-by: wm4 <wm4@nowhere>
* video: trust demuxer framerate on invalid timestampswm42016-09-261-1/+1
| | | | | | | | | If the PTS goes backwards (whether it's a timestamp reset or some other problem) would just use 0 as frame duration. (At least until the logic for detecting divergence with the timestamps gets active.) Trust the demuxer framerate in these cases instead, if it's available. I think this improves behavior slightly with some broken files.
* scripting: don't attempt to load builtin scripts twicewm42016-09-261-1/+0
| | | | | | | | | During init it will first call mp_load_builtin_scripts(), and then again via mp_load_scripts(). This was harmless (a second attempt won't load it again if the first one was successful), but it's unnecessary, and also looks confusing if the scripts failed to load the first time.
* osc: Fix scaling issues when toggling fullscreenRicardo Constantino2016-09-251-0/+1
| | | | Fixes #3429
* lua: complain loudly if Lua state creation failswm42016-09-251-1/+3
| | | | | | | This should normally happen only if memory allocation for the state happens, which should be extremely rare. But with Luajit on OSX, it can happen if the magic compiler flags required by Luajit were not passed to mpv compilation. Print an error to reduce confusion.
* player: fix instant subtitle refresh on track switcheswm42016-09-241-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | When switching a subtitle track, the subtitle wasn't necessarily updated, especially when playback was paused. Some awfully subtle and complex interactions here. First off (and not so subtle), the subtitle decoder will read packets only on explicit update_subtitles() calls, which, if video is active, is called only when a new video frame is shown. (A simply video frame redraw doesn't trigger this.) So call it explicitly. But only if playback is "initialized", i.e. not when it does initial track selection and decoder init, during which no packets should be read. The second issue is that the demuxer thread simply will not read new packets just because a track was switched, especially if playback is paused. That's fine, but if a refresh seek is to be done, it really should do this. So if there's either 1. a refresh seek requested, or 2. a refresh seek ongoing, then read more packets. Note that it's entirely possible that we overflow the packet queue with this in unpredicated weird corner cases, but the queue limit will still be enforced, so this shouldn't make the situation worse.
* lua: fix array detectionwm42016-09-241-2/+2
| | | | | | | This was dumb and could return something like "{name=123}" as an array. Also, fix the error message if a key is not a string. lua_typename() takes a type directly, not a stack item.
* command: some minor corrections to previous commitwm42016-09-241-20/+19
| | | | | | | | | | | | | | | | | | | | | | | | The last commit was fine - just making some enhancements. Rename the function to parse_node_chapters(), since it really has not much to do with Lua. Don't use len<0 as check whether it makes sense to set chapters, and instead check for mpctx->demuxer (that includes the possibility to set chapters e.g. within a preload hook, but after chapters are initialized from the demuxer). Return M_PROPERTY_ERROR instead of M_PROPERTY_OK if the mpv_node has the wrong type. It's ok if a chapter has no title, so change the checks accordingly. Remove a Yoda condition. Notify that chapter metadata might have changed with mp_notify() (the chapter list itself is already taken care by generic code). Fix leaking the metadata allocations of the new chapter list.
* command: make it possible to set chapters via lua pluginsMaurycy Skier2016-09-241-1/+70
|
* player: fix intended pseudo-gui behaviorwm42016-09-231-3/+3
| | | | It's still supposed to be possible to customize the pseudo-gui section.
* player: do not let pseudo-gui override user config settingswm42016-09-231-0/+3
| | | | | | | | 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.
* m_config, command: remove some minor code duplicationwm42016-09-231-3/+2
| | | | | | I would have been fine with this, but now I want to add another flag, and the duplication would become more messy than having a strange function for deduplication.
* command: make most options observablewm42016-09-231-0/+6
| | | | | | | | | | | The property observation mechanism turns properties into integer IDs for fast comparison. This means if two properties get the same ID, they will receive the same notifications. Use this to make properties under options/ receive notifications. The option-property bridge marks top-level properties with the same name as the options. This still might not work in cases the C code sets values on options structs directly.
* command: fix potential UBwm42016-09-231-5/+5
| | | | Pointed out by quilloss on github.
* x11: fix external fullscreen updatewm42016-09-231-0/+9
| | | | | | | | | | | | On x11, you can change the fullscreen via the window manager and without mpv's involvement. In these cases, the internal fullscreen flag has to be updated. The hack used for this didn't really work properly. Change it accordingly. The important thing is that the shadow copy of the option is updated. This is still not really ideal. Fixes #3570.
* player: make audio-channels etc. runtime settablewm42016-09-221-0/+7
| | | | | | | | | If one of the audio output format options is set, brually reinit the audio chain. Since the audio-channels property is still mapped to the deprecated read-only property, "options/audio-channels" currently has to be used, e.g. "cycle-values options/audio-channels 2 7.1".
* command: add a load-script commandwm42016-09-223-5/+13
| | | | | | | The intention is to give libmpv users as much flexibility to load scripts as using mpv from CLI, but without restricting libmpv users from having to decide everything on creation time, or having to go through hacks like recreating the libmpv context to update state.
* player: remove some explicit options accesses when saving resume filewm42016-09-221-29/+26
| | | | | | | | | | | | | Basically, make use of all the new code. Unfortunately, the new code and it's "compromise semantics" with the old behavior before the options/properties merge bites back: this vid/aid/sid, deinterlace, and video-aspect properties have neutral default settings (such as "auto"), but return the current value during playback, so we would unnecessarily force this value when playback is resumed. So leave those as they are. Also, the colormatrix options were removed a long time ago.
* command: fix missing update notifications in some caseswm42016-09-221-0/+1
|
* player: some M_SETOPT_RUNTIME cleanupswm42016-09-223-21/+9
| | | | | | | | | Add this flag where needed. You shouldn't be able to set e.g. config-dir in these situations. Remove the mpctx->initialized check from the property/option bridge, since it's in use strictly only after initialization. Likewise, the apply-profile command doesn't need to check this.
* ytdl_hook: temporarily force disable dash segments formatsRicardo Constantino2016-09-221-4/+5
|
* player: add --watch-later-directory optionDavid Logie2016-09-221-2/+10
| | | | | | | This option allows the user to set the directory where "watch later" files are stored. Signed-off-by: wm4 <wm4@nowhere>
* client API: more or less deprecate mpv_set_option()wm42016-09-211-2/+11
| | | | | | | | | | | | | | | | | | | | | | With the merging of options and properties, the mpv_set_option() function is close to being useless, and mpv_set_property() can be used for everything instead. There are certain conflicts remaining, which are explained in depth in the docs. For now, none of this should affect existing code using the client API. Make mpv_set_property() redirect to mpv_set_option() before initialization. Remove some options marked as M_OPT_FIXED. The "pause" and "speed" options cannot be written anymore without the playloop being notified by it, so the M_OPT_FIXED does nothing. For "vo-mmcss-profile", the problem was lack of synchronization, which has been added. I'm not sure what the problem was with "frames" - I think it was only marked as M_OPT_FIXED because changing it during playback will have no effect. Except for pause/speed, these changes are needed to make them writable as properties after mpv_initialize(). Also replace all remaining uses of CONF_GLOBAL with M_OPT_FIXED.
* options: make input options generally runtime-settablewm42016-09-212-9/+26
|
* client API: fix init/destruction race conditionswm42016-09-213-8/+19
| | | | | | | | | | mp_new_client() blatantly accessed some mutex-protected state outside of the mutex. The destruction code is in theory OK, but with changes in the following commits it'll be a bit hard to guarantee that it stays this way. Add a simple flag that makes adding new clients impossible, so that having no clients after shutdown_clients() remains guaranteed.
* lua: add API for registering idle handlerswm42016-09-211-0/+10
| | | | | This is only a functionality the Lua event dispatcher provides, rather than the libmpv client API.
* lua: run timers only after draining the event queuewm42016-09-211-12/+11
| | | | | | Instead of rechecking the timers every time after an event is read, do it only once the event queue is empty. This is probably slightly more efficient, and facilitates the next commit.
* lua: expose subprocess_detachedrr-2016-09-211-0/+32
|
* command: make bitrate properties observablewm42016-09-211-1/+2
|
* client API: revert unintended mpv_wait_event() behavior changewm42016-09-211-3/+0
| | | | | Commit bf385e11 accidentally added some testing changes that were not intended to be committed.
* command: add a video-dec-params propertywm42016-09-201-1/+16
| | | | | | This is the actual decoder output, with no overrides applied. (Maybe video-params shouldn't contain the overrides in the first place, but damage done.)
* command: change update handling of some video-related propertieswm42016-09-201-24/+9
| | | | | | | | Use the new mechanism, instead of wrapped properties. As usual, extend the update handling to some options that were forgotten/neglected before. Rename video_reset_aspect() to video_reset_params() to make it more "general" (and we can amazingly include write access to video-aspect as well in this).
* player: kill associated OSD and key bindings when removing a scriptwm42016-09-203-2/+7
| | | | | The former was done already for Lua scripts, but move it to the generic code.
* audio: fix segfault when yanking USB DACKevin Mitchell2016-09-201-0/+1
| | | | | The ao_c pointer was stale after the mpctx entry was freed / NULLed. This prevented the correct early exit from fill_audio_out_buffers.
* player: make --osc/--ytdl settable during playbackwm42016-09-203-4/+36
| | | | | | | | | Setting the osc or ytdl properties will now load/unload the associated scripts. (For ytdl this does not mean the currently played URL will be reloaded.) Also add a changelog entry for this, which also covers the preceding work for --terminal.
* options, command: simplify some option updateswm42016-09-191-47/+13
| | | | | | | Remove wrapper properties for OSD and video position updates, use the new mechanism for them. We can mark the options directly. Update behavior will work for more options (since I've casually marked more affected options than the old less direct mechanism covered).
* client API: revert some relaxations about calling mpv_initialize()wm42016-09-191-0/+16
| | | | | | | | | | | | | | | | | | | | | | My original idea was making mpv_initialize() a no-op, but it seems this can't happen after all. The problem is especially with subtle interactions in option parsing (basically all pre-parse options). Instead, I might go into the opposite direction, and add a new API function that takes over the role of mpv_create+mpv_initialize, and which will take a list of options. This list will be for the purpose of setting options that can be set only at initialization time (such as config-dir). This would also make it more uniform with the command- line player initialization. Maybe. In any case, for now revert parts of commit 453fea87 to remove the initialization-related freedoms it added. Fortunately, this wasn't released yet, so we remove it from the API as if it never happened. (The rest of that commit is still fine, just not the additional freedom.)
* player: minor changes in init codewm42016-09-194-19/+11
| | | | | | | | | | | | Move the MPV_LEAK_REPORT env query to mp_create(), where it will also be used by the client API (it might be helpful, so why not). The same applies to MPV_VERBOSE. The prepare_playlist() call doesn't need to be in mp_initialize() and can just be in mp_play_files() to reduce the size of mp_initialize(). Also, remove wakeup_playloop(), which is 100% redundant with mp_wakeup_core_cb().
* player: make --log-file and --dump-stats freely settable at runtimewm42016-09-191-4/+0
| | | | | Same deal as with the previous commit. We use the file paths to decide when we should attempt to reopen them.
* player: make --terminal freetly settable at runtimewm42016-09-193-22/+30
| | | | | | | | | | | | | | | | | | | 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.
* options: slightly better option update mechanismwm42016-09-193-9/+16
| | | | | | | | | | | | | | Extend the flag-based notification mechanism that was used via M_OPT_TERM. Make the vo_opengl update mechanism use this (which, btw., also fixes compilation with OpenGL renderers forcibly disabled). While this adds a 3rd mechanism and just seems to further the chaos, I'd rather have a very simple mechanism now, than actually furthering the mess by mixing old and new update mechanisms. In particular, we'll be able to remove quite some property implementations, and replace them with much simpler update handling. The new update mechanism can also more easily refactored once we have a final mechanism that handles everything in an uniform way.
* command: add audio-pts property to get the audio ptsHector Martin2016-09-191-1/+14
| | | | | | | For audio files, this is identical to time-pos (except read-only). For audio-video files, this returns the audio position. Unlike time-pos, this is not quantized to a video frame. For video-only files, this property is unavailable.
* player: more option/property consistency fixeswm42016-09-183-34/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | Some properties had a different type from their equivalent options (such as mute, volume, deinterlace, edition). This wasn't really sane, as raw option values should be always within their bounds. On the other hand, these properties use a different type to reflect runtime limits (such as range of available editions), or simply to improve the "UI" (you don't want to cycle throuhg the completely useless "auto" value when cycling the "mute" property). Handle this by making them always return the option type, but also allowing them to provide a "constricted" type, which is used for UI purposes. All M_PROPERTY_GET_CONSTRICTED_TYPE changes are related to this. One consequence is that you can set the volume property to arbitrary high values just like with the --volume option, but using the "add" command it still restricts it to the --volume-max range. Also deprecate --chapter, as it is grossly incompatible to the chapter property. We pondered renaming it to --chapters, or introducing a more powerful --range option, but concluded that --start --end is actually enough. These changes appear to take care of the last gross property/option incompatibilities, although there might still be a few lurking.
* command: fix window-scale option/property inconsistencieswm42016-09-181-7/+4
| | | | | | | | | For some odd reason, value ranges for the window-scale option and property are different, and the property has a more narrow range. Change it to the option range. Also store the window-scale value into the option value when setting the property, so it will be persistent if the window is closed and reopened.
* options: rename/deprecate --playlist-poswm42016-09-181-2/+1
| | | | | | Conflicts with the "playlist-pos" property. They're really a bit too different, and since the --playlist-pos option is relatively new and obscure, just rename it to get this out of the way.
* command: minor fixes to video-aspect propertywm42016-09-181-8/+2
| | | | | | Make the option type exactly the same as the underlying option's one. I think this has no user-visible consequences, but makes more sense for the option-property bridge.
* command: fix --quiet, --really-quiet optionswm42016-09-181-0/+2
| | | | | | | These are not mapped as property, so the option-property bridge has to skip them. Do this automatically if a property is not found. I know that this affects --quiet and --really-quiet, but in theory there could be more.
* command: add an apply-profile commandwm42016-09-171-0/+8
| | | | | This will actually update all associated options (which is trivial now with the recent changes).
* options: take care of propertly updating options on runtime changeswm42016-09-173-3/+77
| | | | | | | | | | | | | | | | | | | | | | All option write accesses are now put through the property interface, which means runtime option value verification and runtime updates are applied. This is done even for command line arguments and config files. This has many subtle and not-so-subtle consequences. The potential for unintended and intended subtle or not-subtle behavior changes is very large. Architecturally, this is us literally jumping through hoops. It really should work the other way around, with options being able to have callbacks for value verification and applying runtime updates. But this would require rewriting the entirety of command.c. This change is more practical, and if anything will at least allow incremental changes. Some options are too incompatible for this to work - these are excluded with an explicit blacklist. This change fixes many issues caused by the mismatch between properties and options. For example, this fixes #3281.
* command: make window-scale redirect to option if no window createdwm42016-09-171-1/+1
| | | | For consistency with other properties that mirror options.
* options: simplify M_OPT_EXITwm42016-09-171-1/+1
| | | | | | | | | | | | | There were multiple values under M_OPT_EXIT (M_OPT_EXIT-n for n>=0). Somehow M_OPT_EXIT-n either meant error code n (with n==0 no error?), or the number of option valus consumed (0 or 1). The latter is MPlayer legacy, which left it to the option type parsers to determine whether an option took a value or not. All of this was changed in mpv, by requiring the user to use explicit syntax ("--opt=val" instead of "-opt val"). In any case, the n value wasn't even used (anymore), so rip this all out. Now M_OPT_EXIT-1 doesn't mean anything, and could be used by a new error code.
* player: don't enter playloop for client API requestswm42016-09-161-2/+0
| | | | | | | | | | | This _actually_ does what commit 8716c2e8 promised, and gives a slight performance improvement for client API users which make a lot of requests (like reading properties). The main issue was that mp_dispatch_lock() (which client.c uses to get exclusive access to the core) still called the wakeup callback, which made mp_dispatch_queue_process() exit. So the playloop got executed again, and since it does a lot of stuff, performance could be reduced.
* player: fix a missed wakeupwm42016-09-161-0/+1
| | | | |