[Mplayer-cvslog] CVS: main/libmpcodecs ad_real.c,1.6,1.7

Arpi of Ize arpi at mplayerhq.hu
Mon Jun 10 18:40:23 CEST 2002


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

Modified Files:
	ad_real.c 
Log Message:
fixed copyright
print info about audio codec flavor, name, bitrate


Index: ad_real.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpcodecs/ad_real.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- ad_real.c	10 Jun 2002 15:38:20 -0000	1.6
+++ ad_real.c	10 Jun 2002 16:40:20 -0000	1.7
@@ -13,12 +13,12 @@
 #include "ad_internal.h"
 
 static ad_info_t info =  {
-	"RealAudio decoder",  // name of the driver
-	"real",   // driver name. should be the same as filename without ad_
-	AFM_REAL,    // replace with registered AFM number
-	"A'rpi",     // writer/maintainer of _this_ file
-	"",          // writer/maintainer/site of the _codec_
-	""           // comments
+	"RealAudio decoder",
+	"real",
+	AFM_REAL,
+	"A'rpi",
+	"Florian Schneider",
+	"binary real audio codecs"
 };
 
 LIBAD_EXTERN(real)
@@ -61,6 +61,8 @@
   // let's check if the driver is available, return 0 if not.
   // (you should do that if you use external lib(s) which is optional)
   unsigned int result;
+  int len;
+  void* prop;
   char path[4096];
   sprintf(path, LIBDIR "/real/%s", sh->codec->dll);
   handle = dlopen (path, RTLD_LAZY);
@@ -119,13 +121,18 @@
       return 0;
     }
 
-  sh->audio_out_minsize=128000; //sh->samplerate*sh->samplesize*sh->channels;
+    prop=raGetFlavorProperty(sh->context,((short*)(sh->wf+1))[2],0,&len);
+    mp_msg(MSGT_DECAUDIO,MSGL_INFO,"Audio codec: [%d] %s\n",((short*)(sh->wf+1))[2],prop);
+
+    prop=raGetFlavorProperty(sh->context,((short*)(sh->wf+1))[2],1,&len);
+    sh->i_bps=((*((int*)prop))+4)/8;
+    mp_msg(MSGT_DECAUDIO,MSGL_INFO,"Audio bitrate: %5.3f kbit/s (%d bps)  \n",(*((int*)prop))*0.001f,sh->i_bps);
+
+//    prop=raGetFlavorProperty(sh->context,((short*)(sh->wf+1))[2],0x13,&len);
+//    mp_msg(MSGT_DECAUDIO,MSGL_INFO,"Samples/block?: %d  \n",(*((int*)prop)));
+
+  sh->audio_out_minsize=128000; // no idea how to get... :(
   sh->audio_in_minsize=((short*)(sh->wf+1))[1]*sh->wf->nBlockAlign;
-//  sh->samplesize=2;
-//  sh->channels=2;
-//  sh->samplerate=44100;
-//  sh->sample_format=AFMT_S16_LE;
-  sh->i_bps=64000/8;
   
   return 1; // return values: 1=OK 0=ERROR
 }




More information about the MPlayer-cvslog mailing list