[Mplayer-cvslog] CVS: main dec_audio.c,1.30,1.31

Arpi of Ize arpi at mplayer.dev.hu
Wed Aug 15 14:09:02 CEST 2001


Update of /cvsroot/mplayer/main
In directory mplayer:/var/tmp.root/cvs-serv27693

Modified Files:
	dec_audio.c 
Log Message:
o_bps changes for hwac3 driver

Index: dec_audio.c
===================================================================
RCS file: /cvsroot/mplayer/main/dec_audio.c,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -r1.30 -r1.31
--- dec_audio.c	15 Aug 2001 11:46:13 -0000	1.30
+++ dec_audio.c	15 Aug 2001 12:09:00 -0000	1.31
@@ -69,6 +69,7 @@
 #endif
 sh_audio->samplerate=0;
 //sh_audio->pcm_bswap=0;
+sh_audio->o_bps=0;
 
 sh_audio->a_buffer_size=0;
 sh_audio->a_buffer=NULL;
@@ -230,7 +231,8 @@
   unsigned char *buffer;		    
   struct hwac3info ai;
   int len, skipped;
-  len = ds_get_packet(sh_audio->ds, &buffer);
+  len = ds_get_packet(sh_audio->ds, &buffer); // maybe 1 packet is not enough,
+    // at least for mpeg, PS packets contain about max. 2000 bytes of data.
   if(ac3_iec958_parse_syncinfo(buffer, len, &ai, &skipped) < 0) {
       fprintf(stderr, "AC3 stream not valid.\n");
       driver = 0;
@@ -242,10 +244,11 @@
       break;
   }
   sh_audio->samplerate=ai.samplerate;
-//  sh_audio->samplesize=ai.framesize;
+  sh_audio->samplesize=ai.framesize;
   sh_audio->channels=1;
   sh_audio->i_bps=ai.bitrate*(1000/8);
   sh_audio->ac3_frame=malloc(6144);
+  sh_audio->o_bps=sh_audio->i_bps;  // XXX FIXME!!! XXX
   break;
 }
 case AFM_ALAW: {
@@ -293,10 +296,10 @@
   if(!driver){
       if(sh_audio->a_buffer) free(sh_audio->a_buffer);
       sh_audio->a_buffer=NULL;
-      sh_audio->o_bps=0;
       return 0;
   }
 
+  if(!sh_audio->o_bps)
   sh_audio->o_bps=sh_audio->channels*sh_audio->samplerate*sh_audio->samplesize;
   return driver;
 }




More information about the MPlayer-cvslog mailing list