openbsd-ports/audio/xmms/patches/patch-Output_sun_configure_c
naddy 50c4543def - fix a buffer overflow that garbled the status display of the XMMS sun
audio plugin while playing; use proper unsigned types while there
- sync the gcc workaround patch with the new automake output
2007-12-30 20:23:15 +00:00

48 lines
1.6 KiB
Plaintext

$OpenBSD: patch-Output_sun_configure_c,v 1.4 2007/12/30 20:23:15 naddy Exp $
--- Output/sun/configure.c.orig Sun May 15 02:01:20 2005
+++ Output/sun/configure.c Mon Dec 10 21:08:39 2007
@@ -404,7 +404,7 @@ static void configure_stats_loop(void)
audio_info_t info;
int wseek;
int rerror;
- char sl[32];
+ char sl[128];
pthread_mutex_lock(&stats_frame.audioctl_mutex);
@@ -415,17 +415,18 @@ static void configure_stats_loop(void)
char s[128];
sprintf(s, "Currently %s",
- (info.mode == AUMODE_PLAY) ? "playing" :
- (info.mode == AUMODE_RECORD) ? "recording" :
- (info.mode == AUMODE_PLAY_ALL) ? "playing" :
- "not playing");
+ ((info.play.active == 1) &&
+ (info.record.active == 1)) ? "playing and recording" :
+ (info.record.active == 1) ? "recording" :
+ (info.play.active == 1) ? "playing" :
+ "not playing or recording");
- if (info.mode == AUMODE_PLAY)
+ if (info.mode & AUMODE_PLAY)
{
- sprintf(s, "%s at %i Hz (%i-bit %s)", s,
+ sprintf(s, "%s at %u Hz (%u-bit %s)", s,
info.play.sample_rate, info.play.precision,
audio.output->name);
- sprintf(sl,"%i samples, %i error(s). %s",
+ sprintf(sl,"%u samples, %u error(s). %s",
info.play.samples, info.play.error,
info.play.active ?
"I/O in progress." : "");
@@ -433,7 +434,7 @@ static void configure_stats_loop(void)
gtk_label_set_text(GTK_LABEL(stats_frame.mode_label),
s);
- sprintf(s, "H/W block: %i bytes. Buffer: %i bytes",
+ sprintf(s, "H/W block: %u bytes. Buffer: %u bytes",
info.blocksize, info.play.buffer_size);
gtk_label_set_text(
GTK_LABEL(stats_frame.blocksize_label), s);