summaryrefslogtreecommitdiff
path: root/firmware/mp3data.c
diff options
context:
space:
mode:
authorJens Arnold <amiconn@rockbox.org>2005-06-18 11:26:14 +0000
committerJens Arnold <amiconn@rockbox.org>2005-06-18 11:26:14 +0000
commitb0287720b1f4a3e39dbd003fda2eebdfe22ad1ed (patch)
tree69b78efc72adb07273ecd40cf534cef812fd81e4 /firmware/mp3data.c
parente2cd58145d90eac8e33f6e3684e73cf2b83692d3 (diff)
Fixed MPEG header validation for layer 1 on iriver, and simplified it for archos.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@6746 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/mp3data.c')
-rw-r--r--firmware/mp3data.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/firmware/mp3data.c b/firmware/mp3data.c
index 6e553eb94a..e899125013 100644
--- a/firmware/mp3data.c
+++ b/firmware/mp3data.c
@@ -105,18 +105,17 @@ static bool is_mp3frameheader(unsigned long head)
return false;
if (!(head & LAYER_MASK)) /* no layer? */
return false;
+#if CONFIG_HWCODEC != MASNONE
+ /* The MAS can't decode layer 1, so treat layer 1 data as invalid */
+ if ((head & LAYER_MASK) == LAYER_MASK)
+ return false;
+#endif
if ((head & BITRATE_MASK) == BITRATE_MASK) /* bad bitrate? */
return false;
if (!(head & BITRATE_MASK)) /* no bitrate? */
return false;
if ((head & SAMPLERATE_MASK) == SAMPLERATE_MASK) /* bad sample rate? */
return false;
- if (((head >> 19) & 1) == 1 &&
- ((head >> 17) & 3) == 3 &&
- ((head >> 16) & 1) == 1)
- return false;
- if ((head & 0xffff0000) == 0xfffe0000)
- return false;
return true;
}