aboutsummaryrefslogtreecommitdiffstats
path: root/src/inputPlugins/mp3_plugin.c
diff options
context:
space:
mode:
authorJ. Alexander Treuman <jat@spatialrift.net>2006-08-23 13:43:23 +0000
committerJ. Alexander Treuman <jat@spatialrift.net>2006-08-23 13:43:23 +0000
commit30bf8f89f40be2ee0eafa61f43e111e5f571f9ad (patch)
tree949e8163955907fb6c4dcf8a968247d8479f865d /src/inputPlugins/mp3_plugin.c
parent103dd654f0d9357f9da66593525958476ee26f85 (diff)
downloadmpd-30bf8f89f40be2ee0eafa61f43e111e5f571f9ad.tar.gz
mpd-30bf8f89f40be2ee0eafa61f43e111e5f571f9ad.tar.xz
mpd-30bf8f89f40be2ee0eafa61f43e111e5f571f9ad.zip
If a frame header decode loses sync, just try again instead of trying to decode a frame (which will automatically decode the next header without allowing us to do some checks on it).
git-svn-id: https://svn.musicpd.org/mpd/trunk@4670 09075e82-0dd4-0310-85a5-a0d7c8717e4f
Diffstat (limited to 'src/inputPlugins/mp3_plugin.c')
-rw-r--r--src/inputPlugins/mp3_plugin.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/src/inputPlugins/mp3_plugin.c b/src/inputPlugins/mp3_plugin.c
index 073cad009..35f822b1e 100644
--- a/src/inputPlugins/mp3_plugin.c
+++ b/src/inputPlugins/mp3_plugin.c
@@ -629,25 +629,21 @@ static int decodeFirstFrame(mp3DecodeData * data, DecoderControl * dc,
struct mad_bitptr ptr;
int bitlen;
int ret;
- int skip;
/* stfu gcc */
memset(&xing, 0, sizeof(struct xing));
xing.flags = 0;
while (1) {
- skip = 0;
while ((ret = decodeNextFrameHeader(data, tag, replayGainInfo)) == DECODE_CONT &&
(!dc || !dc->stop));
-
- if (ret == DECODE_SKIP) skip = 1;
- else if (ret == DECODE_BREAK || (dc && dc->stop)) return -1;
+ if (ret == DECODE_BREAK || (dc && dc->stop)) return -1;
+ if (ret == DECODE_SKIP) continue;
while ((ret = decodeNextFrame(data)) == DECODE_CONT &&
(!dc || !dc->stop));
-
if (ret == DECODE_BREAK || (dc && dc->stop)) return -1;
- if (!skip && ret == DECODE_OK) break;
+ if (ret == DECODE_OK) break;
}
ptr = data->stream.anc_ptr;