summaryrefslogtreecommitdiffstats
path: root/player/command.c
Commit message (Collapse)AuthorAgeFilesLines
* 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 notificationwm42014-08-021-5/+42
| | | | | | | | | | | | | | | | | | | | | Internally, there are two mechanisms which can trigger property notification as used with "observed" properties in the client API. The first mechanism associates events with a group of properties that are potentially changed by a certain event. mp_event_property_change[] declares these associations, and maps each event to a set of strings. When an event happens, the set of strings is matched against the list of observed properties of each client. Make this more efficient by comparing bitsets of events instead. This way, only a bit-wise "and" is needed for each observed property. Even better, we can completely skip clients which have no observed properties that match. The second mechanism just updates individual properties explicitly by name. Optimize this by using the property index instead. It would be nice if we could reuse the first mechanism for the second one, but there are too many properties to fit into a 64 bit mask. (Though the limit on 64 events might get us into trouble later...)
* command: add a property that returns a list of all propertieswm42014-08-021-5/+25
| | | | Also remove the undocumented Lua mp.property_list() function.
* client API: don't send internal events to the clientswm42014-07-311-1/+2
| | | | | | | "Internal" events were added in the previous commits to leverage the client API property mechanism, without making weird properties public. But they were sent to clients too (and returned by mpv_wait_event()).
* command: add cache-idle propertywm42014-07-311-1/+14
|
* client API: make "cache" property and similar observablewm42014-07-311-0/+1
| | | | | | Achieve this by polling. Will be used by the OSC. Basically a bad hack - but the point is that the mpv core itself is in the best position to improve this later.
* player: fix time display wheen seeking past EOF with --keep-openwm42014-07-301-1/+3
| | | | | | | | | | | | | | Regression since commit 261506e3. Internally speaking, playback was often not properly terminated, and the main part of handle_keep_open() was just executed once, instead of any time the user tries to seek. This means playback_pts was not set, and the "current time" was determined by the seek target PTS. So fix this aspect of video EOF handling, and also remove the now unnecessary eof_reached field. The pause check before calling pause_player() is a lazy workaround for a strange event feedback loop that happens on EOF with --keep-open.
* command: fix and simplify overlay_addwm42014-07-251-50/+44
| | | | | | | | | | | | | | | | Actually free the old mmap region when readding an overlay of the same ID without removing it before. (This is explicitly documented as working.) Replace the OSD atomically. Before this commit, the overlays were removed and then readded to avoid synchronization problems. Simplify the code: now there is no weird mapping between index and ID. The OSD sub-bitmap list still needs to be prepared to skip unused IDs (since each sub-bitmap list entry must be in use), but the code for this is relatively separated now. Fixes issue #956.
* command: append entries to the end of the playlist with loadlist appendAlessandro Ghedini2014-07-251-1/+1
| | | | | | Currently entries are added after the current playlist element. This is kinda confusing, more so given that "loadfile append" appends at the end of the playlist.
* command: add append-play loadfile modewm42014-07-231-2/+2
| | | | | | | | "loadfile filename append-play" will now always append the file to the playlist, and if nothing is playing yet, start playback. I don't want to change the semantics of "append" mode, so a new mode is needed. Probably fixes issue #950.
* command: potentially fix dvd angle settingwm42014-07-201-5/+4
| | | | | | | | This called demux_flush(), but that doesn't make any sense with an asynchronously running demuxer. It would just keep reading and add new packets again. Explicitly pause the demuxer, so that this can't happen. Also, when flushing, data will be missing, so the decoders should always be reinitialized, even if the operation fails.
* demux: add a demuxer threadwm42014-07-161-50/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds a thread to the demuxer which reads packets asynchronously. It will do so until a configurable minimum packet queue size is reached. (See options.rst additions.) For now, the thread is disabled by default. There are some corner cases that have to be fixed, such as fixing cache behavior with webradios. Note that most interaction with the demuxer is still blocking, so if e.g. network dies, the player will still freeze. But this change will make it possible to remove most causes for freezing. Most of the new code in demux.c actually consists of weird caches to compensate for thread-safety issues (with the previously single-threaded design), or to avoid blocking by having to wait on the demuxer thread. Most of the changes in the player are due to the fact that we must not access the source stream directly. the demuxer thread already accesses it, and the stream stuff is not thread-safe. For timeline stuff (like ordered chapters), we enable the thread for the current segment only. We also clear its packet queue on seek, so that the remaining (unconsumed) readahead buffer doesn't waste memory. Keep in mind that insane subtitles (such as ASS typesetting muxed into mkv files) will practically disable the readahead, because the total queue size is considered when checking whether the minimum queue size was reached.
* Revert "Remove DVD and Bluray support"wm42014-07-151-0/+133
| | | | | | This reverts commit 4b93210e0c244a65ef10a566abed2ad25ecaf9a1. *shrug*
* Remove DVD and Bluray supportwm42014-07-141-133/+0
| | | | It never worked well. Just remux your DVD and BD images to mkv.
* command: don't show VO information in colorspace propertieswm42014-07-131-3/+1
| | | | | | | | | | Until now, changing the properties showed the VO colorspace parameters on OSD. This didn't work quite well, because it showed the VO parameters _before_ the change. This is because at least one video frame with the new parameters has to be shown, and this doesn't happen right after changing the property, but a bit later. Also fix a random typo in unrelated code.
* audio: drop buffered audio when switching tracks or filterswm42014-07-131-0/+1
| | | | | | | | No reason to wait until the audio has been played. This isn't a problem with gapless audio disabled, and since gapless is now default, this behavior might be perceived as regression. CC: @mpv-player/stable
* Remove stream_pts stuffwm42014-07-061-17/+0
| | | | | This was used by DVD/BD, but its usage was removed with one of the previous commits.
* dvd: move angle switching codewm42014-07-051-14/+28
| | | | | No need to provide a "nice" API for it; just do this stuff directly in the command code.
* command: include new "playback-time" property in update mechanismwm42014-07-031-1/+1
|
* command: remove some code duplication in cache propertieswm42014-07-021-75/+33
| | | | | | | This also means that the printed size is always rounded to KBs, because the cache properties are returned in KB. I think this doesn't matter much. But if it does, the cache properties should probably changed to return bytes in the first place.
* command: cache can actually have full-size 0wm42014-07-021-4/+4
| | | | Then it's simply empty.
* command: change cache perentage to float, add cache-free and cache-usedAndrey Morozov2014-07-021-2/+97
|
* player: make the time display relative to start PTSTsukasa OMOTO2014-06-291-3/+13
| | | | | | This commit makes the playback start time always at time 0. Signed-off-by: wm4 <wm4@nowhere>
* command: fix tv-channel propertywm42014-06-251-0/+3
| | | | | Now it's at least actually relayed to the TV code. I didn't/couldn't test whether it actually works, though.
* options: Expose --colormatrix-primaries to the userNiklas Haas2014-06-221-0/+29
| | | | Signed-off-by: wm4 <wm4@nowhere>
* command: redo the property typewm42014-06-131-506/+599
| | | | | | | | | | | | | | | | | | | | | | | Instead of absuing m_option to store the property list, introduce a separate type for properties. m_option is still used to handle data types. The property declaration itself now never contains the option type, and instead it's always queried with M_PROPERTY_GET_TYPE. (This was already done with some properties, now all properties use it.) This also fixes that the function signatures did not match the function type with which these functions were called. They were called as: int (*)(const m_option_t*, int, void*, void*) but the actual function signatures were: int (*)(m_option_t*, int, void*, MPContext *) Two arguments were mismatched. This adds one line per property implementation. With additional the reordering of the parameters, this makes most of the changes in this commit.
* Add more constwm42014-06-111-5/+5
| | | | | | | While I'm not very fond of "const", it's important for declarations (it decides whether a symbol is emitted in a read-only or read/write section). Fix all these cases, so we have writeable global data only when we really need.
* command: redo ancient TV/DVB/PVR commandswm42014-06-111-153/+107
| | | | | | | | | | | | | | | | | | Convert all these commands to properties. (Except tv_last_channel, not sure what to do with this.) Also, internally, don't access stream details directly, but dispatch commands with stream ctrls. Many of the new properties are a bit strange, because they're write- only. Also remove some OSD output these commands produced, because I couldn't be bothered to port these. In general, this makes everything much cleaner, and will also make it easier to e.g. move the demuxer to its own thread. Don't bother updating input.conf, but changes.rst documents how old commands map to the new ones. Mostly untested, due to lack of hardware.
* player: show "neutral" position markers for OSD barswm42014-06-081-2/+12
| | | | This commit implements them for volume and some video properties.
* command: format_bitrate: fix conversion to kbits and mbitsMarcoen Hirschberg2014-06-021-2/+2
| | | | | | | Bitrates are now expressed in bits/second. This commit fixes conversions which assumed it was still in bytes/second. Signed-off-by: wm4 <wm4@nowhere>
* command: improve video-bitrate propertyAndrey Morozov2014-06-011-1/+4
| | | | | | Signed-off-by: wm4 <wm4@nowhere> Includes some cosmetic changes over the original PR.
* client API: report success status when running commandswm42014-06-011-26/+42
| | | | | | Until now, an error was reported only if the command couldn't be parsed. Attempt to do more fine-grained reporting. This is not necessarily perfect, but it's an improvement.
* command: property notification when changing af/vfwm42014-06-011-0/+1
|
* command: add const to mp_notify_propertywm42014-06-011-1/+1
|