openbsd-ports/audio/xmms/patches/patch-Output_sun_audio_c
ajacoutot 6b2cbddde1 - update to xmms-1.2.11
input from naddy@, help and ok jakemsr@
2007-12-08 21:54:57 +00:00

80 lines
2.4 KiB
Plaintext

$OpenBSD: patch-Output_sun_audio_c,v 1.6 2007/12/08 21:54:57 ajacoutot Exp $
--- Output/sun/audio.c.orig Sun Jun 2 15:42:03 2002
+++ Output/sun/audio.c Fri Nov 23 18:38:44 2007
@@ -123,14 +123,12 @@ static void sun_setformat(AFormat fmt, int rate, int n
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();
@@ -150,10 +148,10 @@ void sun_setparams(void)
AUDIO_INITINFO(&info);
- info.mode = AUMODE_PLAY;
+ info.mode = AUMODE_PLAY_ALL;
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 @@ void sun_setparams(void)
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 @@ void sun_setparams(void)
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 @@ static inline void sun_write_audio(gpointer data, int
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 @@ static void* sun_loop(void *arg)
{
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 @@ int sun_open(AFormat fmt, int rate, int nch)
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;
}