map

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

commit 156bc4fec48798520ca132471ff1a9a4537f1853
parent cf89679cb226791349fb17b4159b5f9a63700c85
Author: Thomas Philippe <dev@porkepik.fr>
Date:   Sun,  5 Jul 2020 06:10:52 +0200

fix resizing terminal window while paused

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

diff --git a/map.c b/map.c @@ -313,6 +313,21 @@ next: goto endtrack; } + if(get_term_size(&rows, &cols)) { + clear_term(); + print_playlist(player.tracks, 0); + cursorid = 1; + toptrack = 0; + print_info(player.curdir, curtrack); + print_volume(player.volume); + } + + if (pause_t) { + print_pause(); + usleep(50 * 1000); + continue; + } + if (!gapless) { done = curtrack.decode(buf, bufsize); if (trackid+1 < ntracks && done < bufsize / 2) { @@ -330,28 +345,12 @@ next: gapless = 0; } - if (pause_t) { - print_pause(); - usleep(50 * 1000); - continue; - } - - if (done < 0 || sndio_play(buf, done) < 0) { sndio_close(); curtrack.close(); errx(1, "Error during decoding."); } - if(get_term_size(&rows, &cols)) { - clear_term(); - print_playlist(player.tracks, 0); - cursorid = 1; - toptrack = 0; - print_info(player.curdir, curtrack); - print_volume(player.volume); - } - timersec = difftime(time(NULL), start); print_timer(timersec, curtrack.length); } while (done);