[Mplayer-cvslog] CVS: main mixer.c,1.9,1.10

Arpi of Ize arpi at mplayer.dev.hu
Sun Feb 17 21:43:27 CET 2002


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

Modified Files:
	mixer.c 
Log Message:
DVB mixer control added (very big messy hack)

Index: mixer.c
===================================================================
RCS file: /cvsroot/mplayer/main/mixer.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- mixer.c	11 Sep 2001 16:26:41 -0000	1.9
+++ mixer.c	17 Feb 2002 20:43:24 -0000	1.10
@@ -8,6 +8,12 @@
 #include "config.h"
 #include "mixer.h"
 
+#ifdef HAVE_DVB
+#include <ost/audio.h>
+audioMixer_t dvb_mixer={255,255};
+extern int vo_mpegpes_fd;
+extern int vo_mpegpes_fd2;
+#endif
 
 #if	defined(USE_OSS_AUDIO)
 
@@ -25,6 +31,15 @@
 {
  int fd,v,cmd,devs;
 
+#ifdef HAVE_DVB
+ if(vo_mpegpes_fd2>=0){
+     // DVB card
+     *l=dvb_mixer.volume_left/2.56;
+     *r=dvb_mixer.volume_right/2.56;
+     return;
+ }
+#endif 
+
  fd=open( mixer_device,O_RDONLY );
  if ( fd != -1 )
   {
@@ -47,6 +62,22 @@
 void mixer_setvolume( float l,float r )
 {
  int fd,v,cmd,devs;
+ 
+#ifdef HAVE_DVB
+ if(vo_mpegpes_fd2>=0){
+     // DVB card
+	 dvb_mixer.volume_left=l*2.56;
+	 dvb_mixer.volume_right=r*2.56;
+	 if(dvb_mixer.volume_left>255) dvb_mixer.volume_left=255;
+	 if(dvb_mixer.volume_right>255) dvb_mixer.volume_right=255;
+//	 printf("Setting DVB volume: %d ; %d  \n",dvb_mixer.volume_left,dvb_mixer.volume_right);
+	if ( (ioctl(vo_mpegpes_fd2,AUDIO_SET_MIXER, &dvb_mixer) < 0)){
+		perror("DVB AUDIO SET MIXER: ");
+		return -1;
+	}
+	return;
+ }
+#endif
 
  fd=open( mixer_device,O_RDONLY );
  if ( fd != -1 )




More information about the MPlayer-cvslog mailing list