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.)
This commit is contained in:
wm4
2015-06-23 19:21:20 +02:00
parent ddd6f5a9d7
commit ff9c597fbf

View File

@@ -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);
}