diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/decode.c | 5 | ||||
-rw-r--r-- | src/decode.h | 4 |
2 files changed, 5 insertions, 4 deletions
diff --git a/src/decode.c b/src/decode.c index c990edc9e..49babb31f 100644 --- a/src/decode.c +++ b/src/decode.c @@ -238,9 +238,9 @@ void decodeStart(PlayerControl * pc, OutputBuffer * cb, DecoderControl * dc) { 0 == strcmp(inStream.mime, "audio/mpeg"))) { ret = mp3_decode(cb,dc,&inStream); + break; } else ret = DECODE_ERROR_UNKTYPE; - break; #endif case DECODE_TYPE_FILE: #ifdef HAVE_MAD @@ -285,10 +285,11 @@ void decodeStart(PlayerControl * pc, OutputBuffer * cb, DecoderControl * dc) { default: ret = DECODE_ERROR_UNKTYPE; } - if(ret<0) { + if(ret<0 || ret == DECODE_ERROR_UNKTYPE) { strncpy(pc->erroredFile, dc->file, MAXPATHLEN); pc->erroredFile[MAXPATHLEN] = '\0'; if(ret != DECODE_ERROR_UNKTYPE) dc->error = DECODE_ERROR_FILE; + else closeInputStream(&inStream); dc->start = 0; dc->stop = 0; dc->state = DECODE_STATE_STOP; diff --git a/src/decode.h b/src/decode.h index a766efd44..c21407b48 100644 --- a/src/decode.h +++ b/src/decode.h @@ -34,8 +34,8 @@ #define DECODE_STATE_DECODE 1 #define DECODE_ERROR_NOERROR 0 -#define DECODE_ERROR_UNKTYPE -10 -#define DECODE_ERROR_FILE -20 +#define DECODE_ERROR_UNKTYPE 10 +#define DECODE_ERROR_FILE 20 #define DECODE_SUFFIX_MP3 1 #define DECODE_SUFFIX_OGG 2 |