decoder/mad: make variables more local

This commit is contained in:
Max Kellermann 2014-08-26 10:33:12 +02:00
parent 4a503ba1ad
commit 58ec9d3a73

View File

@ -978,8 +978,6 @@ MadDecoder::SyncAndSend()
inline bool inline bool
MadDecoder::Read() MadDecoder::Read()
{ {
enum mp3_action ret;
UpdateTimerNextFrame(); UpdateTimerNextFrame();
switch (mute_frame) { switch (mute_frame) {
@ -995,11 +993,10 @@ MadDecoder::Read()
case MUTEFRAME_NONE: case MUTEFRAME_NONE:
cmd = SyncAndSend(); cmd = SyncAndSend();
if (cmd == DecoderCommand::SEEK) { if (cmd == DecoderCommand::SEEK) {
unsigned long j;
assert(input_stream.IsSeekable()); assert(input_stream.IsSeekable());
j = TimeToFrame(decoder_seek_where(*decoder)); unsigned long j =
TimeToFrame(decoder_seek_where(*decoder));
if (j < highest_frame) { if (j < highest_frame) {
if (Seek(frame_offsets[j])) { if (Seek(frame_offsets[j])) {
current_frame = j; current_frame = j;
@ -1016,8 +1013,7 @@ MadDecoder::Read()
} }
while (true) { while (true) {
bool skip = false; enum mp3_action ret;
do { do {
Tag *tag = nullptr; Tag *tag = nullptr;
@ -1031,8 +1027,8 @@ MadDecoder::Read()
} while (ret == DECODE_CONT); } while (ret == DECODE_CONT);
if (ret == DECODE_BREAK) if (ret == DECODE_BREAK)
return false; return false;
else if (ret == DECODE_SKIP)
skip = true; const bool skip = ret == DECODE_SKIP;
if (mute_frame == MUTEFRAME_NONE) { if (mute_frame == MUTEFRAME_NONE) {
do { do {