[Mplayer-cvslog] CVS: main/libmpcodecs ad_real.c,1.1,1.2

Arpi of Ize arpi at mplayerhq.hu
Mon Jun 10 04:19:46 CEST 2002


Update of /cvsroot/mplayer/main/libmpcodecs
In directory mail:/var/tmp.root/cvs-serv2305

Modified Files:
	ad_real.c 
Log Message:
yeah, it worx! but needs a big cleanup and removal of hardcoded stuff


Index: ad_real.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpcodecs/ad_real.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- ad_real.c	10 Jun 2002 01:32:12 -0000	1.1
+++ ad_real.c	10 Jun 2002 02:19:43 -0000	1.2
@@ -112,7 +112,7 @@
     }
 
   sh->audio_out_minsize=128000; //sh->samplerate*sh->samplesize*sh->channels;
-  sh->audio_in_minsize=2*sh->wf->nBlockAlign;
+  sh->audio_in_minsize=10*sh->wf->nBlockAlign;
 //  sh->samplesize=2;
 //  sh->channels=2;
 //  sh->samplerate=44100;
@@ -141,12 +141,23 @@
 static int decode_audio(sh_audio_t *sh,unsigned char *buf,int minlen,int maxlen){
   int result;
   int len=-1;
+
+  if(sh->a_in_buffer_len<=0){
+      // fill the buffer!
+      int x,y;
+      for(y=0;y<10;y++)
+        for(x=0;x<10;x++){
+	    demux_read_data(sh->ds, sh->a_in_buffer+10*60*x+60*5*(y&1)+60*(y>>1), 60);
+	}
+      sh->a_in_buffer_len=10*10*60;
+  }
   
-  demux_read_data(sh->ds, sh->a_in_buffer, 60);
+//  demux_read_data(sh->ds, sh->a_in_buffer, 600);
   
-  result=raDecode(sh->context, sh->a_in_buffer, sh->wf->nBlockAlign,
+  result=raDecode(sh->context, sh->a_in_buffer+10*10*60-sh->a_in_buffer_len, sh->wf->nBlockAlign,
        buf, &len, -1);
-       
+  sh->a_in_buffer_len-=sh->wf->nBlockAlign;
+  
   printf("radecode: %d bytes, res=0x%X  \n",len,result);
 
   // audio decoding. the most important thing :)
@@ -168,7 +179,7 @@
   //  ds_get_packet(sh->ds, &buffer) - set ptr buffer to next data packet
   // (both func return number of bytes or 0 for error)
 
-  return len/8; // return value: number of _bytes_ written to output buffer,
+  return len; // return value: number of _bytes_ written to output buffer,
               // or -1 for EOF (or uncorrectable error)
 }
 




More information about the MPlayer-cvslog mailing list