Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 5740 Details for
Bug 10857
XMMS-arts volumesetting problems.
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
A patch to fix various volume setting issues of the xmms-arts plugin.
xmms-arts-0.4-volume_fix-gentoo.diff (text/plain), 2.32 KB, created by
Ulrik Mikaelsson
on 2002-11-16 21:42:18 UTC
(
hide
)
Description:
A patch to fix various volume setting issues of the xmms-arts plugin.
Filename:
MIME Type:
Creator:
Ulrik Mikaelsson
Created:
2002-11-16 21:42:18 UTC
Size:
2.32 KB
patch
obsolete
>diff -Naur /var/tmp/portage/xmms-arts-0.4-r6/work/xmms-arts-0.4/audio.c xmms-arts-0.4/audio.c >--- /var/tmp/portage/xmms-arts-0.4-r6/work/xmms-arts-0.4/audio.c 2002-11-17 03:56:17.000000000 +0100 >+++ xmms-arts-0.4/audio.c 2002-11-17 03:57:13.000000000 +0100 >@@ -211,12 +211,17 @@ > } > } > >+float artsd_get_internal_volume(); >+ > static void artsd_write_audio(gpointer data,gint length) > { > int errorcode; > AFormat new_format; > gint new_frequency,new_channels; > EffectPlugin *ep; >+ short *samples = (short*)data; >+ gint i; >+ float volume = artsd_get_internal_volume(); > > new_format = input_format; > new_frequency = input_frequency; >@@ -242,6 +247,9 @@ > if(effects_enabled() && ep && ep->mod_samples) > length = ep->mod_samples(&data,length, input_format, input_frequency, input_channels); > >+ for (i = 0; i < (length / 2); i++) >+ samples[i] *= volume; >+ > errorcode = arts_write(stream,artsd_translate(data,length),length); > if(errorcode < 0) > fprintf(stderr,"arts_write error: %s\n",arts_error_text(errorcode)); >diff -Naur /var/tmp/portage/xmms-arts-0.4-r6/work/xmms-arts-0.4/mixer.c xmms-arts-0.4/mixer.c >--- /var/tmp/portage/xmms-arts-0.4-r6/work/xmms-arts-0.4/mixer.c 2000-09-01 14:43:45.000000000 +0200 >+++ xmms-arts-0.4/mixer.c 2002-11-17 03:47:08.000000000 +0100 >@@ -25,49 +25,19 @@ > #include <sys/ioctl.h> > #include <sys/soundcard.h> > >+static float volume = 1.0; >+ > void artsd_get_volume(int *l, int *r) > { >- int fd, v, cmd, devs; >- fd = open("/dev/mixer", O_RDONLY); >- if (fd != -1) >- { >- ioctl(fd, SOUND_MIXER_READ_DEVMASK, &devs); >- if (devs & SOUND_MASK_PCM) >- cmd = SOUND_MIXER_READ_PCM; >- else if (devs & SOUND_MASK_VOLUME) >- cmd = SOUND_MIXER_READ_VOLUME; >- else >- { >- close(fd); >- return; >- } >- ioctl(fd, cmd, &v); >- *r = (v & 0xFF00) >> 8; >- *l = (v & 0x00FF); >- close(fd); >- } >+ *l = *r = volume * 100; > } > > void artsd_set_volume(int l, int r) > { >- int fd, v, cmd, devs; >- >- fd = open("/dev/mixer", O_RDONLY); >+ volume = ((float)l + (float)r) / 200; >+} > >- if (fd != -1) >- { >- ioctl(fd, SOUND_MIXER_READ_DEVMASK, &devs); >- if (devs & SOUND_MASK_PCM) >- cmd = SOUND_MIXER_WRITE_PCM; >- else if (devs & SOUND_MASK_VOLUME) >- cmd = SOUND_MIXER_WRITE_VOLUME; >- else >- { >- close(fd); >- return; >- } >- v = (r << 8) | l; >- ioctl(fd, cmd, &v); >- close(fd); >- } >+float artsd_get_internal_volume() >+{ >+ return volume; > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 10857
:
5740
|
7760
|
7763