X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;ds=sidebyside;f=src%2Flibgame%2Fsound.c;h=ff42562a19da8ce3249efbfaea7ab9ab6fe3807d;hb=c91aa2b237bef6003ead8dfc98cdcab89f97c654;hp=0d7ed67cf8255c8fdd3cd5ac8aafb399097bfe44;hpb=80aa0e4b2b060112407417a9d2896395023a21cc;p=rocksndiamonds.git diff --git a/src/libgame/sound.c b/src/libgame/sound.c index 0d7ed67c..ff42562a 100644 --- a/src/libgame/sound.c +++ b/src/libgame/sound.c @@ -19,6 +19,7 @@ #include #include #include +#include #include "platform.h" @@ -1152,7 +1153,7 @@ static void Mixer_Main_DSP() for (i = 0; i < audio.num_channels; i++) { - void *sample_ptr; + // void *sample_ptr; 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 */ - 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); @@ -1265,7 +1266,8 @@ static void Mixer_Main_DSP() } /* 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);