openbsd-ports/audio/xmms/patches/patch-Output_sun_audio_c
robert af56f3fa6c open the audio device with the O_WRONLY flag instead of O_RDWR so
it should work with uaudio(4) too; from Urs Breinlinger <urs@mailq.de>

fix the LIB_DEPENDS line of the -mp3 subpackage;
2005-04-27 16:31:34 +00:00

76 lines
2.1 KiB
Plaintext

$OpenBSD: patch-Output_sun_audio_c,v 1.5 2005/04/27 16:31:34 robert Exp $
--- Output/sun/audio.c.orig Sun Jun 2 15:42:03 2002
+++ Output/sun/audio.c Wed Apr 27 18:13:18 2005
@@ -123,14 +123,12 @@
sun = sun_format(fmt);
- effect.format.sun = sun;
effect.format.xmms = fmt;
effect.frequency = rate;
effect.channels = nch;
effect.bps = sun_bps(sun, rate, nch);
output.format.sun = sun;
- output.format.xmms = fmt;
output.frequency = rate;
output.channels = nch;
sun_setparams();
@@ -153,7 +151,7 @@
info.mode = AUMODE_PLAY;
if (ioctl(audio.fd, AUDIO_SETINFO, &info) != 0)
{
- g_error("%s: cannot play (%s)", audio.devaudio,
+ g_warning("%s: cannot play (%s)", audio.devaudio,
strerror(errno));
return;
}
@@ -171,7 +169,7 @@
strcpy(output.name, enc.name);
if (ioctl(audio.fd, AUDIO_SETINFO, &info) != 0)
{
- g_error("%s: unsupported encoding: %s (%s)", audio.devaudio,
+ g_warning("%s: unsupported encoding: %s (%s)", audio.devaudio,
output.name, strerror(errno));
return;
}
@@ -182,7 +180,7 @@
info.play.sample_rate = output.frequency;
if (ioctl(audio.fd, AUDIO_SETINFO, &info) < 0)
{
- g_error("%s: cannot handle %i Hz (%s)", audio.devaudio,
+ g_warning("%s: cannot handle %i Hz (%s)", audio.devaudio,
output.frequency, strerror(errno));
return;
}
@@ -328,7 +326,7 @@
output_time_offset += (output_bytes * 1000) / output.bps;
output_bytes = 0;
close(audio.fd);
- audio.fd = open(audio.devaudio, O_RDWR);
+ audio.fd = open(audio.devaudio, O_WRONLY);
sun_setformat(new_format, new_frequency, new_channels);
}
if (effects_enabled() && ep && ep->mod_samples)
@@ -518,7 +516,7 @@
{
audio.unpause = FALSE;
close(audio.fd);
- audio.fd = open(audio.devaudio, O_RDWR);
+ audio.fd = open(audio.devaudio, O_WRONLY);
sun_setparams();
audio.paused = FALSE;
}
@@ -535,9 +533,9 @@
AUDIO_INITINFO(&info);
- if ((audio.fd = open(audio.devaudio, O_RDWR)) < 0)
+ if ((audio.fd = open(audio.devaudio, O_WRONLY)) < 0)
{
- g_error("%s: %s", audio.devaudio, strerror(errno));
+ g_warning("%s: %s", audio.devaudio, strerror(errno));
return 0;
}