From 90f6ffbdb7c7cc07cb02b69fcfb3a3844f0180b7 Mon Sep 17 00:00:00 2001 From: Lars-Dominik Braun Date: Fri, 14 Mar 2014 11:47:26 +0100 Subject: piano: Request track length The returned length is used as first length estimate before enough audio data arrives to show the real length and for the eventcmd API. See #427 and #64. --- src/main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/main.c') diff --git a/src/main.c b/src/main.c index ba46770..9fa94eb 100644 --- a/src/main.c +++ b/src/main.c @@ -268,6 +268,7 @@ static void BarMainStartPlayback (BarApp_t *app, pthread_t *playerThread) { app->player.scale = BarPlayerCalcScale (app->player.gain + app->settings.volume); app->player.audioFormat = app->playlist->audioFormat; app->player.settings = &app->settings; + app->player.songDuration = app->playlist->length * 1000; pthread_mutex_init (&app->player.pauseMutex, NULL); pthread_cond_init (&app->player.pauseCond, NULL); @@ -388,8 +389,7 @@ static void BarMainLoop (BarApp_t *app) { BarMainHandleUserInput (app); /* show time */ - if (app->player.mode >= PLAYER_SAMPLESIZE_INITIALIZED && - app->player.mode < PLAYER_FINISHED_PLAYBACK) { + if (app->player.mode < PLAYER_FINISHED_PLAYBACK) { BarMainPrintTime (app); } } -- cgit v1.2.3