From 4359058c79187bb8c3d41328f46a730f3eb113ac Mon Sep 17 00:00:00 2001 From: Andree Buschmann Date: Wed, 13 Apr 2011 05:51:03 +0000 Subject: Fix the Xing header parser to have reliable gapless playback. Closes FS#12062. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29708 a1c6a512-1295-4272-9138-f99709370657 --- apps/mp3data.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'apps/mp3data.c') diff --git a/apps/mp3data.c b/apps/mp3data.c index 697797279e..9fed727609 100644 --- a/apps/mp3data.c +++ b/apps/mp3data.c @@ -41,7 +41,7 @@ #include "buffer.h" #include "system.h" -// #define DEBUG_VERBOSE +//#define DEBUG_VERBOSE #ifdef DEBUG_VERBOSE #define VDEBUGF DEBUGF @@ -452,7 +452,7 @@ static void get_xing_info(struct mp3info *info, unsigned char *buf) #if CONFIG_CODEC==SWCODEC i += 21; info->enc_delay = ((int)buf[i ] << 4) | (buf[i+1] >> 4); - info->enc_padding = ((int)buf[i+1] << 8) | buf[i+2]; + info->enc_padding = ((int)(buf[i+1]&0xF) << 8) | buf[i+2]; /* TODO: This sanity checking is rather silly, seeing as how the LAME header contains a CRC field that can be used to verify integrity. */ if (!(info->enc_delay >= 0 && info->enc_delay <= 2880 && -- cgit v1.2.3