summaryrefslogtreecommitdiffstats
path: root/player
Commit message (Collapse)AuthorAgeFilesLines
* player: replace old lavfi wrapper with new filter codewm42018-01-307-908/+103
| | | | | lavfi.c is not necessary anymore, because f_lavfi.c (which was actually converted from it) can be used now.
* audio: rewrite filtering glue codewm42018-01-303-416/+199
| | | | Use the new filtering code for audio too.
* video: rewrite filtering glue codewm42018-01-306-239/+126
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Get rid of the old vf.c code. Replace it with a generic filtering framework, which can potentially handle more than just --vf. At least reimplementing --af with this code is planned. This changes some --vf semantics (including runtime behavior and the "vf" command). The most important ones are listed in interface-changes. vf_convert.c is renamed to f_swscale.c. It is now an internal filter that can not be inserted by the user manually. f_lavfi.c is a refactor of player/lavfi.c. The latter will be removed once --lavfi-complex is reimplemented on top of f_lavfi.c. (which is conceptually easy, but a big mess due to the data flow changes). The existing filters are all changed heavily. The data flow of the new filter framework is different. Especially EOF handling changes - EOF is now a "frame" rather than a state, and must be passed through exactly once. Another major thing is that all filters must support dynamic format changes. The filter reconfig() function goes away. (This sounds complex, but since all filters need to handle EOF draining anyway, they can use the same code, and it removes the mess with reconfig() having to predict the output format, which completely breaks with libavfilter anyway.) In addition, there is no automatic format negotiation or conversion. libavfilter's primitive and insufficient API simply doesn't allow us to do this in a reasonable way. Instead, filters can use f_autoconvert as sub-filter, and tell it which formats they support. This filter will in turn add actual conversion filters, such as f_swscale, to perform necessary format changes. vf_vapoursynth.c uses the same basic principle of operation as before, but with worryingly different details in data flow. Still appears to work. The hardware deint filters (vf_vavpp.c, vf_d3d11vpp.c, vf_vdpaupp.c) are heavily changed. Fortunately, they all used refqueue.c, which is for sharing the data flow logic (especially for managing future/past surfaces and such). It turns out it can be used to factor out most of the data flow. Some of these filters accepted software input. Instead of having ad-hoc upload code in each filter, surface upload is now delegated to f_autoconvert, which can use f_hwupload to perform this. Exporting VO capabilities is still a big mess (mp_stream_info stuff). The D3D11 code drops the redundant image formats, and all code uses the hw_subfmt (sw_format in FFmpeg) instead. Although that too seems to be a big mess for now. f_async_queue is unused.
* ytdl_hook: pre-append id-only playlist items with shortened youtube URLRicardo Constantino2018-01-291-1/+1
|
* ytdl_hook: whitelist segmented DASH and HLS for the manifests codeRicardo Constantino2018-01-271-7/+9
| | | | Close #5453
* command: add --osd-on-seek option defaulting to barKevin Mitchell2018-01-261-6/+9
| | | | | | | | | | | | | Restores behaviour prior to aef2ed5dc13e37dec0670c451b4369b151d5c65f. That change was apparently unpopular. However, given the amount of complaining over how hard it is to change the defaults by rebinding every key, I think the extra option introduced by this commit is justified. Technically not all behaviour is restored, because now --no-osd-bar will not instead display the msg text on seek. I think that feature was a little weird and is now easy enough to remedy with the --osd-on-seek option.
* Revert "command: make pause display the same osd-msg-bar as seek"Kevin Mitchell2018-01-261-3/+1
| | | | | | | | | | | | | | This reverts commit 9812e276aa1bb0bddeb73677aa9e9f87e73cd930. This was apparently unpopular. I still think the pause OSD should be the same as seek even if it's not visible by default, but it seems that whether to display a given property change is currently conflated with what to display. The reverted behaviour can be restored by adding something like the following to input.conf: SPACE cycle pause; show_progress
* ytdl_hook: prefer hls/dash manifest if availableRicardo Constantino2018-01-261-6/+10
| | | | | | | This makes all the video/audio variants available for selection. Might break with non-hls/dash, or even with dash if FFmpeg wasn't compiled with the demuxer.
* ytdl_hook: fix safe url checking with EDL urlsRicardo Constantino2018-01-261-11/+11
|
* ytdl_hook: move url_is_safe earlier in codeRicardo Constantino2018-01-261-9/+9
| | | | lua isn't javascript.
* command: make change-list show changed option on OSDwm42018-01-251-0/+1
|
* command: add a change-list commandwm42018-01-251-0/+31
| | | | | | | | | | | | | Requested. See manpage additions. The main reason why this goes through the trouble to keep the action/operation parameter separate is so that we don't expose some option parser implementation details to the command (although that is a relatively weak reason), and also to make it more different from the "set" command, which can't support this type of option as it goes through the property layer. Fixes #5435.
* options: add an option type for byte sizeswm42018-01-251-18/+0
| | | | | | And use it for 2 demuxer options. It could be used for more options later. (Though the --cache options can not use this, because they use KB as base unit.)
* command: make sure to redraw on overlay commandswm42018-01-251-0/+1
| | | | | | | | | | When overlay-add etc. is run, make sure the playlop is rerun so that it considers actually redrawing the screen. (I considered making the OSD code generally wakeup the player, but that will probably lead to redundant wakeups, so I didn't bother.) Fixes #5431.
* ytdl_hook: whitelist protocols from urls retrieved from youtube-dlRicardo Constantino2018-01-261-7/+47
| | | | | | Not very clean since there's a lot of potential unsafe urls that youtube-dl can give us, depending on whether it's a single url, split tracks, playlists, segmented dash, etc.
* player: redo hack for video keyframe seeks with external audiowm42018-01-184-31/+49
| | | | | | | | | | | | | | | | | | | | | | | | If you play a video with an external audio track, and do backwards keyframe seeks, then audio can be missing. This is because a backwards seek can end up way before the seek target (this is just how this seek mode works). The audio file will be seeked at the correct seek target (since audio usually has a much higher seek granularity), which results in silence being played until the video reaches the originally intended seek target. There was a hack in audio.c to deal with this. Replace it with a different hack. The new hack probably works about as well as the old hack, except it doesn't add weird crap to the audio resync path (which is some of the worst code here, so this is some nice preparation for rewriting it). As a more practical advantage, it doesn't discard the audio demuxer packet cache. The old code did, which probably ruined seeking in youtube DASH streams. A non-hacky solution would be handling external files in the demuxer layer. Then chaining the seeks would be pretty easy. But we're pretty far from that, because it would either require intrusive changes to the demuxer layer, or wouldn't be flexible enough to load/unload external files at runtime. Maybe later.
* ytdl_hook: support native dash demuxer, if presentRicardo Constantino2018-01-151-1/+44
| | | | | | Uses track tbr instead of track disposition id for dash selection Works just as expected because youtube-dl also takes tbr from the manifests.
* osc: leave only demuxer cache duration and limit its refresh rateRicardo Constantino2018-01-141-19/+16
| | | | Sorta requested in #5390
* osd: treat user provided term-status-msg the same as the defaultKevin Mitchell2018-01-141-20/+24
| | | | | | | | | | | This is achieved by adding the new function get_term_status_msg that returns the status message specified by the user, or the mpv default. Previously, term_osd_print_status_lazy would exit early as soon as a user status message had been set, which potentially skipped adding the term_osd_bar if the user also requested that. fixes #3280
* osd: reference local pointer to mpctx->optsKevin Mitchell2018-01-131-2/+2
| | | | For brevity, since it's already there. Result should be identical.
* af_lavrresample: deprecate this filterwm42018-01-131-3/+7
| | | | | | The future direction might be not having such a user-visible filter at all, similar to how vf_scale went away (or actually, redirects to libavfilter's vf_scale).
* player: silence config file loading message on resumingwm42018-01-131-6/+7
| | | | | | This is just an implementation detail; seems to be ugly to log it by default. Other cases of the try_load_config() function should be logged, though.
* ytdl_hook: look for the right ytdl binary according to systemRicardo Constantino2018-01-121-1/+2
| | | | | | | | package.config is available in 5.1, 5.2, 5.3 and luajit, so should be fine. The first character is the path separator, so it's '\' on windows and '/' on *nix. This should also prevent cases where users download the wrong binary.
* ytdl_hook: be more informative when youtube-dl failsRicardo Constantino2018-01-121-2/+8
|
* input: make command argument list a dynamic arraywm42018-01-101-3/+8
| | | | | | | | Replace the static array with dynamic memory allocation. This also requires some code to honor mp_cmd.nargs more strictly. Generally allocates more stuff. Fixes #5375 (although we could also just raise the static limit).
* ytdl_hook: don't try to use webpage_url if non-existentRicardo Constantino2018-01-111-1/+1
|
* command: make pause display the same osd-msg-bar as seekKevin Mitchell2018-01-071-1/+3
| | | | | | Previously, toggling pause would generate no osd response, and changing that wasn't even configurable. This was surprising to users who generally expect to see *where* pause / unpause is taking place (#3028).
* command: default to osd-msg-bar for seeksKevin Mitchell2018-01-071-4/+3
| | | | | | | | The previous default was osd-bar (unless the user specified --no-osd-bar, in which case case it was osd-msg). Aside from requiring some twisted logic to implement, this surprised users since osd-msg3 wasn't displayed when seeking with the keyboard (#3028), so the time seeked to was never displayed.
* command: remove unnecessary whitespaceKevin Mitchell2018-01-071-67/+69
|
* ytdl_hook: actually use the script option from 87d3af6Ricardo Constantino2018-01-071-1/+1
|
* ytdl_hook: add script option to revert to trying youtube-dl firstRicardo Constantino2018-01-071-2/+3
| | | | | Should only make a difference if most of the URLs you open need youtube-dl parsing.
* player: handle audio playback restart in central playback start codewm42018-01-072-4/+10
| | | | | | | No idea why this wasn't done earlier. This makes playback start in audio only tracks closer to video-only or video/audio restart. It has the consequence that --cache-pause-initial now works for audio-only streams too.
* player: slightly refactor/simplify cache pausing logicwm42018-01-072-39/+37
| | | | | | | | | | | | | | | | The underlying logic is still the same (basically pausing if the demuxer cache underruns), but clean up the higher level logic a bit. It goes from 3 levels of nested if statements to 1. Also remove the code duplication for the --cache-pause-initial logic. In addition, make sure an earlier buffering state has no influence on the new state after a seek (this is also why some of the state resetting can be removed from loadfile.c). Initialize cache_buffer always to 100. It basically means we start out assuming all buffers are filled enough. This actually matters for verbose messages only, but removes some weird special casing.
* player: strictly never autoselect tracks from --external-fileswm42018-01-062-0/+5
| | | | | | | | | | | | | | | | Before this commit, some autoselection of tracks coming from files loaded with --external-files was still done. This commit removes all of it, and the only way to select a track is via the explicit stream selection options like --vid/--sid/--aid. I think this was always the original intention. The change could in theory still unintentionally surprise some users, so add a changelog entry. This does not affect --audio-file/--sub-file, even if these contain mismatching track types. E.g. if audio files passed to --audio-file contain subtitles, these should still be selected. Past feature requests indicate that users want this.
* ytdl_hook: check for possible infinite loop in playlist generationRicardo Constantino2018-01-061-7/+8
|
* ytdl_hook: add additional check for comedycentral urlsRicardo Constantino2018-01-061-1/+2
| | | | | | | If this breaks another site again, remove this whole if and just leave them as separate playlist items. Close #5364
* demux: export some debugging fields about low level demuxer behaviorwm42018-01-051-0/+5
| | | | | | | | | | Export them as explicitly undocumented debugging fields for the "demuxer-cache-state" property. Should be somewhat helpful to debug "wtf is the demuxer" doing situations better, especially when seeking. It also becomes visible how long the demuxer is blocked on an "old" seek when you keep seeking while the first seek hasn't finished.
* ytdl_hook: update obsolete warning about retrying URL if failedRicardo Constantino2018-01-041-1/+1
|
* player: cosmetics: rename internal variable for consistencywm42018-01-031-2/+2
| | | | This was so annoying.
* player: add --cache-pause-initial option to start in buffering statewm42018-01-031-0/+11
| | | | | | Reasons why you'd want this see manpage additions. Disabled by default, because it would increase latency of live streams by default. (Or well, at least it would be another problem when trying getting lower latency.)
* player: use fixed timeout for cache pausing (buffering) durationwm42018-01-032-11/+3
| | | | | | | | | | | | | | | This tried to be clever by waiting for a longer time each time the buffer was underrunning, or shorter if it was getting better. I think this was pretty weird behavior and makes no sense. If the user really wants the stream to buffer longer, he/she/it can just pause the player (the network caches will continue to be filled until they're full). Every time I actually noticed this code triggering in my own use, I didn't find it helpful. Apart from that it was pretty hard to test. Some waiting is needed to avoid that the player just plays the available data as fast as possible (to compensate for late frames and underrunning audio). Just use a fixed wait time, which can now be controlled by the new --cache-pause-wait option.
* osc: add seekbarkeyframes as a user optiondudemanguy2018-01-031-2/+3
|
* player: remove internal `vo-resize` command againsfan52018-01-021-7/+0
| | | | Its only usecase was automated in the previous commit.
* vo_gpu/context_android: replace both options with android-surface-sizesfan52018-01-021-0/+5
| | | | This allows us to automatically trigger a VOCTRL_RESIZE (also contained).
* options: move most subtitle and OSD rendering options to sub structswm42018-01-022-8/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | Remove them from the big MPOpts struct and move them to their sub structs. In the places where their fields are used, create a private copy of the structs, instead of accessing the semi-deprecated global option struct instance (mpv_global.opts) directly. This actually makes accessing these options finally thread-safe. They weren't even if they should have for years. (Including some potential for undefined behavior when e.g. the OSD font was changed at runtime.) This is mostly transparent. All options get moved around, but most users of the options just need to access a different struct (changing sd.opts to a different type changes a lot of uses, for example). One thing which has to be considered and could cause potential regressions is that the new option copies must be explicitly updated. sub_update_opts() takes care of this for example. Another thing is that writing to the option structs manually won't work, because the changes won't be propagated to other copies. Apparently the only affected case is the implementation of the sub-step command, which tries to change sub_delay. Handle this one explicitly (osd_changed() doesn't need to be called anymore, because changing the option triggers UPDATE_OSD, and updates the OSD as a consequence). The way the option value is propagated is rather hacky, but for now this will do.
* sub: move all subtitle timestamp messing code to a central placewm42018-01-022-9/+4
| | | | | | | | | | | | | | | | | It was split at least across osd.c and sd_ass.c/sd_lavc.c. sd_lavc.c actually ignored most of the more obscure subtitle timing things. There's no reason for this - just move it all to dec_sub.c (mostly from sd_ass.c, because it has some of the most complex stuff). Now timestamps are transformed as they enter or leave dec_sub.c. There appear to have been some subtle mismatches about how subtitle timestamps were transformed, e.g. sd_functions.accepts_packet didn't apply the subtitle speed to the timestamp. This patch should fix them, although it's not clear if they caused actual misbehavior. The semantics of SD_CTRL_SUB_STEP are slightly changed, which is the reason for the changes in command.c and sd_lavc.c.
* command: add demuxer-lavf-list propertyRicardo Constantino2018-01-021-0/+15
| | | | | | | | | Was only available with --demuxer-lavf-format=help and the demuxer needed to be used for it to actually print the list. This can be used in the future to check if 'dash' support was compiled with FFmpeg so ytdl_hook can use it instead. For now, dashdec is too rudimentary to be used right away.
* player: add on_load_fail hookRicardo Constantino2018-01-022-5/+12
|
* osc: check if demuxer cache has not reached eofRicardo Constantino2018-01-021-3/+3
| | | | Avoids flickering stream cache status while filling the demuxer cache.
* ytdl_hook: fix single-entry playlistsRicardo Constantino2018-01-021-9/+8
| | | | Close #5313
* build: move copyright statement to a shared locationwm42018-01-011-3/+2
| | | | | | | Now macosx_menubar.m and mpv.rc (win32) use the same copyright string. (This is a bit roundabout, because mpv.rc can't use C constants. Also the C code wants to avoid rebuilding real source files if only version.h changed, so only version.c includes version.h.)
* Update copyright yearwm42018-01-011-1/+1
|
* main: fix typowm42018-01-011-1/+1
| | | | What the heck. This negated the entire check.
* player/playloop.c: Revert --loop-file and --start interactionLeo Izen2017-12-311-13/+5
| | | | | | | | | | | | | | | | | | | This reverts commit 9513165c99c2ab3a945620b260823440f8ad125d and commit 4efe330efba296f6f07089d60087ef4e054bfe04. I had changed --loop-file to interact with --start to work the same way that --loop-playlist does. (That is, --loop-file seeks to the --start time upon looping, not the beginning of the file.) However, the consensus is that the old behavior is preferred and the interaction with --loop-playlist is the one that is incorrect. In addition, this change introduced a bug in the interaction between Quit-Watch-Later and --loop-file, where upon reaching playback end it would seek to the resume timestamp, not the start of the file. As a result, this commit reverts that change.
* player: add internal `vo-resize` commandsfan52017-12-271-0/+7
| | | | Intended to be used with the properties from previous commit.
* osc: hide cache if not forced for local filesRicardo Constantino2017-12-261-13/+7
| | | | | Also hide cache if 'cache-used' is 0 (usually means video fits entirely within demuxer-cache-duration or stream cache is disabled).
* stats: enhance cache statsJulian2017-12-261-19/+35
| | | | | | Show total cache as well as demuxer cache separately. This adjusts the presented values to be consistent with status line and OSC modifications made in https://github.com/mpv-player/mpv/pull/5250
* lua: implement mp_utils.format_bytes_humanizedJulian2017-12-261-0/+10
|
* osc: make seek ranges rendering optionalpavelxdd2017-12-261-0/+4
| | | | | This commit adds a new osc setting `seekranges` to control the seek ranges visibility.
* options: drop some previously deprecated optionswm42017-12-254-60/+1
| | | | | | | | A release has been made, so drop options deprecated for that release. Also drop some options which have been deprecated a much longer time before. Also fix a typo in client-api-changes.rst.
* ytdl_hook: use table concat for playlist buildingRicardo Constantino2017-12-241-5/+4
| | | | Faster and more efficient than string concat with large playlists.
* ytdl_hook: don't preappend ytdl:// to non-youtube links in playlistsRicardo Constantino2017-12-241-1/+5
| | | | Close #50