summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars-Dominik Braun <lars@6xq.net>2023-03-27 19:42:24 +0200
committerLars-Dominik Braun <lars@6xq.net>2023-03-27 19:42:24 +0200
commit218f3f84965e648793bcb2b0b9d97de636de01e7 (patch)
treeabc783e3288bab684493c735212d9ce1e49ba575
parentb11e5e07001fbbba619bb704668c7c8fdc1e2266 (diff)
downloadpianobar-218f3f84965e648793bcb2b0b9d97de636de01e7.tar.gz
pianobar-218f3f84965e648793bcb2b0b9d97de636de01e7.tar.bz2
pianobar-218f3f84965e648793bcb2b0b9d97de636de01e7.zip
player: Also retry on ECONNRESET.
It’s not entirely clear why or when ffmpeg returns this error. Fixes #735.
-rw-r--r--src/player.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/player.c b/src/player.c
index 875f473..94d3cee 100644
--- a/src/player.c
+++ b/src/player.c
@@ -533,7 +533,9 @@ void *BarPlayerThread (void *data) {
if (openFilter (player) && openDevice (player)) {
changeMode (player, PLAYER_PLAYING);
BarPlayerSetVolume (player);
- retry = play (player) == AVERROR_INVALIDDATA &&
+ const int ret = play (player);
+ retry = (ret == AVERROR_INVALIDDATA ||
+ ret == -ECONNRESET) &&
!player->interrupted;
} else {
/* filter missing or audio device busy */