summaryrefslogtreecommitdiffstats
path: root/mp3lib/sr1.c
diff options
context:
space:
mode:
authorgpoirier <gpoirier@b3059339-0415-0410-9bf9-f77b7e298cf2>2005-12-31 18:56:35 +0000
committergpoirier <gpoirier@b3059339-0415-0410-9bf9-f77b7e298cf2>2005-12-31 18:56:35 +0000
commit86b89307b706caccfa51a9a91226eb6bd24f7b30 (patch)
tree439fc3681c22ccf4606b9465a9d895b5108cab5c /mp3lib/sr1.c
parentfc9ce0c940f95287f50536386cf9ed2584a0abe2 (diff)
downloadmpv-86b89307b706caccfa51a9a91226eb6bd24f7b30.tar.bz2
mpv-86b89307b706caccfa51a9a91226eb6bd24f7b30.tar.xz
"Currently mplayer looks for only one MP3 frame sync. The attached
patch makes it to look for two consecutive valid MP3 frame headers, reducing the probability of false positives, which causes Bug 380. Funny that the fix is so simple. Seems that someone has forgotten to initialize MP3_resync correctly. Also this is the recommended way to sync MP3 frames. See http://www.dv.co.yu/mpgscript/mpeghdr.htm. " Original thread: Date: Dec 31, 2005 10:15 AM Subject: [MPlayer-dev-eng] [PATCH] Try twice when searching for MP3 frame header, fixes Bug 380 git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@17280 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'mp3lib/sr1.c')
-rw-r--r--mp3lib/sr1.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/mp3lib/sr1.c b/mp3lib/sr1.c
index 87ab7dc4b7..952f2dcdc8 100644
--- a/mp3lib/sr1.c
+++ b/mp3lib/sr1.c
@@ -45,7 +45,7 @@ int MP3_fpos=0; // current file position
int MP3_framesize=0; // current framesize
int MP3_bitrate=0; // current bitrate
int MP3_samplerate=0; // current samplerate
-int MP3_resync=0;
+static int MP3_resync;
int MP3_channels=0;
int MP3_bps=2;
@@ -407,6 +407,7 @@ void MP3_Init(){
_has_mmx = 0;
dct36_func = dct36;
+ MP3_resync = 1;
make_decode_tables(outscale);