tmus

TUI Music Player
git clone https://git.sinitax.com/sinitax/tmus
Log | Files | Refs | Submodules | LICENSE | sfeed.txt

commit bdd07eec829df74c49f2929c19bd0a649f72b7d0
parent 3862d00855b93034019cff9a5fdec8a62117fbfa
Author: Louis Burda <quent.burda@gmail.com>
Date:   Thu, 12 May 2022 12:08:50 +0200

Remove volume patch for upstream volume resetting bug

Diffstat:
Msrc/player_mpd.c | 13+++++--------
1 file changed, 5 insertions(+), 8 deletions(-)

diff --git a/src/player_mpd.c b/src/player_mpd.c @@ -146,20 +146,19 @@ player_deinit(void) void player_update(void) { - static bool init = false; struct mpd_status *status; struct mpd_song *current_song; bool queue_empty; if (!mpd.conn) { - if (init) PLAYER_STATUS(ERR, "MPD: Connection reset"); - init = true; mpd.conn = mpd_connection_new(NULL, 0, 0); if (!mpd.conn) ERROR("MPD: Connection failed\n"); } status = mpd_run_status(mpd.conn); if (!status) { + PLAYER_STATUS(ERR, "MPD connection reset: %s", + mpd_connection_get_error_message(mpd.conn)); mpd_connection_free(mpd.conn); mpd.conn = NULL; return; @@ -183,7 +182,8 @@ player_update(void) * get status and track name again.. */ status = mpd_run_status(mpd.conn); if (!status) { - PLAYER_STATUS(ERR, "Resetting MPD server connection"); + PLAYER_STATUS(ERR, "MPD connection reset: %s", + mpd_connection_get_error_message(mpd.conn)); mpd_connection_free(mpd.conn); mpd.conn = NULL; return; @@ -220,10 +220,7 @@ player_update(void) PANIC(); } - if (player.volume >= 0 && player.volume != mpd_status_get_volume(status)) - mpd_run_set_volume(mpd.conn, player.volume); - else - player.volume = mpd_status_get_volume(status); + player.volume = mpd_status_get_volume(status); if (mpd.seek_delay) { mpd.seek_delay -= 1;