diff options
author | wm4 <wm4@nowhere> | 2014-09-19 23:46:20 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2014-09-20 00:45:11 +0200 |
commit | 4047e7e6cb8db776dd771d1dd6ef0b58f20e063a (patch) | |
tree | c66443f6b2aa6a84b3df213cef96fdba9050aedd /audio/out/ao_lavc.c | |
parent | 65e816b3fe0dae5aa21e4211ef0192b762636e2d (diff) | |
download | mpv-4047e7e6cb8db776dd771d1dd6ef0b58f20e063a.tar.bz2 mpv-4047e7e6cb8db776dd771d1dd6ef0b58f20e063a.tar.xz |
video: improve decoder-based framedropping mode
This is the "old" framedropping mode (derived from MPlayer). At least in
the mplayer2/mpv source base, it stopped working properly years ago (or
maybe it never worked properly). For one, it depends on the video
framerate, which assume constant framerate. Another problem was that it
could lead to freezing video display: video could get so much behind
that it couldn't recover from framedrop.
Make some small changes to improve this.
Don't use the current audio position to check how much we are behind.
Instead, use the last known A/V difference. last_av_difference is
updated only when a video frame is scheduled for display. This means we
can keep stop dropping once we're done catching up, even if video is
technically still behind. What helps us here that this forces a video
frame to be displayed after a while. Likewise, we reset the
dropped_frames count only when scheduling a new frame for display as
well.
Some inspiration was taken from earlier work by xnor (see issue #620),
although the implementation turned out quite different.
This still uses the demuxer-reported (possibly broken) FPS value. It
also doesn't account for filters changing FPS. We can't do much about
this, because without decoding _and_ filtering, we just can't know how
long a frame is. In theory, you could derive that from the raw packet
timestamps and the filter chain contents, but actually doing this is
too involved. Fortunately, the main thing the FPS affects is actually
the displayed framedrop count.
Diffstat (limited to 'audio/out/ao_lavc.c')
0 files changed, 0 insertions, 0 deletions