diff options
author | Lars-Dominik Braun <lars@6xq.net> | 2014-04-18 19:57:12 +0200 |
---|---|---|
committer | Lars-Dominik Braun <lars@6xq.net> | 2014-04-18 19:57:12 +0200 |
commit | 274324aab47c51d6c07ace5e219d196077c3e5d1 (patch) | |
tree | 8288f27d2302a3836865c5b818eaad1f20aa46b5 | |
parent | cc229aa68f13ecce55cfbc1cc032cc4d67c85b08 (diff) | |
download | pianobar-windows-274324aab47c51d6c07ace5e219d196077c3e5d1.tar.gz pianobar-windows-274324aab47c51d6c07ace5e219d196077c3e5d1.tar.bz2 pianobar-windows-274324aab47c51d6c07ace5e219d196077c3e5d1.zip |
player: Fix state-machine
Song timer was shown without song playing.
-rw-r--r-- | src/main.c | 2 | ||||
-rw-r--r-- | src/player.c | 1 |
2 files changed, 2 insertions, 1 deletions
@@ -388,7 +388,7 @@ static void BarMainLoop (BarApp_t *app) { BarMainHandleUserInput (app); /* show time */ - if (app->player.mode < PLAYER_FINISHED) { + if (app->player.mode == PLAYER_PLAYING) { BarMainPrintTime (app); } } diff --git a/src/player.c b/src/player.c index 34573d7..b8d0719 100644 --- a/src/player.c +++ b/src/player.c @@ -242,6 +242,7 @@ void *BarPlayerThread (void *data) { player->songPlayed = 0; player->songDuration = av_q2d (st->time_base) * (double) st->duration; + player->mode = PLAYER_PLAYING; while (av_read_frame (fctx, &pkt) >= 0) { AVPacket pkt_orig = pkt; |