[MPlayer-dev-eng] [PATCH] Volume control for ao_macosx

Dan Christiansen danchr at daimi.au.dk
Fri Jun 6 14:24:44 CEST 2003


Anders Johansson wrote:
> Hi Dan,
> 
> What is wrong with downsampling of float (it works fine on PC).

Coming to think of it, it's not downsampling, but upsampling that 
doesn't seem to work. I was given a 22kHz movie by someone else, and the 
sound was very skippy when I played it with my ao, but it worked fine 
with SDL. 48kHz works fine with both. FYI my mac sports a 44.1kHz sound 
card.

> Is MAC big or little endian?

It's a big endian PowerPC machine.

> Is there a native volume control on MAC?

The CoreAudio API consists of two layers: The Hardware Abstraction Layer 
(aka HAL) and the AudioUnits API. The HAL, which is what I use 
currently, does not provide any services other than setting up callbacks 
for reading to and writing from audio devices and functions for altering 
their settings. AudioUnits, which is what I should be using, allows 
conversion and resampling of sound and probably volume control too.

Basically, any options I change in the HAL - sampling rate, stereo, 
volume, etc. - will be set in the audio hardware, and will alter the 
output of other applications too.

BTW, it's Mac, not MAC ;)

> 
> //Anders 
 >
>>Attached is a patch to add support for volume control to ao_macosx. A 
>>patch largely similar to this one was rejected, but I ask you to 
>>reconsider it.
>>
>>It was rejected on the grounds that I had reused some code from the 
>>volume control plugin. The amount of code reused is in the order of a 
>>few lines (where I removed everything not strictly necessary), and 
>>since I use the lowest possible layers in CoreAudio, the only way of 
>>having it control volume would be to set the system wide volume, and 
>>that's not an option.
>>
>>Please apply this patch, I believe it's the only proper way to add 
>>volume control to ao_macosx (in it's current incarnation) that doesn't 
>>require a large amount of changes to the MPlayer core. If it were to be 
>>handled by CoreAudio, it would require a total rewrite of the output 
>>module to use higher level APIs - I plan to do that some time - but 
>>until then, this is a fair compromise.
>>
>>- Dan
>>
> 
> 
> 
>>_______________________________________________
>>MPlayer-dev-eng mailing list
>>MPlayer-dev-eng at mplayerhq.hu
>>http://mplayerhq.hu/mailman/listinfo/mplayer-dev-eng
> 
> 
> 




More information about the MPlayer-dev-eng mailing list