map

minimalist audio player
git clone https://git.porkepik.fr/map
Log | Files | Refs | README | LICENSE

commit cf89679cb226791349fb17b4159b5f9a63700c85
parent 34e63cc1868e45e9e9b79895738ac7f6d853bd0a
Author: Thomas Philippe <dev@porkepik.fr>
Date:   Wed,  1 Jul 2020 01:06:50 +0200

fix sound playing after quitting when paused

Diffstat:
Mmap.c | 15++++++++-------
1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/map.c b/map.c @@ -11,7 +11,7 @@ #include <unistd.h> #define SEEK_SEC 20 -#define DEFAULT_VOL 90 +#define DEFAULT_VOL 80 struct player { @@ -313,12 +313,6 @@ next: goto endtrack; } - if (pause_t) { - print_pause(); - usleep(10 * 1000); - continue; - } - if (!gapless) { done = curtrack.decode(buf, bufsize); if (trackid+1 < ntracks && done < bufsize / 2) { @@ -336,6 +330,13 @@ next: gapless = 0; } + if (pause_t) { + print_pause(); + usleep(50 * 1000); + continue; + } + + if (done < 0 || sndio_play(buf, done) < 0) { sndio_close(); curtrack.close();