projects
/
rocksndiamonds.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
rocksndiamonds-3.3.1.0
[rocksndiamonds.git]
/
src
/
libgame
/
sound.c
diff --git
a/src/libgame/sound.c
b/src/libgame/sound.c
index 0d7ed67cf8255c8fdd3cd5ac8aafb399097bfe44..ff42562a19da8ce3249efbfaea7ab9ab6fe3807d 100644
(file)
--- a/
src/libgame/sound.c
+++ b/
src/libgame/sound.c
@@
-19,6
+19,7
@@
#include <dirent.h>
#include <signal.h>
#include <math.h>
#include <dirent.h>
#include <signal.h>
#include <math.h>
+#include <errno.h>
#include "platform.h"
#include "platform.h"
@@
-1152,7
+1153,7
@@
static void Mixer_Main_DSP()
for (i = 0; i < audio.num_channels; i++)
{
for (i = 0; i < audio.num_channels; i++)
{
- void *sample_ptr;
+
//
void *sample_ptr;
int sample_len;
int sample_pos;
int sample_size;
int sample_len;
int sample_pos;
int sample_size;
@@
-1167,7
+1168,7
@@
static void Mixer_Main_DSP()
}
/* pointer, lenght and actual playing position of sound sample */
}
/* pointer, lenght and actual playing position of sound sample */
- sample_ptr = mixer[i].data_ptr;
+
//
sample_ptr = mixer[i].data_ptr;
sample_len = mixer[i].data_len;
sample_pos = mixer[i].playing_pos;
sample_size = MIN(max_sample_size, sample_len - sample_pos);
sample_len = mixer[i].data_len;
sample_pos = mixer[i].playing_pos;
sample_size = MIN(max_sample_size, sample_len - sample_pos);
@@
-1265,7
+1266,8
@@
static void Mixer_Main_DSP()
}
/* finally play the sound fragment */
}
/* finally play the sound fragment */
- write(audio.device_fd, playing_buffer, fragment_size);
+ if (write(audio.device_fd, playing_buffer, fragment_size) == -1)
+ Error(ERR_WARN, "write() failed; %s", strerror(errno));
if (!mixer_active_channels)
CloseAudioDevice(&audio.device_fd);
if (!mixer_active_channels)
CloseAudioDevice(&audio.device_fd);