summaryrefslogtreecommitdiffstats
path: root/player
Commit message (Collapse)AuthorAgeFilesLines
* Revert "Remove DVD and Bluray support"wm42014-07-157-0/+495
| | | | | | This reverts commit 4b93210e0c244a65ef10a566abed2ad25ecaf9a1. *shrug*
* Remove DVD and Bluray supportwm42014-07-147-495/+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.
* Remove some mp_msg calls with no trailing \nwm42014-07-131-21/+21
| | | | | | | The final goal is all mp_msg calls produce complete lines. We want this because otherwise, race conditions could corrupt the terminal output, and it's inconvenient for the client API too. This commit works towards this goal. There's still code that has this not fixed yet, though.
* player: remove some inactive codewm42014-07-131-8/+1
| | | | | | | demux_seek() actually doesn't return seek success. Instead, it fails if the demuxer is flagged as unseekable (but this is checked explicitly at the beginning of this function), or if the seek target PTS is MP_NOPTS_VALUE (which can never happen).
* audio: drop buffered audio when switching tracks or filterswm42014-07-132-0/+2
| | | | | | | | 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
* osc: improve previous commitChrisK22014-07-101-6/+3
|
* osc: round displayed cache valueChrisK22014-07-101-3/+3
| | | | Fixes #919
* build: include <strings.h> for strcasecmp()wm42014-07-103-0/+3
| | | | | | | It happens to work without strings.h on glibc or with _GNU_SOURCE, but the POSIX standard requires including <strings.h>. Hopefully fixes OSX build.
* demux: remove accurate_seek fieldwm42014-07-081-5/+3
| | | | It's unused now. (Only the dvd code used it until recently.)
* osc: fix failure when using DVD menuswm42014-07-071-1/+1
| | | | [osc] Lua error: mp.assdraw:31: attempt to concatenate local 's' (a nil value)
* lua: redo error handling, print backtraceswm42014-07-071-82/+90
| | | | | | | | | | | | | | | | | | | | The original goal was just adding backtraces, however making the code safe (especially wrt. to out of memory Lua errors) was hard. So this commit also restructures error handling to make it conceptually simpler. Now all Lua code is run inside a Lua error handling, except the calls for creating and destroying the Lua context, and calling the wrapper C function in a safe way. The new error handling is actually conceptually simpler and more correct, because you can just call any Lua function at initialization, without having to worry whwther it throws errors or not. Unfortunately, Lua 5.2 removes lua_cpcall(), so we have to emulate it. There isn't any way to emulate it in a way that works the same on 5.1 and 5.2 with the same semantics in error cases, so ifdeffery is needed. The debug.traceback() function also behaves weirdly differently between the Lua versions, so its output is not as nice as it could be (empty extra line).
* Remove stream_pts stuffwm42014-07-062-19/+0
| | | | | This was used by DVD/BD, but its usage was removed with one of the previous commits.
* demux: minor simplificationwm42014-07-061-1/+1
| | | | Oops, should have been part of commit 37085788.
* player: don't use stream position as fallback for percent-poswm42014-07-051-3/+2
| | | | | | | | This should be unneeded, and the packet position is already sufficient for this case. Accessing the stream position directly is going to be a problem when the stream is accessed from another thread later.
* 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.
* dvd, bluray, cdda: add demux_disc containing all related hackswm42014-07-053-114/+0
| | | | | | | | | | | | DVD and Bluray (and to some extent cdda) require awful hacks all over the codebase to make them work. The main reason is that they act like container, but are entirely implemented on the stream layer. The raw mpeg data resulting from these streams must be "extended" with the container-like metadata transported via STREAM_CTRLs. The result were hacks all over demux.c and some higher-level parts. Add a "disc" pseudo-demuxer, and move all these hacks and special-cases to it.
* discnav: fix a commentwm42014-07-051-1/+1
|
* demux: make start time a simple fieldwm42014-07-052-3/+3
| | | | Simpler, especially for later changes.
* demux: make replaygain per-trackwm42014-07-051-1/+1
| | | | | | It's unlikely that files with multiple audio tracks and with replaygain actually happen, but this change might help avoid minor corner cases with later changes.
* client API: allow calling mpv_terminate_destroy(NULL)wm42014-07-041-0/+3
| | | | | | This is an oversight and a bug. CC: @mpv-player/stable
* 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-024-9/+104
|
* Audit and replace all ctype.h useswm42014-07-014-5/+2
| | | | | | | | | | | | | | | | Something like "char *s = ...; isdigit(s[0]);" triggers undefined behavior, because char can be signed, and thus s[0] can be a negative value. The is*() functions require unsigned char _or_ EOF. EOF is a special value outside of unsigned char range, thus the argument to the is*() functions can't be a char. This undefined behavior can actually trigger crashes if the implementation of these functions e.g. uses lookup tables, which are then indexed with out-of-range values. Replace all <ctype.h> uses with our own custom mp_is*() functions added with misc/ctype.h. As a bonus, these functions are locale-independent. (Although currently, we _require_ C locale for other reasons.)
* player: fix start position when specifying with percentTsukasa OMOTO2014-06-291-1/+1
|
* options: support setting start time relative to start PTSTsukasa OMOTO2014-06-291-3/+8
| | | | Signed-off-by: wm4 <wm4@nowhere>
* player: make the time display relative to start PTSTsukasa OMOTO2014-06-296-10/+27
| | | | | | This commit makes the playback start time always at time 0. Signed-off-by: wm4 <wm4@nowhere>
* sub: fix undefined behavior with dvd://wm42014-06-281-1/+1
| | | | | | The string could get reallocated. CC: @mpv-player/stable
* scripting: shorten a linewm42014-06-261-2/+3
| | | | | | Also allows it to deal with NULL return values, which currently is not needed, but may or may not be required at some point in the future (what if malloc fails).
* config, player: avoid some temporary talloc contextswm42014-06-261-15/+10
| | | | | IMO a semi-bad concept, that the mpv code unfortunately uses way too much.
* player: create config dir if it doesn't existwm42014-06-261-0/+2
| | | | | | | This was dropped in the commit adding XDG support, probably accidentally. Also normalize some whitespace.
* player: remove some minor code duplication in config loader codewm42014-06-263-21/+16
| | | | | | | It's better to keep the logic in one place. Also drop that a broken config file aborts loading of the player. I don't see much reason for this, and it inflates the code slightly.
* Basic xdg directory implementationKenneth Zhou2014-06-263-19/+24
| | | | | | | | | | Search $XDG_CONFIG_HOME and $XDG_CONFIG_DIRS for config files. This also negates the need to have separate user and global variants of mp_find_config_file() Closes #864, #109. 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>
* options: allow adding multiple files with --audio-filewm42014-06-181-2/+4
| | | | At least 1 person expected that this works this way.
* video: correct spelling: mp_image_params_equals -> mp_image_params_equalwm42014-06-171-2/+2
| | | | | The type is struct mp_image_params, so the "params" should have a "s". "equals" shouldn't, because it's plural for 2 params. Important.
* vo: make draw_image and vo_queue_image transfer image ownershipwm42014-06-171-1/+0
| | | | Basically a cosmetic change. This is probably more intuitive.
* encode: disable playback framedroppingwm42014-06-171-0/+1
| | | | | --framedrop is intended for playback only, and does nothing good with encoding. It would just randomly drop frames.
* discnav: make OSD path explicitly thread-safewm42014-06-161-16/+31
| | | | | | | | The main issue was actually that the OSD callback locked the subtitle decoder, which does not necessarily work, because the OSD code is already allowed to lock it. The state was already protected by unsetting the callback (which involes the OSD lock). So, in summary, this is probably just a cleanup.
* video/out: change aspects of OSD handlingwm42014-06-154-33/+12
| | | | | | | | | Let the VOs draw the OSD on their own, instead of making OSD drawing a separate VO driver call. Further, let it be the VOs responsibility to request subtitles with the correct PTS. We also basically allow the VO to request OSD/subtitles at any time. OSX changes untested.
* command: redo the property typewm42014-06-133-508/+601
| | | | | | | | | | | | | | | | | | | | | | | 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.
* win32: implement --priority differentlywm42014-06-121-2/+2
| | | | | | | Does anyone actually use this? For now, update it, because it's the only case left where an option points to a global variable (and not a struct offset).
* encode: don't load Lua scriptswm42014-06-121-0/+2
| | | | This is most likely never intended.
* encode: make option struct localwm42014-06-112-4/+6
| | | | Similar to previous commits.
* Add more constwm42014-06-117-15/+15
| | | | | | | 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.
* stream_dvd, stream_dvdnav, stream_bluray: remove global option variableswm42014-06-111-6/+4
|
* stream_dvb: remove global option variableswm42014-06-111-4/+0
|
* command: redo ancient TV/DVB/PVR commandswm42014-06-113-165/+111
| | | | | | | | | | | | | | | | | | 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: hide some messages in verbose modewm42014-06-091-3/+3
| | | | This started getting annoying.
* client API: disable LIRC input by defaultwm42014-06-091-0/+1
| | | | | | Not only should using libmpv hog such global resources; it's also very unlikely an application embedding mpv will ever want to make use of this.
* audio: add a "weak" gapless mode, and make it defaultwm42014-06-093-1/+14
| | | | | | | | | | | | | | Basically, this allows gapless playback with similar files (including the ordered chapter case), while still being robust in general. The implementation is quite simplistic on purpose, in order to avoid all the weird corner cases that can occur when creating the filter chain. The consequence is that it might do not-gapless playback in more cases when needed, but if that bothers you, you still can use the normal gapless mode. Just using "--gapless-audio" or "--gapless-audio=yes" selects the old mode.
* player: show "neutral" position markers for OSD barswm42014-06-083-6/+21
| | | | This commit implements them for volume and some video properties.
* client API: minor documentation fixes/enhancementswm42014-06-081-2/+2
|
* client API: trigger wakeup when creating wakeup pipe/callbackwm42014-06-081-1/+5
| | | | | | | | | Since redundant wakeups are avoided now, it's easy to miss a wakeup when creating/setting the pipe/callback after the client API was signalled. If the client API is signalled, need_wakeup is set to true, and wakeup_client skips writing to the pipe or calling the client API. That this can happen is not very obvious to the client API, so trigger a wakeup right on start in order to remove this special case.
* client API: restructure waiting, do log msg wakeup properlywm42014-06-071-42/+55
| | | | | | | | | | | | | | | | | | | | | | | | | | Until now, availability of new log messages (through the mechanism associated with mpv_request_log_messages()) did not wakeup the client API properly. Commit 3b7402b5 was basically a hack to improve that somewhat, but it wasn't a solution. The main problem is that the client API itself is producing messages, so the message callback would attempt to lock the client API lock, resulting in a deadlock. Even if the lock was recursive, we'd run into lock-order issues. Solve this by using a separate lock for waiting and wakeup. Also, since it's a natural addition, avoid redundant wakeups. This means the wakeup callback as well as the wakeup pipe will be triggered only once until the next mpv_wait_event() call happens. This might make the wakeup callback be invoked in a reentrant way for the first time, for example if a mpv_* function prints to a log. Adjust the docs accordingly. (Note that non-reentrant beheavior was never guaranteed - basically the wakeup callback is somewhat dangerous and inconvenient.) Also remove some traces of unneeded code. ctx->shutdown for one was never set, and probably a leftover of an abandoned idea.
* client API: rename mpv_destroy() to mpv_detach_destroy()wm42014-06-072-5/+4
| | | | | | A bit verbose, but less misleading. In most cases, the API user probably actually wants mpv_terminate_destroy() instead, so the less-useful function shouldn't have a simnpler name anyway.
* client API: add API function that ensures total destructionwm42014-06-073-2/+37
| | | | | | | | | | | | mpv_destroy() should perhaps better be called mpv_detach(), because it destroys only the handle, not necessarily the player. The player is only terminated if a quit command is sent. This function quits automatically, and additionally waits until the player is completely destroyed. It removes the possibility that the player core is still uninitializing, while all client handles are already destroyed. (Although in practice, the difference is usually not important.)
* client API: change mpv_wait_event() timeout semanticswm42014-06-072-2/+5
| | | | | | | | | Now a negative timeout mean an infinite timeout. This is similar to the poll() system call. Apparently this is more intuitive and less confusing than specifying a "very high" value as timeout if you want to wait forever. For callers that never pass negative timeouts, nothing changes.
* client API: enlarge the message buffer if log level is highwm42014-06-061-1/+2
|
* client API: call wakeup callback if there are new messageswm42014-06-061-13/+17
| | | | | | | | | | | | | | | | | | Listening on messages currently uses polling (every time mpv_wait_event() has no new events, the message buffer is polled and a message event is possibly created). Improve this situation a bit, and call the user-supplied wakeup callback. This will increase the frequency with which the wakeup callback is called, but the client is already supposed to be able to deal with this situation. Also, as before, calling mpv_wait_event() from the wakeup callback is forbidden, so the client can't read new messages from the callback directly. The wakeup pipe is written either. Since the wakeup pipe is created lazily, we can't access the pipe handle without creating a race condition or a deadlock. (This is actually very silly, since in practice the race condition won't matter, but for now let's keep it clean.)
* client API: fix terminal usagewm42014-06-061-1/+4
| | | | | | By default this is disabled. But if it's enabled, then we have to account for proper states when enabling/disabling the terminal state itself.
* client API: don't update properties in uninitialized statewm42014-06-061-0/+2
| | | | | | If an API user calls mpv_wait_event() and mpv_observe_property() before mpv_initialize(), it could happen that a property was accessed before initialization, which is not ok.
* client API: don't use the mpv config files by defaultwm42014-06-061-0/+1
| | | | | | | | | This was always intended this way, and even documented in client.h. Due to an oversight it was never actually implemented. The intention is that mpv embedded in applications and "real mpv" don't conflict. An API user can undo this by setting the "config" option to "yes", if using the user's mpv config is desired.
* client API: use shared code for creating the wakeup pipewm42014-06-061-12/+2
| | | | Should be equivalent, reduces code duplication.
* client API: fix swapped pipe ends used with mpv_set_wakeup_callbackwm42014-06-061-2/+2
|