decoder/mad: simplify if/else chain

This commit is contained in:
Max Kellermann 2014-08-26 10:36:11 +02:00
parent 58ec9d3a73
commit f10d9996d2

View File

@ -432,10 +432,10 @@ MadDecoder::DecodeNextFrameHeader(Tag **tag)
return DECODE_CONT; return DECODE_CONT;
} }
} }
if (MAD_RECOVERABLE(stream.error)) {
if (MAD_RECOVERABLE(stream.error))
return DECODE_SKIP; return DECODE_SKIP;
} else { else if (stream.error == MAD_ERROR_BUFLEN)
if (stream.error == MAD_ERROR_BUFLEN)
return DECODE_CONT; return DECODE_CONT;
else { else {
FormatWarning(mad_domain, FormatWarning(mad_domain,
@ -444,7 +444,6 @@ MadDecoder::DecodeNextFrameHeader(Tag **tag)
return DECODE_BREAK; return DECODE_BREAK;
} }
} }
}
enum mad_layer new_layer = frame.header.layer; enum mad_layer new_layer = frame.header.layer;
if (layer == (mad_layer)0) { if (layer == (mad_layer)0) {
@ -479,10 +478,10 @@ MadDecoder::DecodeNextFrame()
return DECODE_CONT; return DECODE_CONT;
} }
} }
if (MAD_RECOVERABLE(stream.error)) {
if (MAD_RECOVERABLE(stream.error))
return DECODE_SKIP; return DECODE_SKIP;
} else { else if (stream.error == MAD_ERROR_BUFLEN)
if (stream.error == MAD_ERROR_BUFLEN)
return DECODE_CONT; return DECODE_CONT;
else { else {
FormatWarning(mad_domain, FormatWarning(mad_domain,
@ -491,7 +490,6 @@ MadDecoder::DecodeNextFrame()
return DECODE_BREAK; return DECODE_BREAK;
} }
} }
}
return DECODE_OK; return DECODE_OK;
} }