diff options
author | Lars-Dominik Braun <lars@6xq.net> | 2014-03-14 11:47:26 +0100 |
---|---|---|
committer | Lars-Dominik Braun <lars@6xq.net> | 2014-03-14 11:47:26 +0100 |
commit | 90f6ffbdb7c7cc07cb02b69fcfb3a3844f0180b7 (patch) | |
tree | 24dc728782be82d00e6d0f6676de856a0227393b /src/main.c | |
parent | ebfd7d45c6b8eb5b2a1ee6e97a3f21f5f5bf9b43 (diff) | |
download | pianobar-windows-90f6ffbdb7c7cc07cb02b69fcfb3a3844f0180b7.tar.gz pianobar-windows-90f6ffbdb7c7cc07cb02b69fcfb3a3844f0180b7.tar.bz2 pianobar-windows-90f6ffbdb7c7cc07cb02b69fcfb3a3844f0180b7.zip |
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.
Diffstat (limited to 'src/main.c')
-rw-r--r-- | src/main.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -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); } } |