[MPlayer-dev-eng] Re: [PATCH] mixer and nas output

Tobias Diedrich td at sim.uni-hannover.de
Fri Mar 14 18:04:13 CET 2003


Kim Nguyen wrote:

> Here is a patch against ao_nas.c.
> It fixes a little memory leak (some AuDeviceAttribute allocated
> at every control() call and not freed).
> It also make the mixer realy work this time (provided you put
> MixerInit "yes" in nasd.conf). Previous version was working for
> me because of LD_PRELOADed libaudiooss.so ....
> This patch can apply on both 0.90 and main since ao_nas.c seems to be the
> same in both version.

|+	/* kn: We want to get/set output gain for both channel, so we have
|+	   to enable modifications of the corresponding fields in the
|+	   AuDeviceAttributes structure.	 
|+	 */
|+	dattr->common.value_mask |= AuCompDeviceGainMask | AuCompDeviceLocationMask;
|+	dattr->common.changable_mask |= AuCompDeviceGainMask | AuCompDeviceLocationMask;

This does not look right, I don't think you are supposed to change those
fields.

|+	dattr->device.location = AuDeviceLocationLeftMask;
|+	gain_left = AuFixedPointRoundDown(AuDeviceGain(dattr));
|+	
|+	dattr->device.location = AuDeviceLocationRightMask;
|+	gain_right = AuFixedPointRoundDown(AuDeviceGain(dattr));

This would always return the same value for left and right gain because
AuDeviceGain is just ((d)->device.gain). (as defined in audiolib.h)

I think NAS simply does not support seperate left and right gain.

Anyway, I fixed the mem leak and left the volume changing code alone.
However from debugging it seems like it works and only the nas server
is to blame if you don't hear a difference...

-- 
Tobias								PGP: 0x9AC7E0BC
This mail is made of 100% recycled bits
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20030314/7cef0aa1/attachment.pgp>


More information about the MPlayer-dev-eng mailing list