diff decoders/mpglib/layer2.c @ 279:52b9f37998db

Removed global state variable; should be thread safe now.
author Ryan C. Gordon <icculus@icculus.org>
date Thu, 14 Mar 2002 16:38:59 +0000
parents 9b6e82f7c853
children ad4c8f34136a
line wrap: on
line diff
--- a/decoders/mpglib/layer2.c	Thu Mar 14 16:38:32 2002 +0000
+++ b/decoders/mpglib/layer2.c	Thu Mar 14 16:38:59 2002 +0000
@@ -247,7 +247,7 @@
   fr->II_sblimit = sblim;
 }
 
-int do_layer2(struct frame *fr,unsigned char *pcm_sample,int *pcm_point)
+int do_layer2(struct frame *fr,unsigned char *pcm_sample,int *pcm_point,struct mpstr *mp)
 {
   int clip=0;
   int i,j;
@@ -271,12 +271,12 @@
     II_step_two(bit_alloc,fraction,scale,fr,i>>2);
     for (j=0;j<3;j++) {
       if(single >= 0) {
-        clip += synth_1to1_mono(fraction[0][j],pcm_sample,pcm_point);
+        clip += synth_1to1_mono(fraction[0][j],pcm_sample,pcm_point,mp);
       }
       else {
         int p1 = *pcm_point;
-        clip += synth_1to1(fraction[0][j],0,pcm_sample,&p1);
-        clip += synth_1to1(fraction[1][j],1,pcm_sample,pcm_point);
+        clip += synth_1to1(fraction[0][j],0,pcm_sample,&p1,mp);
+        clip += synth_1to1(fraction[1][j],1,pcm_sample,pcm_point,mp);
       }
 
     }