mp3: converted the DECODE_ constants to an enum

This commit is contained in:
Max Kellermann 2008-08-26 08:27:14 +02:00
parent 1c196478b6
commit 95fff55d7e

View File

@ -34,10 +34,12 @@
#define READ_BUFFER_SIZE 40960 #define READ_BUFFER_SIZE 40960
#define DECODE_SKIP -3 enum mp3_action {
#define DECODE_BREAK -2 DECODE_SKIP = -3,
#define DECODE_CONT -1 DECODE_BREAK = -2,
#define DECODE_OK 0 DECODE_CONT = -1,
DECODE_OK = 0
};
#define MUTEFRAME_SKIP 1 #define MUTEFRAME_SKIP 1
#define MUTEFRAME_SEEK 2 #define MUTEFRAME_SEEK 2
@ -364,8 +366,9 @@ fail:
} }
#endif #endif
static int decodeNextFrameHeader(mp3DecodeData * data, MpdTag ** tag, static enum mp3_action
ReplayGainInfo ** replayGainInfo) decodeNextFrameHeader(mp3DecodeData * data, MpdTag ** tag,
ReplayGainInfo ** replayGainInfo)
{ {
enum mad_layer layer; enum mad_layer layer;
@ -427,7 +430,8 @@ static int decodeNextFrameHeader(mp3DecodeData * data, MpdTag ** tag,
return DECODE_OK; return DECODE_OK;
} }
static int decodeNextFrame(mp3DecodeData * data) static enum mp3_action
decodeNextFrame(mp3DecodeData * data)
{ {
if ((data->stream).buffer == NULL if ((data->stream).buffer == NULL
|| (data->stream).error == MAD_ERROR_BUFLEN) { || (data->stream).error == MAD_ERROR_BUFLEN) {
@ -821,7 +825,8 @@ static int openMp3FromInputStream(InputStream * inStream, mp3DecodeData * data,
return 0; return 0;
} }
static int mp3Read(mp3DecodeData * data, ReplayGainInfo ** replayGainInfo) static enum mp3_action
mp3Read(mp3DecodeData * data, ReplayGainInfo ** replayGainInfo)
{ {
struct decoder *decoder = data->decoder; struct decoder *decoder = data->decoder;
unsigned int pcm_length, max_samples; unsigned int pcm_length, max_samples;