Commit bb94e7b5 authored by David Fuhrmann's avatar David Fuhrmann

auhal: quick fix to get stuff compiled again

TODO:
- somehow implement mute callback
- initially report right volume to ui
parent 35e5155a
...@@ -120,7 +120,8 @@ static OSStatus StreamListener ( AudioObjectID, UInt32, const AudioObje ...@@ -120,7 +120,8 @@ static OSStatus StreamListener ( AudioObjectID, UInt32, const AudioObje
static int AudioDeviceCallback ( vlc_object_t *, const char *, static int AudioDeviceCallback ( vlc_object_t *, const char *,
vlc_value_t, vlc_value_t, void * ); vlc_value_t, vlc_value_t, void * );
static int VolumeSet ( audio_output_t *, float, bool ); static int VolumeSet ( audio_output_t *, float );
static int MuteSet ( audio_output_t *, bool );
/***************************************************************************** /*****************************************************************************
...@@ -560,7 +561,8 @@ static int OpenAnalog( audio_output_t *p_aout ) ...@@ -560,7 +561,8 @@ static int OpenAnalog( audio_output_t *p_aout )
/* Do the last VLC aout setups */ /* Do the last VLC aout setups */
aout_FormatPrepare( &p_aout->format ); aout_FormatPrepare( &p_aout->format );
aout_PacketInit( p_aout, &p_sys->packet, FRAMESIZE ); aout_PacketInit( p_aout, &p_sys->packet, FRAMESIZE );
aout_VolumeHardInit( p_aout, VolumeSet, true ); p_aout->volume_set = VolumeSet;
p_aout->mute_set = MuteSet;
/* set the IOproc callback */ /* set the IOproc callback */
input.inputProc = (AURenderCallback) RenderCallbackAnalog; input.inputProc = (AURenderCallback) RenderCallbackAnalog;
...@@ -1456,15 +1458,14 @@ static int AudioDeviceCallback( vlc_object_t *p_this, const char *psz_variable, ...@@ -1456,15 +1458,14 @@ static int AudioDeviceCallback( vlc_object_t *p_this, const char *psz_variable,
/***************************************************************************** /*****************************************************************************
* VolumeSet: Implements pf_volume_set(). Update the CoreAudio AU volume immediately. * VolumeSet: Implements pf_volume_set(). Update the CoreAudio AU volume immediately.
*****************************************************************************/ *****************************************************************************/
static int VolumeSet( audio_output_t * p_aout, float volume, bool mute ) static int VolumeSet( audio_output_t * p_aout, float volume )
{ {
struct aout_sys_t *p_sys = p_aout->sys; struct aout_sys_t *p_sys = p_aout->sys;
OSStatus ostatus; OSStatus ostatus;
aout_VolumeReport( p_aout, volume );
if( mute ) volume = volume * volume * volume; // cubic mapping from output.c
volume = 0.0;
else
volume = volume * volume * volume; // cubic mapping from output.c
/* Set volume for output unit */ /* Set volume for output unit */
ostatus = AudioUnitSetParameter( p_sys->au_unit, ostatus = AudioUnitSetParameter( p_sys->au_unit,
...@@ -1476,3 +1477,10 @@ static int VolumeSet( audio_output_t * p_aout, float volume, bool mute ) ...@@ -1476,3 +1477,10 @@ static int VolumeSet( audio_output_t * p_aout, float volume, bool mute )
return ostatus; return ostatus;
} }
static int MuteSet( audio_output_t * p_aout, bool mute )
{
aout_MuteReport( p_aout, mute );
return 0;
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment