aboutsummaryrefslogtreecommitdiffhomepage
path: root/player
Commit message (Collapse)AuthorAge
* player: use input instead of output format for spdif checkGravatar wm42015-11-04
| | | | | | This check disables the display-sync resample method. If the filters convert PCM to AC3, we can still insert a filter to change speed. This is because filters are inserted at the beginning of the filter chain.
* audio: do not require full audio chain reinit for speed changesGravatar wm42015-11-04
| | | | | | | | | | | | | | | Actually, it didn't really require that before (most work was avoided), but some bits had to be run anyway. Separate the speed change into a light-weight function, which merely updates already created filters, and a heavy-weight one which messes with filter insertion. This also happens to fix the case where the filters would "forget" the current speed (force resampling, change speed, hit a volume control to force af_volume insertion - it will reset speed and desync). Since we now always run the light-weight function, remove the af_scaletempo verbose message that is printed on speed setting. Other than that, all setters are cheap.
* player: move audio speed adjustment codeGravatar wm42015-11-04
| | | | | | | | | Move it (in a cosmetic sense), and also move its invocation to below all the video handling. All other changes remain cosmetic, including moving the framedrop calculation code, and getting rid of the video_speed_correction variable.
* audio: strictly align audio on spdif framesGravatar wm42015-11-04
| | | | | | We still have a sample-based buffer between filters and audio outputs. In order to avoid cutting frames into half (which can upset receivers), we strictly need to align the boundaries on which we cut the audio.
* options: handle terminal/logging settings eagerlyGravatar wm42015-11-04
| | | | | | | | | | | Update msg.c state immediately if a terminal or logging setting is set. Until now, this was delayed until mp[v]_initialize() was called. When using the client API, you could easily miss logged error messages, even when logging was initialized early on by calling mpv_request_log_messages(). (Properties can't be used for this either, because properties do not work before mpv_initialize().)
* player: fix display-sync adrop speed limitingGravatar wm42015-11-04
| | | | Commit 49d94853 worked only at the start of playback.
* player: limit speed change in display-sync adrop modeGravatar wm42015-11-03
| | | | | | | | | | Discontinuities (like toggling fullscreen) can cause multiple frames to be dropped in succession, which sounds very weird. It's better to drop some video frames instead to compensate for larger desyncs. We roughly base it on the maximum allowed speed changes (audio change is "additional" to the video change to account for deviations when playing at max. video speed change).
* player: another fix to A/V difference calculation in display-sync modeGravatar wm42015-11-01
| | | | | | | update_av_diff() works on the timestamps, while time_left is in real time. When playing at not-1 speed, these are very different, and cause the A/V difference to jitter. Fix this by scaling the expected A/V desync to the correct range.
* video: fix another A/V difference bug in display-sync modeGravatar wm42015-10-31
| | | | | | | | | | | | | | | This didn't show up with cases where the frame pattern has a cycle of 1 or 2 like it is the case with 24-on-24 fps, or 24-on-60 fps. It did show up with 25-on-60 fps. (We don't slow down 25 fps video to 24 on default settings.) In this case, we must not add the timing error of the next frame to the A/V difference estimation of the current frame. Use the previous timing error instead. This is another bug resulting from the confusion about whether we calculate parameters for the currently playing frame, or the one we're about to queue.
* command: add mistimed-frame-count propertyGravatar wm42015-10-30
| | | | | Does what the manpage says. This is a replacement incrementing the dropped frame counter (see previous commit).
* video: fix framedrop accounting in display-sync modeGravatar wm42015-10-30
| | | | | | | | | | | | | | 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 toleranceGravatar wm42015-10-28
| | | | | | | 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 discontinuitiesGravatar wm42015-10-28
| | | | It's annoying.
* player: simplify display-adrop mode safeguardGravatar wm42015-10-28
| | | | | | 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 computationGravatar wm42015-10-28
| | | | | | | | 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 dropsGravatar wm42015-10-28
| | | | | | | 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 modeGravatar wm42015-10-27
| | | | | 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 speedsGravatar wm42015-10-27
| | | | | | 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 modeGravatar wm42015-10-27
| | | | Not very robust in the moment.
* player: simplify audio sync pts calculationGravatar wm42015-10-27
| | | | | 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 completelyGravatar wm42015-10-26
| | | | | 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-optionsGravatar Ricardo Constantino2015-10-24
| | | | | | 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 tracksGravatar wm42015-10-23
|
* command: do not return 0 for bitrates if unknownGravatar wm42015-10-23
| | | | | | | | 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 timeGravatar wm42015-10-23
| | | | | | 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 modeGravatar wm42015-10-19
| | | | | 1 to 2 frames desync is still tolerable, and will be quickly compensated (if everything works).
* player: do not use copysign()Gravatar wm42015-10-19
| | | | | | | 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 unknownGravatar wm42015-10-16
| | | | | | 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 modeGravatar wm42015-10-14
| | | | | | 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 conditionGravatar wm42015-10-13
| | | | | | | 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 tracksGravatar ChrisK22015-10-11
|
* ytdl: Remove DASH hacks, use DASH by defaultGravatar ChrisK22015-10-11
| | | | | | | | | | | 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 EOFGravatar wm42015-10-09
| | | | | | | 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 loggingGravatar wm42015-10-08
| | | | | Pretty dumb (and doesn't handle pausing or other discontinuities), but at least somewhat idiot-proof.
* audio: make spdif re-probe from normal decoding workGravatar wm42015-10-06
| | | | | | | | 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 reloadedGravatar wm42015-10-06
| | | | Makes the spdif automagic work better on audio hotplugging.
* player: make stop command actually stopGravatar wm42015-10-06
| | | | | | | | | | | | | 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)Gravatar wm42015-10-06
| | | | | | | | | 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 cleanupGravatar ChrisK22015-10-06
| | | | Closes #2370
* audio: add option for falling back to ao_nullGravatar wm42015-10-05
| | | | | | | | | 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 extensionsGravatar wm42015-10-04
| | | | Fixes #2378.
* video/out: remove an unused parameterGravatar wm42015-10-03
| | | | | | | | | | | 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 prefixGravatar wm42015-10-01
| | | | A minor, but apparently common feature request. Fixes #2360.
* ytdl: Don't override user-set format in no-video modeGravatar ChrisK22015-09-30
|
* video: replace vf_format outputlevels option with global optionGravatar wm42015-09-29
| | | | | | | | | | | 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 bugGravatar wm42015-09-23
| | | | | | Will this shit ever actually work? Fixes #2339.
* player: fix excessive CPU usage in audio-only modeGravatar wm42015-09-22
| | | | | | | | | 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 fixesGravatar wm42015-09-21
| | | | | | | | | | | | | 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 playbackGravatar wm42015-09-20
| | | | | | | | | | 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.cGravatar wm42015-09-20
| | | | | | 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.