diff options
author | wm4 <wm4@nowhere> | 2014-04-07 18:33:25 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2014-04-07 18:37:12 +0200 |
commit | 929793be7f8e0a02006ac5915f39ca12dece72fd (patch) | |
tree | cf7cd4699fa1b4a6a7936c958f50f9e7cb9fa1c1 /Copyright | |
parent | 6f8c5d1f6dbc1aed276195f30868efbdf45794af (diff) | |
download | mpv-929793be7f8e0a02006ac5915f39ca12dece72fd.tar.bz2 mpv-929793be7f8e0a02006ac5915f39ca12dece72fd.tar.xz |
vo_vdpau: simplify time management and make it more robust
vo_vdpau used a somewhat complicated and fragile mechanism to convert
the vdpau time to internal mpv time. This was fragile as in it couldn't
deal well with Mesa's (apparently) random timestamps, which can change
the base offset in multiple situations. It can happen when moving the
mpv window to a different screen, and somehow it also happens when
pausing the player.
It seems this mechanism to synchronize the vdpau time is not actually
needed. There are only 2 places where sync_vdptime() is used (i.e.
returning the current vdpau time interpolated by system time).
The first call is for determining the PTS used to queue a frame. This
also uses convert_to_vdptime(). It's easily replaced by querying the
time directly, and adding the wait time to it (rel_pts_ns in the patch).
The second call is pretty odd: it updates the vdpau time a second time
in the same function. From what I can see, this can matter only if
update_presentation_queue_status() is very slow. I'm not sure what to
make out of this, because the call merely queries the presentation
queue. Just assume it isn't slow, and that we don't have to update the
time.
Another potential issue with this is that we call VdpPresentationQueueGetTime()
every frame now, instead of every 5 seconds and interpolating the other
calls via system time. More over, this is per video frame (which can be
portantially dropped, and not per actually displayed frame. Assume this
doesn't matter.
This simplifies the code, and should make it more robust on Mesa. But
note that what Mesa does is obviously insane - this is one situation
where you really need a stable time source. There are still plenty of
race condition windows where things can go wrong, although this commit
should drastically reduce the possibility of this.
In my tests, everything worked well. But I have no access to a Mesa
system with vdpau, so it needs testing by others.
See github issues #520, #694, #695.
Diffstat (limited to 'Copyright')
0 files changed, 0 insertions, 0 deletions