To make the code more consistent, call quitDecode() only at the end of
decodeParent().
---

 src/player_thread.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/player_thread.c b/src/player_thread.c
index 0937fb3..fa3bbcc 100644
--- a/src/player_thread.c
+++ b/src/player_thread.c
@@ -71,7 +71,6 @@ static int waitOnDecode(int *decodeWaitedOn)
        if (dc.error != DECODE_ERROR_NOERROR) {
                pc.errored_song = dc.next_song;
                pc.error = PLAYER_ERROR_FILE;
-               quitDecode();
                return -1;
        }
 
@@ -211,8 +210,10 @@ static void decodeParent(void)
 
        ob_set_lazy(0);
 
-       if (waitOnDecode(&decodeWaitedOn) < 0)
+       if (waitOnDecode(&decodeWaitedOn) < 0) {
+               quitDecode();
                return;
+       }
 
        pc.elapsedTime = 0;
        pc.state = PLAYER_STATE_PLAY;


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Musicpd-dev-team mailing list
Musicpd-dev-team@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/musicpd-dev-team

Reply via email to