pkgsrc/audio/splay/patches/patch-ac
wiz 191992f8b4 Make splay work on big-endian platforms.
Patches from Martijn van Buul in pkg/15382, tested on macppc and i386.
2002-08-05 17:39:16 +00:00

68 lines
1.7 KiB
Text

$NetBSD: patch-ac,v 1.5 2002/08/05 17:39:18 wiz Exp $
--- mpegsound/mpeglayer3.cc.orig Fri Mar 6 18:43:55 1998
+++ mpegsound/mpeglayer3.cc
@@ -21,6 +21,7 @@
#include "mpegsound.h"
#include "mpegsound_locals.h"
+
inline void Mpegbitwindow::wrap(void)
{
int p=bitindex>>3;
@@ -45,18 +46,9 @@
inline int Mpegbitwindow::getbits9(int bits)
{
register unsigned short a;
+ int offset=bitindex>>3;
-#ifndef WORDS_BIGENDIAN
- {
- // int offset=(bitindex>>3)&(WINDOWSIZE-1);
- int offset=bitindex>>3;
-
- a=(((unsigned char)buffer[offset])<<8) | ((unsigned char)buffer[offset+1]);
- }
-#else
- // a=((unsigned short *)(buffer+((bixindex>>3)&(WINDOWSIZE-1))));
- a=((unsigned short *)(buffer+((bixindex>>3))));
-#endif
+ a=(((unsigned char)buffer[offset])<<8) | ((unsigned char)buffer[offset+1]);
a<<=(bitindex&7);
bitindex+=bits;
@@ -769,7 +761,7 @@
for(i=0;i<e;)
{
const HUFFMANCODETABLE *h;
- register end;
+ register int end;
if (i<region1Start)
{
@@ -971,7 +963,15 @@
}
}
{
- int t_index=(index-cb_begin)/cb_width;
+ int t_index = 0;
+ if (cb_width)
+ {
+ t_index=(index-cb_begin)/cb_width;
+ if (t_index > 2)
+ t_index = 0;
+ }
+ else
+ fprintf(stderr, "Very bad mp3 data\n");
out[0][index]*=layer3twopow2_1(gi->subblock_gain[t_index],
gi->scalefac_scale,
scalefactors[ch].s[t_index][cb]);
@@ -1392,7 +1392,7 @@
{
if(gi->mixed_block_flag)
{
- fprintf(stderr,"Notchecked!");
+ fprintf(stderr, "Mpegtoraw::layer3reorderandantialias:Not checked!");
layer3reorder_1 (version,frequency,in,out); // Not checked...
layer3antialias_1(out);
}