summaryrefslogtreecommitdiffstats
path: root/mplayer.c
diff options
context:
space:
mode:
authorUoti Urpala <uau@glyph.nonexistent.invalid>2010-05-14 05:18:38 +0300
committerUoti Urpala <uau@glyph.nonexistent.invalid>2010-05-14 05:55:09 +0300
commit9e02b2db405ca2418cc766fd1e81dfa60909dd08 (patch)
tree868fe669af0a62c4ef4fa06af74a4a4fe4faf3ff /mplayer.c
parentc5812d60568f72006a7731d5287e7c3b75328e02 (diff)
downloadmpv-9e02b2db405ca2418cc766fd1e81dfa60909dd08.tar.bz2
mpv-9e02b2db405ca2418cc766fd1e81dfa60909dd08.tar.xz
vo_vdpau: support queuing an arbitrary number of frames ahead
Make the number of output surfaces allocated by vo_vdpau configurable and allow queuing multiple future frames with the VDPAU frame timing functionality. There are two known issues that could be polished in the future for particularly long queue time cases. First, toplevel code should possibly wait for the queued changes to finish displaying in some situations like switching files. Second, the VO can block waiting for a surface to become available, and in the worst case this wait can be almost as long as the maximum queuing time (potentially causing audio underruns). However those issues are not high priority.
Diffstat (limited to 'mplayer.c')
-rw-r--r--mplayer.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/mplayer.c b/mplayer.c
index 54072c99f3..beb1af5bc2 100644
--- a/mplayer.c
+++ b/mplayer.c
@@ -2201,10 +2201,12 @@ static int sleep_until_update(struct MPContext *mpctx, float *time_frame,
}
*time_frame = delay - mpctx->delay / opts->playback_speed;
+ *time_frame -= mpctx->video_out->flip_queue_offset;
// delay = amount of audio buffered in soundcard/driver
if (delay > 0.25) delay=0.25; else
if (delay < 0.10) delay=0.10;
+
if (*time_frame > delay*0.6) {
// sleep time too big - may cause audio drops (buffer underrun)
frame_time_remaining = 1;
@@ -2217,6 +2219,7 @@ static int sleep_until_update(struct MPContext *mpctx, float *time_frame,
// without sleeping.
if (*time_frame < -0.2 || benchmark)
*time_frame = 0;
+ *time_frame -= mpctx->video_out->flip_queue_offset;
}
*aq_sleep_time += *time_frame;
@@ -2224,7 +2227,6 @@ static int sleep_until_update(struct MPContext *mpctx, float *time_frame,
//============================== SLEEP: ===================================
- *time_frame -= mpctx->video_out->flip_queue_offset;
// flag 256 means: libvo driver does its timing (dvb card)
if (*time_frame > 0.001 && !(mpctx->sh_video->output_flags&256))
*time_frame = timing_sleep(mpctx, *time_frame);