summaryrefslogtreecommitdiffstats
path: root/player
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2015-06-23 19:21:20 +0200
committerwm4 <wm4@nowhere>2015-06-23 19:23:11 +0200
commitff9c597fbf620bd207aaf123640233bb5f4edd7f (patch)
treeac701ae39b6cf666006d6c5416dde5d95b228cba /player
parentddd6f5a9d72a3880595cadd58e49ee91d45cc66b (diff)
downloadmpv-ff9c597fbf620bd207aaf123640233bb5f4edd7f.tar.bz2
mpv-ff9c597fbf620bd207aaf123640233bb5f4edd7f.tar.xz
player: increase tick event update frequency
500ms is a bit too high. Change it to 50ms. This improves client API (and Lua) playback state update frequency. Updating absolutely every time the audio PTS changes would be possible, but is not helpful. Audio samplerates are high to trigger a wakeup feedback loop, so the process would waste CPU time on updating the playback position all the time. (If a client application wants to ensure smooth update of the playback position, it should update the position manually using a timer and by reading the property - the application can make a much better decision at how often the playback has to happen.)
Diffstat (limited to 'player')
-rw-r--r--player/playloop.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/player/playloop.c b/player/playloop.c
index f92f70ba04..65bdf54252 100644
--- a/player/playloop.c
+++ b/player/playloop.c
@@ -918,7 +918,7 @@ void handle_force_window(struct MPContext *mpctx, bool reconfig)
static void handle_dummy_ticks(struct MPContext *mpctx)
{
if (mpctx->video_status == STATUS_EOF || mpctx->paused) {
- if (mp_time_sec() - mpctx->last_idle_tick > 0.5) {
+ if (mp_time_sec() - mpctx->last_idle_tick > 0.050) {
mpctx->last_idle_tick = mp_time_sec();
mp_notify(mpctx, MPV_EVENT_TICK, NULL);
}