summaryrefslogtreecommitdiffstats
path: root/player
Commit message (Collapse)AuthorAgeFilesLines
* command: list filters/VOs/AOs with option-infowm42014-11-141-0/+11
| | | | Another special-case, but pretty simple after all.
* command: export some option metadatawm42014-11-131-1/+33
| | | | | | | This might be interesting for GUIs and such. It's probably still a little bit insufficient. For example, the filter and audio/video output lists are not available through this.
* command: rename "option-flags" property to "option-info"wm42014-11-131-3/+3
|
* command: make sub-properties more flexiblewm42014-11-131-1/+1
| | | | | This makes it work with all kind of types, instead of just some simple ones.
* command: export mpv configure arguments as propertywm42014-11-131-0/+7
| | | | | It seems strange that a client API user can't get this string, other than analyzing the mpv log output.
* player: simplify audio uninit on segment switcheswm42014-11-121-5/+4
| | | | | | | The purpose of temporarily setting stop_play was to make the audio uninit code to explicitly drain audio if needed. This was the only way to do it before ao_drain() was made a separate function; now we can just do it explicitly instead.
* audio: fix some issues when reloading the AOwm42014-11-121-0/+3
| | | | | | | We absolutely need to clear the AO reference in the mixer. The audio_status must be changed to a state where no code assumes that the AO is available. (It's allowed to do this blindly.)
* player: make the osd-msg prefix work for playlist_next/prevwm42014-11-114-1/+10
| | | | | If input.conf e.g. contains "n osd-msg playlist_next", then pressing the n key will switch to the next file, and display the filename on OSD.
* audio: make decoders output refcounted frameswm42014-11-102-8/+8
| | | | | | | | | | | | | | This rewrites the audio decode loop to some degree. Audio filters don't do refcounted frames yet, so af.c contains a hacky "emulation". Remove some of the weird heuristic-heavy code in dec_audio.c. Instead of estimating how much audio we need to filter, we always filter full frames. Maybe this should be adjusted later: in case filtering increases the volume of the audio data, we should try not to buffer too much filter output by reducing the input that is fed at once. For ad_spdif.c and ad_mpg123.c, we don't avoid extra copying yet - it doesn't seem worth the trouble.
* audio: change how filters are inserted on playback speed changeswm42014-11-101-42/+48
| | | | | | | | | | Use a pseudo-filter when changing speed with resampling, instead of somehow changing a samplerate somewhere. This uses the same underlying mechanism, but is a bit more structured and cleaner. It also makes some of the following changes easier. Since we now always use filters to change audio speed, move most of the work set_playback_speed() does to recreate_audio_filters().
* player: don't try to use duration 0wm42014-11-101-1/+1
|
* dvd, bluray: reload demuxer on title changeswm42014-11-101-0/+1
| | | | | | | | | Causes the player to reload the demuxer and to relist the found streams. Probably slightly dangerous/broken, because the demuxer thread and possibly even the decoders will keep reading data from the new title before the new demuxer takes over. Fixes #1250.
* command: send property-change event on playlist changeAlessandro Ghedini2014-11-092-0/+6
|
* video/out: minor simplification to event query functionwm42014-11-091-1/+1
| | | | The "clear" parameter is confusing and useless.
* audio/out: make ao_request_reload() idempotentwm42014-11-092-6/+6
| | | | | | | | | | This is what you would expect. Before this commit, each ao_request_reload() call would just queue a reload command, and then recreate the AO for the number of times the function was called. Instead of sending a command, introduce some sort of event retrieval mechanism. At least for the reload case, use atomics, because we're too lazy to setup an extra mutex.
* audio: handle reinit after AO reload slightly cleanerwm42014-11-091-8/+8
| | | | Don't print bogus messages about packets read in verbose mode.
* player: improve audio time displaywm42014-11-081-1/+10
| | | | | | | | | | | | | | | | | | This commit fixes a "cosmetic" user interface issue. Instead of displaying the interpolated seek time on OSD, show the actual audio time. This is rather silly: when seeking in audio-only mode, it takes some iterations until audio is "ready", but on the other hand, the audio state machine is rather fickle, and fixing this cosmetic issue would be intrusive. So just add a hack that paints over the ugly behavior as perceived by the user. Probably the lesser evil. It doesn't happen if video is enabled, because that mode sets the current time immediately to video PTS. (Audio has to be synced to video, so the code is a bit more complex.) Fixes #1233.
* command: silence a warning on win32wm42014-11-081-0/+2
| | | | | Same goal as a change in the #1255 PR, but IMO slightly less ifdefferish.
* command: fix option-flags propertywm42014-11-081-1/+3
| | | | The sub-path wasn't adjusted, and it worked only in some situations.
* command: export the flag whether an option was set on commandlinewm42014-11-071-0/+26
| | | | Can be useful for certain scripts; I think someone requested this.
* client: remove redundant assignmentwm42014-11-071-1/+0
| | | | This is set by send_reply().
* client API: silence silly clang warningwm42014-11-071-2/+2
| | | | | | | The values compared here happen to be of unsigned enum types - but the test is not supposed to break if we somehow force the enum to signed, or if the compiler happens to use a signed type (as far as I remember, the exact integer type the compiler can use is implementation-defined).
* command: add display-names propertyKevin Mitchell2014-11-071-0/+25
| | | | | | | Call VOCTRL_GET_DISPLAY_NAMES it when the property is requested. The vo should return the names of the displays that the mpv window is covering. For example, with x11 vos, xrandr names LVDS1, HDMI1, etc.
* command: use playback time as reference for sub_seekwm42014-11-051-2/+3
| | | | | | | | | update_subtitle() already uees playback_pts to make subtitles work better in no-audio mode. Using get_current_time() usually gets playback_pts, but also has the advantage that it will use the seek target time during seeks. This will result in multiple sub_seek commands doing the right thing (at least as long as they're far enough apart so that seeking is actually initiated when the second command is run).
* player: fix --secondary-sidwm42014-11-041-1/+1
| | | | | | | Use the "default" selection for the ff-index, not the "no" selection. Broken by commit f0f83ff. Fixes #1243.
* command: add window-minimized property (X11 only)wm42014-11-023-0/+21
| | | | | | More or less requested by #1237. Should be simple to extend this to other backends.
* command: make window-scale property observablewm42014-11-024-4/+19
| | | | | | | | | | | | Add a generic mechanism to the VO to relay "extra" events from VO to player. Use it to notify the core of window resizes, which in turn will be used to mark all affected properties ("window-scale" in this case) as changed. (I refrained from hacking this as internal command into input_ctx, or to poll the state change, etc. - but in the end, maybe it would be best to actually pass the client API context directly to the places where events can happen.)
* command: expose mpv version as propertywm42014-11-021-0/+8
| | | | A client API user has no other way to know the version.
* player: print anamorphic size only if video is anamorphicwm42014-11-021-2/+5
| | | | Has been annoying me since forever.
* player: always use demux_chapterwm42014-11-027-36/+24
| | | | | | | | | Instead of defining a separate data structure in the core. For some odd reason, demux_chapter exported the chapter time in nano-seconds. Change that to the usual timestamps (rename the field to make any code relying on this to fail compilation), and also remove the unused chapter end time.
* player: add --chapters-file optionwm42014-11-021-5/+25
| | | | | | | | Note that you can't pass .cue or .edl files to it, at least not yet. Requested in context of allowing to specify custom chapters. For that to work well, we probably need to add some sort of chapter metadata pseudo-demuxer.
* osd: properly wakeup when the OSD function disappearswm42014-11-011-3/+10
| | | | Fixes #1236.
* player: update meaning of drop_frame_cntwm42014-11-014-9/+8
| | | | | Rename the variable, update comments, and update the documentation of the property which returns its value.
* player: show AV-desync message in all framedrop modeswm42014-11-011-2/+1
| | | | | | | | | | | | This was shown only if decoder-framedropping was enabled, and only if at least 50 frames were dropped by it. Since drop_frame_cnt used to mean "number of late frames", this code made sense, but this is not the case anymore: drop_frame_cnt can be even 0, all while video gets hopelessly behind audio. One problem with this is that short desync spikes (which usually can probably dealt with) will also cause this message to be shown. If it gets triggered too often, the code will need to be adjusted.
* sub: remove osd_get_sub()wm42014-11-013-5/+7
| | | | | Trades one strange thing against another, but seems slightly less strange.
* sub: be more flexible about changes to how subtitles are renderedwm42014-10-311-20/+32
| | | | | | | | | For example, if --force-window is used, and video is switched off during playback, then you need to redecide the rendering method to get subs displayed correctly. Do this by moving the state setup code into a function, and call it on every frame.
* player: change framedrop display in the status linewm42014-10-311-4/+5
| | | | | Hopefully less confusing, and hopefully doesn't exceed the terminal width in any situation.
* player: improve exit message in some scenarioswm42014-10-313-63/+58
| | | | | | | | | | | | | | 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: don't display zero duration for files with unknown durationwm42014-10-294-17/+22
| | | | | | On OSD/terminal, just don't display the duration if unavailable. Make the "length" property unavailable if duration is unavailable.
* player: add an option to abort playback on partial init failureswm42014-10-283-3/+5
| | | | | | This is probably what libmpv users want; and it also improves error reporting (or we'd have to add a way to communicate such mid-playback failures as events).
* player: handle DVB demuxer reloading correctlywm42014-10-281-2/+2
| | | | | | | | This was probably done incorrectly in cases when the currently selected channel had no data. I'm not sure if this codepath is functional at all, though. Maybe not. Untested due to lack of DVB hardware.
* client API: better error reportingwm42014-10-286-24/+52
| | | | Give somewhat more information on playback failure.
* client API: add an enum for mpv_event_end_file.reasonwm42014-10-281-4/+3
| | | | | | | | | Using magic integer values was an attempt to keep the API less verbose. But it was probably not a good idea. Reason 1 (restart) is not made explicit, because it is not used anymore starting with the previous commit. For ABI compatibility, the value is left as a hole in the enum.
* player: handle edition reloading slightly differentlywm42014-10-283-11/+11
| | | | | | | 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.
* player: don't spam video-reconfig eventwm42014-10-271-1/+1
| | | | | | | | Without --force-window, this is called on every iteration or so, and calling uninit_video_out() sends the video-reconfig event. Avoid sending redundant events. Fixes #1225 (using an alternative patch).
* 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.
* lua: subprocess: fix dumbwm42014-10-261-1/+1
|
* lua: subprocess: tunnel stderr through mp_logwm42014-10-261-20/+63
| | | | | | | | | | | Pretty much a fringe-feature, but also it's awkward if something appears on the terminal with no indication for the source. This is made quite awkward by the fact that stderr and stdout could be closed at different times, and that poll() doesn't accept "holes" in its FD list. Invalid (.e.g negative) FDs just make it return immediately, as required by the standard. So sparse_poll() takes care of the messy details.
* lua: parse_json(): fix inverted condition for trail argumentwm42014-10-261-1/+1
| | | | It accidentally had the opposite meaning.
* lua: subprocess: don't distinguish pipe errors/EOFwm42014-10-261-7/+4
| | | | | | | What was the purpose of that? Probably none. Also simplify another thing: if we get the cancel signal through FD, there's no reason to check it separately.
* Drop libquvi supportwm42014-10-253-88/+2
| | | | | | | | | | | 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.
* lua: fix some more lua_tostring() mistakeswm42014-10-251-1/+3
| | | | Why can't it just raise an error?
* lua: lua_tostring() on an error value can return NULLwm42014-10-241-2/+4
| | | | | Lua is so clever it allows values that can't be converted to strings, in which case lua_tostring() returns NULL. Trigger undefined behavior.
* command: finish hook execution if client failswm42014-10-243-6/+33
| | | | | 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.
* player: disable --force-window if VO failswm42014-10-241-1/+5
| | | | Otherwise, it'd retry creating the window all the time.
* video: send MPV_EVENT_VIDEO_RECONFIG on uninitwm42014-10-241-0/+1
| | | | | This event basically means "something about video changed", and uninit is certainly an important change.
* 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.
* command: fix debug outputwm42014-10-241-1/+1
| | | | It was a bit ugly/annoying.
* osc: make text squuezing layout dependentChrisK22014-10-241-31/+48
| | | | | | | | | | | Wether and when the text of a button should be squeezed when it gets too long can now be configured in the layout: lo.button.maxchars = <number> nil = no squeezing (default) If the button text has more than <maxchars> characters, it will be squeezed to the estimated width of <maxchars>.
* osc: make tooltip_an default propertyChrisK22014-10-241-2/+3
|
* player: fix exiting if both audio and video fail initializingwm42014-10-234-8/+22
| | | | | | | | | | | | | The player was supposed to exit playback if both video and audio failed to initialize (or if one of the streams was not selected when the other stream failed). This didn't work; for one this check was missing from one of the failure paths. And more importantly, both checked the current_track array incorrectly. Fix these issues, and move the failure handling code into a common function. CC: @mpv-player/stable
* lua: fix non-sensewm42014-10-231-1/+1
| | | | Let's actually test our code next time.
* client API: print properties set with -vwm42014-10-231-0/+7
| | | | | Useful for debugging. Considered doing this in command.c, but it's easier here.
* 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.
* osc.lua: add “bottombar” and “topbar” layoutsMartin Herkt2014-10-231-5/+281
|
*