--- freevo-1.5.3-CVS/src/plugins/mixer.py	2005-06-11 13:10:15.000000000 +0200
+++ freevo-1.5.3/src/plugins/mixer.py.onlyp	2005-06-11 13:13:58.000000000 +0200
@@ -47,6 +47,8 @@
 import struct
 import os
 
+def i32(x): return (x&0x80000000L and -2*0x40000000 or 0) + int(x&0x7fffffff)
+
 import config
 import rc
 import plugin
@@ -90,7 +92,7 @@
             if self.mixfd:
                 data = struct.pack( 'L', self.SOUND_MASK_LINE )
                 try:
-                    fcntl.ioctl( self.mixfd.fileno(), self.SOUND_MIXER_WRITE_RECSRC, data )
+                    fcntl.ioctl( self.mixfd.fileno(), i32(self.SOUND_MIXER_WRITE_RECSRC), data )
                 except IOError:
                     _debug_('IOError for ioctl')
                     pass
@@ -161,7 +163,7 @@
             vol = (volume << 8) | (volume)
             data = struct.pack('L', vol)
             try:
-                fcntl.ioctl(self.mixfd.fileno(), device, data)
+                fcntl.ioctl(self.mixfd.fileno(), i32(device), data)
             except IOError:
                 _debug_('IOError for ioctl')
                 pass
