summaryrefslogtreecommitdiffstats
path: root/libao2/ao_mpegpes.c
diff options
context:
space:
mode:
authoranders <anders@b3059339-0415-0410-9bf9-f77b7e298cf2>2002-02-21 16:02:26 +0000
committeranders <anders@b3059339-0415-0410-9bf9-f77b7e298cf2>2002-02-21 16:02:26 +0000
commitee2ed8567e3401469fcf13eb96e42d79c4b32714 (patch)
tree90bb902bb5f99813bba6b2bd07ff6620a0d39e0a /libao2/ao_mpegpes.c
parentea1d75800931055c8a04cf76e8b6c914c2ed3e23 (diff)
downloadmpv-ee2ed8567e3401469fcf13eb96e42d79c4b32714.tar.bz2
mpv-ee2ed8567e3401469fcf13eb96e42d79c4b32714.tar.xz
Moved HW dependent mixer stuff to libao and removed master switch
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@4789 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libao2/ao_mpegpes.c')
-rw-r--r--libao2/ao_mpegpes.c34
1 files changed, 33 insertions, 1 deletions
diff --git a/libao2/ao_mpegpes.c b/libao2/ao_mpegpes.c
index 891a398b52..1ddf1dd042 100644
--- a/libao2/ao_mpegpes.c
+++ b/libao2/ao_mpegpes.c
@@ -1,11 +1,16 @@
#include <stdio.h>
#include <stdlib.h>
+#include <sys/ioctl.h>
#include "audio_out.h"
#include "audio_out_internal.h"
#include "afmt.h"
+audioMixer_t dvb_mixer={255,255};
+extern int vo_mpegpes_fd;
+extern int vo_mpegpes_fd2;
+
static ao_info_t info =
{
"mpeg-pes audio output",
@@ -19,7 +24,34 @@ LIBAO_EXTERN(mpegpes)
// to set/get/query special features/parameters
static int control(int cmd,int arg){
- return -1;
+ switch(cmd){
+ case AOCONTROL_GET_VOLUME:
+ {
+ if(vo_mpegpes_fd2>=0){
+ ((ao_control_vol_t*)(arg))->left=dvb_mixer.volume_left/2.56;
+ ((ao_control_vol_t*)(arg))->right=dvb_mixer.volume_right/2.56;
+ return CONTROL_OK;
+ }
+ return CONTROL_ERROR;
+ }
+ case AOCONTROL_SET_VOLUME:
+ {
+ if(vo_mpegpes_fd2>=0){
+ dvb_mixer.volume_left=((ao_control_vol_t)(arg)).left*2.56;
+ dvb_mixer.volume_right=((ao_control_vol_t)(arg)).right*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 CONTROL_ERROR;
+ }
+ return CONTROL_OK;
+ }
+ return CONTROL_ERROR;
+ }
+ }
+ return CONTROL_UNKNOWN;
}
static int freq=0;