player: fix stats-logging of sleep state

This commit is contained in:
wm4 2017-02-21 15:16:38 +01:00
parent 7dd81c3f96
commit 13d2eb8eb9
1 changed files with 3 additions and 2 deletions

View File

@ -56,7 +56,8 @@
// mp_wait_events() was called.
void mp_wait_events(struct MPContext *mpctx)
{
if (mpctx->sleeptime > 0)
bool sleeping = mpctx->sleeptime > 0;
if (sleeping)
MP_STATS(mpctx, "start sleep");
mpctx->in_dispatch = true;
@ -66,7 +67,7 @@ void mp_wait_events(struct MPContext *mpctx)
mpctx->in_dispatch = false;
mpctx->sleeptime = INFINITY;
if (mpctx->sleeptime > 0)
if (sleeping)
MP_STATS(mpctx, "end sleep");
}