summaryrefslogtreecommitdiffstats
path: root/player
Commit message (Collapse)AuthorAgeFilesLines
* command: add mistimed-frame-count propertywm42015-10-303-3/+18
| | | | | Does what the manpage says. This is a replacement incrementing the dropped frame counter (see previous commit).
* video: fix framedrop accounting in display-sync modewm42015-10-301-2/+0
| | | | | | | | | | | | | | Commit a1315c76 broke this slightly. Frame drops got counted multiple times, and also vo.c was actually trying to "render" the dropped frame over and over again (normally not a problem, since frames are always queued "tightly" in display-sync mode, but could have caused 100% CPU usage in some rare corner cases). Do not repeat already dropped frames, but still treat new frames with num_vsyncs==0 as dropped frames. Also, strictly count dropped frames in the VO. This means we don't count "soft" dropped frames anymore (frames that are shown, but for fewer vsyncs than intended). This will be adjusted in the next commit.
* player: raise display sync desync tolerancewm42015-10-281-5/+2
| | | | | | | Bump it to 80, and 2 vsyncs. This is another measure against vsync jitter. Admittedly this is a bit simplistic (and we should probably estimate a stable estimated vsync phase instead), but for now this will do.
* player: reset AO stats on pause and other discontinuitieswm42015-10-281-1/+3
| | | | It's annoying.
* player: simplify display-adrop mode safeguardwm42015-10-281-8/+1
| | | | | | It's not needed, because the additional data is not appended, but is the total size of the audio buffer. The maximum size is the static audio drop size (or twice, if the audio is duplicated).
* player: minor refactor for A/V diff computationwm42015-10-281-19/+27
| | | | | | | | Calculate the A/V difference directly in the display sync code, instead of the awkward current way, which reuses the fields for audio sync. We still set time_frame, because it makes falling back to audio sync somewhat smoother.
* player: fix display sync A/V difference estimation on dropswm42015-10-281-0/+2
| | | | | | | When dropping or repeating frames, we essentially influence when the frame after the next frame will be shown, not the next frame. This led to dropping/repeating frames 2 times, because the A/V difference had a delay of one frame. Compensate it with the expected value.
* player: disable total-avsync-change update in display-sync modewm42015-10-271-0/+4
| | | | | The total-avsync-change property made no sense in display-sync mode (in addition to making not all that much sense in general).
* player: fix display-sync A/V calculation on high playback speedswm42015-10-271-0/+1
| | | | | | This is all kinds of stupid - update_avsync_after_frame() will multiply this value with the speed at a later point, and we only update this field for this function. (This should be refactored.)
* player: add audio drop/duplicate modewm42015-10-273-1/+39
| | | | Not very robust in the moment.
* player: simplify audio sync pts calculationwm42015-10-271-1/+1
| | | | | This was done for symmetry with adjust_sync(). But mpctx->delay is always 0 at this point, so prefer slightly simpler code.
* client API: change error string if playback fails completelywm42015-10-261-1/+1
| | | | | It can print this if AO/VO initialization fails, which makes the wording a lie. Change it to something more diplomatically safe.
* ytdl: disable --all-subs if "sub-lang" is in raw-optionsRicardo Constantino2015-10-241-1/+9
| | | | | | Defaults stay the same (--all-subs is used if sub-lang wasn't used.) Don't forget to also add "write-sub=" if using sub-lang or else it won't work.
* command: make bitrate properties work correctly for external trackswm42015-10-231-2/+7
|
* command: do not return 0 for bitrates if unknownwm42015-10-231-0/+2
| | | | | | | | This makes the bitrate properties unavailable, instead of returning 0 when: 1. No track is selected, or 2. Not enough packets have been read to have a bitrate estimate yet
* player: offset chapter display by start timewm42015-10-231-1/+2
| | | | | | Some mkv files can have this. The chapter times are still timestamps (and thus not affected by the start time), but it misplaces the OSD chapter ticks.
* player: be slightly less prone to framedrop in display sync modewm42015-10-191-3/+7
| | | | | 1 to 2 frames desync is still tolerable, and will be quickly compensated (if everything works).
* player: do not use copysign()wm42015-10-191-1/+1
| | | | | | | Apparently this function caused weird problems to me. I have no idea why. The usage of the function looks perfectly fine to me, and even rounding issues can be excluded. In any case, getting rid of this solved my problem, and makes the code actually more readable.
* command: make time properties unavailable if timestamp is unknownwm42015-10-164-15/+30
| | | | | | Let's hope this doesn't confuse client API users too much. It's still the best solution to get rid of corner cases where it actually return the wrong timestamp on start, and then suddenly jump.
* player: fix an adjustment in display sync modewm42015-10-141-1/+1
| | | | | | This adjustment is supposed to improve the audio speed calculation in case of unexpected desync. The flipped sign made it actually worse, although the total impact of this bug was very minor.
* player: fix inverted conditionwm42015-10-131-1/+1
| | | | | | | Simple oversight which made it not work at all. How did this ever work, and if it was never tested, then why did it work when fixing this oversight?
* ytdl: Set a proper label for external audio tracksChrisK22015-10-111-3/+3
|
* ytdl: Remove DASH hacks, use DASH by defaultChrisK22015-10-111-10/+12
| | | | | | | | | | | Thanks to rcombs, ffmpeg now properly supports DASH and we can remove our hacks for it and use it by default whenever available. If you don't like this for whatever reason, you can get the "normal" streams back with --ytdl-format=best . Closes #579 Closes #1321 Closes #2359
* player: fix missed wakeup on video EOFwm42015-10-091-0/+3
| | | | | | | If video EOF happens during playback restart, and audio is syncing, and the demuxer packet queue overflows (i.e. no new packets will be read), then it could happen that the player accidentally enters sleeping, and continues playing anything only after e.g. user input wakes it up.
* audio: add AO deviation loggingwm42015-10-082-0/+27
| | | | | Pretty dumb (and doesn't handle pausing or other discontinuities), but at least somewhat idiot-proof.
* audio: make spdif re-probe from normal decoding workwm42015-10-061-1/+10
| | | | | | | | The previous commit handled not falling back to normal decoding if the AO was reloaded (I think...), and this tries to re-engage spdif pass- through if it was previously falling back to normal decoding (e.g. because it temporarily switched to an audio device incapable of passthrough).
* audio: re-probe spdif if AO is reloadedwm42015-10-061-1/+3
| | | | Makes the spdif automagic work better on audio hotplugging.
* player: make stop command actually stopwm42015-10-062-2/+2
| | | | | | | | | | | | | The stop command didn't always stop. In this case, opening a HLS URL and then sending "stop" during loading would actually make it fallback to parsing it as a playlist, and then continued to play the playlist items. (This corner case makes several unfortunate factors come together to produce this really odd behavior.) Another issue is that the "stop" was not always explicitly set. This could be a problem when sending several commands at once. Only the "quit" command should have priority over the "stop" command, so this is still checked.
* video: remove user-controllable PTS sorting (--pts-association-mode)wm42015-10-061-2/+0
| | | | | | | | | Useless. Sometimes it might be useful to make some extremely broken files work, but on the other hand --no-correct-pts is sufficient for these cases. While we still need some of the code for AVI, the "auto" mode in particular inflated the size of the code.
* ytdl: Remove version check and minor cleanupChrisK22015-10-061-55/+22
| | | | Closes #2370
* audio: add option for falling back to ao_nullwm42015-10-051-4/+6
| | | | | | | | | The manpage entry explains this. (Maybe this option could be always enabled and removed. I don't quite remember what valid use-cases there are for just disabling audio entirely, other than that this is also needed for audio decoder init failure.)
* player: add wav to list of external audio file extensionswm42015-10-041-1/+2
| | | | Fixes #2378.
* video/out: remove an unused parameterwm42015-10-032-2/+2
| | | | | | | | | | | This parameter has been unused for years (the last flag was removed in commit d658b115). Get rid of it. This affects the general VO API, as well as the vo_opengl backend API, so it touches a lot of files. The VOFLAGs are still used to control OpenGL context creation, so move them to the OpenGL backend code.
* player: print tags under different log prefixwm42015-10-011-2/+4
| | | | A minor, but apparently common feature request. Fixes #2360.
* ytdl: Don't override user-set format in no-video modeChrisK22015-09-301-11/+23
|
* video: replace vf_format outputlevels option with global optionwm42015-09-292-5/+6
| | | | | | | | | | | The vf_format suboption is replaced with --video-output-levels (a global option and property). In particular, the parameter is removed from mp_image_params. The mechanism is moved to the "video equalizer", which also handles common video output customization like brightness and contrast controls. The new code is slightly cleaner, and the top-level option is slightly more user-friendly than as vf_format sub-option.
* player: fix another --force-window bugwm42015-09-231-1/+1
| | | | | | Will this shit ever actually work? Fixes #2339.
* player: fix excessive CPU usage in audio-only modewm42015-09-221-3/+4
| | | | | | | | | Caused by one of the --force-window commits. The unconditional uninit_video_out() call (which normally should be idempotent) raised sporadic MPV_EVENT_VIDEO_RECONFIG events. This is ok, except for the fact that clients (like a Lua script or libmpv users) would cause the event loop to run again after receiving it, triggering a feedback loop. Fix it by sending the events really only on a change.
* player: some more --force-window fixeswm42015-09-212-12/+17
| | | | | | | | | | | | | Sigh... After the recent changes, another regression appeared. This time, the VO window wasn't cleared when changing from video to a non- video file (such as audio-only with no cover art). Fix this by properly taking the handle_force_window() bool parameter into account. Also, the info message could be printed twice, which is harmless but ugly. So just remove the message. Also, do some more minor cleanups (like fixing the comment, which was completely outdated).
* player: do not destroy VO prematurely when initializing playbackwm42015-09-201-1/+2
| | | | | | | | | | If --force-window wasn't used, this would destroy the VO while a file is still being loaded, resulting in flicker and other interruptions when switching from one playlist entry to another. Recent regression. The condition used here is pretty tricky, but it boils down to that it should trigger either in idle mode, or when loading has been fully done (at these points we definitely know whether the VO will be needed).
* player: rename and move find_subfiles.cwm42015-09-203-1/+320
| | | | | | This was in sub/, because the code used to be specific to subtitles. It was extended to automatically load external audio files too, and moving the file and renaming it was long overdue.
* player: make force-window in auto-profiles actually workwm42015-09-204-29/+36
| | | | | | | | | | | The previous commit was incomplete (and I didn't notice due to a broken test procedure). The annoying part is that actually creating the VO was separate; redo this and merge the code for this into handle_force_window() as well. This will also make implementing proper reaction to runtime option changes easier. (Only the part for actually listening to option changes is missing.)
* player: make force-window=immediate work in auto-profileswm42015-09-201-0/+3
| | | | | | This is a bad hack; the correct way to handle this would be implementing profiles differently, and then listen to option changes and act on them dynamically.
* af_lavfi: implement af-metadata propertywm42015-09-111-10/+21
| | | | | | | Works like vf-metadata. Unfortunately requires some code duplication (even though it's not much). Fixes #2311.
* command: make "add <property> 0" not change the valuewm42015-09-101-4/+2
| | | | | | | | | | | | | | | The value 0 was treated specially, and effectively forced the increment to 1. Interestingly, passing 0 or no value also does not include the scale (from touchpads etc.), but this is probably an accidental behavior that was never intentionally added. Simplify it and make the default increment 1. 0 now means what it should: the value will not be changed. This is not particularly useful, but on the other hand there is no need for surprising and unintuitive semantics. OARG_CYCLEDIR() failed to apply the default value, because m_option_type_cycle_dir was missing a copy handler - add this too.
* osd: delay libass initialization as far as possiblewm42015-09-071-0/+2
| | | | | | | | | | | | Until now, most OSD objects created the associated ASS_Renderer instance as soon as possible, even if nothing was going to be rendered. Maybe this was even intentional. Change this for the sake of lowering resource usage, and strictly initialize ASS_Renderer only when it's really needed. For the OSC, initialization has to be forced, because of the insane mechanism for translating mouse coordinates to OSD coordinates.
* options: fix --no-configwm42015-09-051-2/+0
| | | | | | | | | | | | | | | | | | This was completely broken. It was checked manually in some config loading paths, so it appeared to work. But the intention was always to completely disable reading from the normal config dir. This logic was broken in commit 2263f37d. The manual checks are actually redundant, and are not needed if --no-config is implemented properly - remove them. Additionally, the change to load the libmpv defaults from an embedded profile also failed to set "config=no". The option is marked as not being settable by a config file, and the libmpv default profile is parsed as a config file, so this option was rejected. Fix it by removing the CONF_NOCFG flag. (Alternatively, m_config_set_profile() could be changed not to set the "config file" flag by default, but I'm not bothering with this.)
* player: log error code on playback exitwm42015-09-031-0/+2
| | | | So far, this required using the client API to know it.
* screenshot: avoid confusing template error message with no fileKevin Mitchell2015-09-021-9/+11
| | | | | | | Previously, with mpv --force-window=yes --idle=yes --screenshot-template="%f", mpv would display an error saying that the template was incorrect, which it isn't, there's just no file to put in the format. In this case, just use the string "NO_FILE".
* osc: reinit on playlist changesKevin Mitchell2015-08-291-0/+1
| | | | | | This takes care of the corner case where the player is started with a single playlist entry so that the next/prev arrows are greyed out, but remain that way even after new elements are added to the playlist.
* player: slightly better error reporting when opening file failswm42015-08-281-2/+7
| | | | Return MPV_ERROR_LOADING_FAILED instead of MPV_ERROR_NOTHING_TO_PLAY.
* client API: improve an error messagewm42015-08-281-1/+1
| | | | | This refers to media played by mpv, and these don't necessarily have to be files. They can be network resources or entirely abstract URLs too.
* osc: exit tick immediately if disabled.torque2015-08-281-0/+2
| | | | | | | | | | | Even after it has been disabled with the `disable-osc` message, the OSC continues to run the tick function. Completely preventing tick from being called is impractical since there are several different places that it's called in the code, so just make it immediately return if the OSC has been disabled. This prevents the OSC from continuing the clear the OSD on every tick, allowing other scripts to disable it so that they may draw to the OSD.
* ytdl: catch bogous extractor infoChrisK22015-08-271-12/+12
| | | | | | | Some extractors may claim to have extracted subtitles, but then set the relevant fields to null. Try to catch those cases. Fixes #2254
* video: disable interpolation during framesteppingwm42015-08-251-0/+1
| | | | | | | It just causes annoying artifacts. Interestingly, this means keeping down the frame stepping key (".") will play video with interpolation disabled.
* audio: don't sleep when finishing audio resyncwm42015-08-231-1/+1
| | | | | | | This should avoid unnecessary sleeping when audio playback start resync has finished and goes into the normal playback state. This is tricky; see e.g. commit 402fe381.
* player: add --playlist-pos optionwm42015-08-221-1/+8
| | | | Oddly often requested.
* command: make the playback-time property writablewm42015-08-211-0/+5
| | | | | | | Provides a simplistic way to seek without having to care about weird situations like timestamp vs. playback time. This is good, because the seek command is currently timestamp based, so when using the seek command the user _does_ have to care.
* player: return better guess for playback time during seekswm42015-08-211-13/+27
| | | | | | | | Always compute the estimated absolute time of the seek target, and display this as playback time during seeks. Improves behavior with e.g. .ts files, for which we try to avoid seeks by timestamp.
* player: deliver IDLE event after uninitializing statewm42015-08-201-1/+1
| | | | | | | | | A client API user might count on the fact that audio and video outputs have already been uninitialized. (They remain uninitialized before entering idle mode in order to allow smooth transition to the next playlist entry.) Since event delivery is asynchronous, this has to happen after actually doing the uninitialization, or the client will essentially run into a race condition.
* video: don't decode 2 frames ahead with display-syncwm42015-08-191-2/+1
| | | | | This is not needed. It was used only temporarily in a development branch, and is a leftover from earlier rebasing.
* stream: provide a stream_get_size() convenience functionwm42015-08-181-2/+1
| | | | | And use it everywhere, instead of retrieving the size manually. Slight simplification.
* player: actually close files on playback endwm42015-08-151-1/+1
| | | | Regression since commit 75b1d504.
* player: use OSD formattin for DS on the terminal status linewm42015-08-121-1/+5
|
* demux: remove redundant demux_chapter.name fieldwm42015-08-122-7/+2
| | | | | | | | | | Instead, force everyone to use the metadata struct and set a "title" field. This is only a problem for the timeline producers, which set up chapters manually. (They do this because a timeline is a separate struct.) This fixes the behavior of the chapter-metadata property, which never returned a "title" property for e.g. ordered chapters.
* osc: avoid annoying verbose mode log spamwm42015-08-101-6/+22
| | | | | | | | enable_key_bindings()/disable_key_bindings() now prints a log message on each call, thus we should avoid makign redundant calls. This could probably be solved more elegantly, but since this is all legacy/private API, don't bother.
* player: add display sync mode