aboutsummaryrefslogtreecommitdiff
path: root/plugins/dfsound/oss.c
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/dfsound/oss.c')
-rw-r--r--plugins/dfsound/oss.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/plugins/dfsound/oss.c b/plugins/dfsound/oss.c
index 709cb37..8093ae4 100644
--- a/plugins/dfsound/oss.c
+++ b/plugins/dfsound/oss.c
@@ -16,6 +16,7 @@
***************************************************************************/
#include <stdio.h>
+#include <string.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
@@ -153,7 +154,20 @@ static int oss_busy(void)
static void oss_feed(void *buf, int bytes)
{
+ audio_buf_info info;
+ char sbuf[4096];
+
if(oss_audio_fd == -1) return;
+ if(ioctl(oss_audio_fd,SNDCTL_DSP_GETOSPACE,&info)==0)
+ {
+ if(info.fragments==info.fragstotal)
+ {
+ memset(sbuf, 0, sizeof(sbuf));
+ write(oss_audio_fd, sbuf, sizeof(sbuf));
+ write(oss_audio_fd, sbuf, sizeof(sbuf));
+ }
+ }
+
write(oss_audio_fd, buf, bytes);
}