use DECODE_ERROR_NOERROR instead of 0
In my opinion, the code becomes more readable when we explicitly check "==NOERROR" instead of an implicit 0 check. git-svn-id: https://svn.musicpd.org/mpd/trunk@7255 09075e82-0dd4-0310-85a5-a0d7c8717e4f
This commit is contained in:

committed by
Eric Wong

parent
f6ed3eaeae
commit
e63f388b04
@@ -167,13 +167,13 @@ static int decodeSeek(PlayerControl * pc, DecoderControl * dc,
|
|||||||
int ret = -1;
|
int ret = -1;
|
||||||
|
|
||||||
if (dc->state == DECODE_STATE_STOP ||
|
if (dc->state == DECODE_STATE_STOP ||
|
||||||
dc->error ||
|
dc->error != DECODE_ERROR_NOERROR ||
|
||||||
dc->current_song != pc->current_song) {
|
dc->current_song != pc->current_song) {
|
||||||
stopDecode(dc);
|
stopDecode(dc);
|
||||||
*next = -1;
|
*next = -1;
|
||||||
cb->begin = 0;
|
cb->begin = 0;
|
||||||
cb->end = 0;
|
cb->end = 0;
|
||||||
dc->error = 0;
|
dc->error = DECODE_ERROR_NOERROR;
|
||||||
dc->start = 1;
|
dc->start = 1;
|
||||||
waitOnDecode(pc, dc, cb, decodeWaitedOn);
|
waitOnDecode(pc, dc, cb, decodeWaitedOn);
|
||||||
}
|
}
|
||||||
@@ -612,7 +612,7 @@ void decode(void)
|
|||||||
cb->end = 0;
|
cb->end = 0;
|
||||||
pc = &(getPlayerData()->playerControl);
|
pc = &(getPlayerData()->playerControl);
|
||||||
dc = &(getPlayerData()->decoderControl);
|
dc = &(getPlayerData()->decoderControl);
|
||||||
dc->error = 0;
|
dc->error = DECODE_ERROR_NOERROR;
|
||||||
dc->seek = 0;
|
dc->seek = 0;
|
||||||
dc->stop = 0;
|
dc->stop = 0;
|
||||||
dc->start = 1;
|
dc->start = 1;
|
||||||
|
Reference in New Issue
Block a user