From ad8bc3c607807796addf0a9294a10453be67f0dc Mon Sep 17 00:00:00 2001 From: arpi Date: Sat, 28 Sep 2002 02:03:09 +0000 Subject: [PATCH] layer-1 stream parsing (NOT decoding) support git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@7521 b3059339-0415-0410-9bf9-f77b7e298cf2 --- mp3lib/sr1.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/mp3lib/sr1.c b/mp3lib/sr1.c index f360797162..16465675d1 100644 --- a/mp3lib/sr1.c +++ b/mp3lib/sr1.c @@ -265,7 +265,17 @@ switch(fr->lay){ MP3_framesize=fr->framesize; fr->framesize += fr->padding - 4; break; + case 1: +// fr->jsbound = (fr->mode == MPG_MD_JOINT_STEREO) ? (fr->mode_ext<<2)+4 : 32; + MP3_bitrate=tabsel_123[fr->lsf][0][fr->bitrate_index]; + MP3_samplerate=freqs[fr->sampling_frequency]; + fr->framesize = (long) MP3_bitrate * 12000; + fr->framesize /= MP3_samplerate; + MP3_framesize = fr->framesize; + fr->framesize = ((fr->framesize+fr->padding)<<2)-4; + break; default: + MP3_framesize=fr->framesize=0; // fprintf(stderr,"Sorry, unsupported layer type.\n"); return 0; } @@ -539,6 +549,9 @@ int MP3_DecodeFrame(unsigned char *hova,short single){ switch(fr.lay){ case 2: do_layer2(&fr,single);break; case 3: do_layer3(&fr,single);break; + case 1: + printf("mp3lib: layer-1 audio not yet supported!\n"); + return 4608; default: return 0; // unsupported }