summaryrefslogtreecommitdiffstats
path: root/player/command.c
Commit message (Collapse)AuthorAgeFilesLines
* player: handle edition reloading slightly differentlywm42014-10-281-1/+1
| | | | | | | Use the codepath that is normally used for DVD/BD title switching and DVB channel switching. Removes some extra artifacts from the client API: now MPV_EVENT_END_FILE will never be called on reloads (and neither is MPV_EVENT_START_FILE).
* command: play the correct entry with loadfile ... append-playAlessandro Ghedini2014-10-271-1/+1
| | | | | The playlist may be non-empty even if the player is idle. Instead of playing the first entry, play the entry that was just added.
* command: try 'icy-title' metadata for media-title as wellAlessandro Ghedini2014-10-271-0/+3
|
* command: add audio-device propertywm42014-10-271-0/+11
| | | | Meant for changing the --audio-device at runtime.
* audio: add command/function to reload audio outputwm42014-10-271-0/+16
| | | | | Anticipated use: simple solution for dealing with audio APIs which request configuration changes via events.
* Drop libquvi supportwm42014-10-251-3/+0
| | | | | | | | | | | No development activity (or even any sign of life) for almost a year. A replacement based on youtube-dl will probably be provided before the next mpv release. Ask on the IRC channel if you want to test. Simplify the Lua check too: libquvi linking against a different Lua version than mpv was a frequent issue, but with libquvi gone, no direct dependency uses Lua, and such a clash is rather unlikely.
* command: finish hook execution if client failswm42014-10-241-5/+22
| | | | | Translation: if the (to be added) youtube-dl Lua script crashes, don't wait forever when opening something.
* command: add vo-configured propertywm42014-10-241-1/+10
| | | | | | | | | So a client API user can know when a window is created or destroyed. Also might be useful for the OSC: it could disable itself if video is disabled. Before this commit, there were only indirect ways of detecting this.
* command: fix debug outputwm42014-10-241-1/+1
| | | | It was a bit ugly/annoying.
* command: print executed commands with -vwm42014-10-231-0/+2
|
* command: add a "cached" mode to sub_addwm42014-10-231-1/+22
| | | | | This avoids reloading a subtitle if it was already added. In all cases, the subtitle is selected.
* command: return error on invalid/absent IDs with ff-sid/ff-aidwm42014-10-231-2/+6
| | | | | | Instead of just disabling the stream. Also, check if the selected track has the right type, or we'd crash.
* command: make reverse cycle_values match up with forward onewm42014-10-211-4/+3
| | | | | | | | | The behavior of reverse cycling (with the "!reverse" magic value) was a bit weird and acted with a "delay". This was because the command set the value the _next_ command should use. Change this and make each command invocation select and use the next command directly. This requires an "uninitialized" special index in the counter, but that is no problem at all.
* command: fix video-rotate update when pausedwm42014-10-211-11/+11
| | | | | | | | | | | Due to the way video-rotate currently works, the state will be automatically updated once new video is decoded. So the filter chain doesn't need to be reinitialized automatically, but there is a need to trigger the video instant refresh code path instead. Also move the support function closer to an annoying similar yet different function. They probably can be unified next time major changes are done to this code.
* command: add cursor-autohide propertywm42014-10-211-0/+14
| | | | | | | | | | | Allows properly changing/updating the cursor state. Useful for client API window embedding, because the host application may not want the mpv window to grab mouse input, and this has to manually handle the cursor. Changing the cursor of foreign windows is usually not sane. It might make sense to allow changing the cursor icon, but that would be much more complicated, so I won't add it unless someone actually requests it.
* command: add playback-abort propertywm42014-10-211-0/+8
| | | | Now this is obscure.
* command: add video-rotate propertywm42014-10-211-0/+12
|
* player: add stream selection by ffmpeg indexwm42014-10-211-0/+36
| | | | | | | | | Apparently using the stream index is the best way to refer to the same streams across multiple FFmpeg-using programs, even if the stream index itself is rarely meaningful in any way. For Matroska, there are some possible problems, depending how FFmpeg actually adds streams. Normally they seem to match though.
* command: add field-dominance propertyKevin Mitchell2014-10-211-0/+1
|
* command: extend sub_add commandwm42014-10-211-2/+10
|
* command: remove hook cancellation mechanismwm42014-10-201-11/+1
| | | | | I doubt anyone will actually use this correctly. Also, there was a bug (a typo) which prevented it from working at all.
* command: allow sub_add at an earlier stagewm42014-10-201-1/+1
|
* command: add "estimated-vf-fps" change notifcationwm42014-10-191-1/+2
|
* command: add a mechanism to allow scripts to intercept file loadswm42014-10-161-0/+138
| | | | | | | | | | | | | | | | | | | | | | | A vague idea to get something similar what libquvi did. Undocumented because it might change a lot, or even be removed. To give an idea what it does, a Lua script could do the following: -- type ID priority mp.commandv("hook_add", "on_load", 0, 0) mp.register_script_message("hook_run", function(param, param2) -- param is "0", the user-chosen ID from the hook_add command -- param2 is the magic value that has to be passed to finish -- the hook mp.resume_all() -- do something, maybe set options that are reset on end: mp.set_property("file-local-options/name", "value") -- or change the URL that's being opened: local url = mp.get_property("stream-open-filename") mp.set_property("stream-open-filename", url .. ".png") -- let the player (or the next script) continue mp.commandv("hook_ack", param2) end)
* command: allow setting per-file options at runtimewm42014-10-151-7/+24
| | | | | The intended use-case is for doing this at load time, after the load command was issued. (See following commit.)
* command: don't display non-sense if volume is unavailablewm42014-10-111-1/+1
| | | | | | | | | Showed "Volume: (unavailable)%". That was dumb. The message string is now a bit convoluted; mostly because the property expand syntax can't do "if-else", just "if". CC: @mpv-player/stable
* command: make volume/mute unavailable if audio is not initializedwm42014-10-111-6/+4
| | | | | | | | | | This does nothing good. This reverts a change made over a year ago - I don't remember why this was originally done this way. The main problem is that even if the volume option is set (something like "--volume=75"), the volume property will always return "100" until audio is initialized. If audio is uninitialized again, the volume property will remain frozen at its last value.
* command: make audio device list available to the client APIwm42014-10-101-0/+32
|
* player: minor simplificationwm42014-10-101-1/+1
|
* player: --save-position-on-quit should always work (2)wm42014-10-101-2/+5
| | | | | This reimplements the feature reverted in the previous commit in a different way.
* command: add cache-buffering-state propertywm42014-10-071-0/+11
|
* client API: clarify pause/unpause events, modify core-idle propertywm42014-10-071-1/+2
| | | | | | | | Whether you consider the semantics weird or not depends on your use case, but I suppose it's a bit confusing anyway. At this point, we keep MPV_EVENT_PAUSE/UNPAUSE for compatibility only. Make the "core-idle" property somewhat more useful in this context.
* player: remove central uninit_player() function and flags messwm42014-10-031-2/+2
| | | | | | | | | | | | | | Each subsystem (or similar thing) had an INITIALIZED_ flag assigned. The main use of this was that you could pass a bitmask of these flags to uninit_player(). Except in some situations where you wanted to uninitialize nearly everything, this wasn't really useful. Moreover, it was quite annoying that subsystems had most of the code in a specific file, but the uninit code in loadfile.c (because that's where uninit_player() was implemented). Simplify all this. Remove the flags; e.g. instead of testing for the INITIALIZED_AO flag, test whether mpctx->ao is set. Move uninit code to separate functions, e.g. uninit_audio_out().
* command: don't show message on "osd" command by defaultwm42014-10-031-3/+2
| | | | | | Apparently this was not very popular. CC: @mpv-player/stable
* command: allow passing memory addresses to overlay_addwm42014-10-031-0/+6
| | | | | | | | | For the sake of libmpv. Might make things much easier for the user, especially on Windows. On the other hand, it's a bit sketchy that a command exists that makes the player access arbitrary memory regions. (But do note that input commands are not meant to be "secure" and never were - for example, there's the "run" command, which obviously allows running random shell commands.)
* command: restructure overlay_add codewm42014-10-031-46/+63
| | | | | | | | | Somewhat more flexible: now there's a separate overlay struct, and you don't need to coerce all state into struct sub_bitmap. Also, removing the previous mapping (munmap call) is now all in one place, the replace_overlay function. Makes the next commit easier to implement.
* command: move setting playback speed to a separate functionwm42014-10-021-10/+5
|
* build: add -Wno-format-zero-lengthwm42014-09-261-1/+1
| | | | | | This warning makes absolutely no sense. Passing an empty string to printf-like functions is perfectly fine. In the OSD case, it just sets an empty message, practically clearing the OSD.
* command: no space before "%" in volume default OSD messagewm42014-09-221-1/+1
| | | | | | More consistent with other output, such as the terminal status line. Also see issue #1103.
* command: improve "osd" commandwm42014-09-221-9/+9
| | | | | | | Be less annoying, print the actual OSD level instead of something meaningless, but still clear the OSD if OSD level 0 (no OSD) is set. Remove the special handling for terminal OSD, that was just dumb.
* command: use show_property_osd() sub_stepwm42014-09-221-2/+1
| | | | Simpler and more consistent.
* command: when changing a property, always show it on OSDwm42014-09-211-1/+4
| | | | | | | | | | | | | This means that if a property not listed in property_osd_display[] is changed, it will be shown on the OSD as "name: ${name}". Properties that are listed in property_osd_display[] and have osd_name not set stay invisible by default. This is used for "pause" and "fullscreen", which (like before this commit) are not shown by default, because it would be annoying. The defaults still can be changed with command prefixes (osd-msg, no-osd, others).
* command: simplify OSD property display codewm42014-09-211-45/+38
| | | | | | | | | | | | | | | | Probably not many user-visible changes. One notable change is that the terminal OSD code for OSD bar fallback handling is removed with no replacement. Instead, terminal OSD gets the same text message as normal OSD. For volume, this is ok, because the text message is reasonable. Other properties will look worse, but could be adjusted, and there are in fact no other such properties that would be useful in audio-only mode. The fallback message for seeking falls away as well, but that message was useless anyway - the terminal status line provides all information anyway. I believe the show_property_osd() code is now much easier to follow.
* command: allow changing some OSD-related options even with no VOwm42014-09-211-2/+0
| | | | | | | If no VO was open, these options couldn't be changed or even queried. Although these properties are nearly useless if no VO exists, there's actually no good reason to forbid querying or setting them. Also, even if the VO is created, it doesn't mean the VO window was created.
* command: remove unneeded ifdefswm42014-09-211-4/+4
| | | | | | | | Why bother? Also, since now some properties could be mapped to non-existing options, but mp_property_generic_option() is used, deal with this case and return a not-found error code.
* command: always show OSD message when changing volume etc.wm42014-09-211-15/+3
| | | | | | | | | | | | | | If there's a command that uses the OSD by default, then always print the associated message (or a fallback made of name + value), even if the command has an associated OSD bar. This means volume, gamma, panscan, etc. all show both a message and a OSD bar. Also, add a '%' to the volume message. The extra_msg thing is not needed anymore. See issue #1103.
* options: remove --volstepwm42014-09-211-1/+1
| | | | | | | It's just confusing; users are encouraged to edit input.conf instead (changing the argument to the "add" command). Update input.conf to keep the old behavior.
* command: allow using ASS tags on OSD messageswm42014-09-181-0/+12
| | | | | | | | | | | We don't allow this by default, because it would be silly if random external data (like filenames or file tags) could accidentally trigger them. Add a property that magically disables this ASS tag escaping. Note that malicious input could still disable ASS tag escaping by itself. This would be annoying but harmless.
* command: add osd-sym-cc propertywm42014-09-181-0/+11
| | | | This allows you to reproduce the OSD symbol.
* command: avoid a double -> int castBen Boeckel2014-09-161-1/+1
| | | | | | | | Just check against zero directly. Changes behavior, but that should be ok. Signed-off-by: wm4 <wm4@nowhere>
* video: rename VOCTRL_GET_WINDOW_SIZEwm42014-09-051-2/+4
| | | | Make it clear that this accesses the un-fullscreened window size.
* player: add --media-title optionwm42014-09-021-0/+4
| | | | Requested by ChrisK2.
* command: remove broken quvi-format propertywm42014-09-011-74/+0
| | | | Never really worked, and libquvi is probably a lost cause anyway.
* demux: get rid of old wrapperwm42014-09-011-1/+1
| | | | | demux_info_get() used to be central, but was turned into a wrapper, and now there was only one caller left. Get rid of it.
* command: disable some commands/properties properly in idle modewm42014-09-011-2/+21
| | | | | In particular, don't allow to add any external subtitle tracks in idle mode. This make no sense and would just lead to leaks or worse.
* command: remove extra spaceRyan Jacobs2014-08-291-1/+1
| | | | Signed-off-by: wm4 <wm4@nowhere>
* command: export demuxer cache info propertieswm42014-08-281-1/+35
|
* audio: restore old speed change behaviorwm42014-08-281-0/+2
| | | | | | | | | | | | | | | | | | | | Don't attempt to resync after speed changes. Note that most other cases of audio reinit (like switching tracks etc.) still resync, but other code paths take care of setting the audio_status accordingly. This restores the old behavior of not trying to fix audio desync, which was probably changed with commit 261506e3. Note that the code as of now wasn't even entirely correct, since the A/V sync values are slightly shifted. The dsync depends on the audio buffer size, so a larger buffer size will show more extreme desync. Also see mplayer2 commit 213a224e, which should fixed this - it was not merged into mpv, because it disabled audio for too long, resulting in a worse user experience. This is similar to the issue this commit attempts to fix. Fixes: #1042 (probably) CC: @mpv-player-stable
* command: change OSD formatting of "speed" propertywm42014-08-251-1/+1
| | | | The "x " prefix annoyed some users.
* video: get rid of video_next_pts fieldwm42014-08-221-1/+1
| | | | | | Not really needed anymore. Code should be mostly equivalent. Also get rid of some other now-unused or outdated things.
* command: add estimated-frame-count & estimated-frame-number propertiesAndrey Morozov2014-08-191-0/+39
| | | | Signed-off-by: wm4 <wm4@nowhere>
* command: drop " %" from "cache" property OSD-formattingwm42014-08-181-1/+1
|
* video: add VO framedropping modewm42014-08-151-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | This mostly uses the same idea as with vo_vdpau.c, but much simplified. On X11, it tries to get the display framerate with XF86VM, and limits the frequency of new video frames against it. Note that this is an old extension, and is confirmed not to work correctly with multi-monitor setups. But we're using it because it was already around (it is also used by vo_vdpau). This attempts to predict the next vsync event by using the time of the last frame and the display FPS. Even if that goes completely wrong, the results are still relatively good. On other systems, or if the X11 code doesn't return a display FPS, a framerate of 1000 is assumed. This is infinite for all practical purposes, and means that only frames which are definitely too late are dropped. This probably has worse results, but is still useful. "--framedrop=yes" is basically replaced with "--framedrop=decoder". The old framedropping mode is kept around, and should perhaps be improved. Dropping on the decoder level is still useful if decoding itself is too slow.
* command: for OSD, format cache property as integerwm42014-08-111-0/+5
| | | | For convenience. Use ${=cache} to get the old formatting.
* command: fix dangling pointer issue in script key bindings codewm42014-08-111-1/+1
| | | | | | | | This code was sending a string to a different thread, and then deallocated the string shortly after, which means most of the time the other thread was accessing a dangling pointer. It's possible that this is the cause for #1002.
* command: run OSD display code even if a property is unavailablewm42014-08-091-4/+2
| | | | | | | | | | | | | | Trying to jump chapters in a gile that has no chapters does nothing, not even show a warning. This is confusing. The reason is that the "add chapter" command will just bail out completely if the property is unavailable. This was because it exited when it couldn't get the property type. Instead of exiting, just don't enter the code that needs the type. (I'm not sure when this behavior changed. I consider it a regression. It was probably caused by changes to the chapter code, which perhaps started returning UNAVAILABLE instead of OK if there are no chapters.)
* command: add a "seeking" propertywm42014-08-081-0/+10
| | | | | | The client API exports this state via events already, but maybe it's better to explicitly provide this property in order to facilitate use on OSD and similar cases.
* client API: minor optimizations for property notificatio