summaryrefslogtreecommitdiffstats
path: root/libao2
diff options
context:
space:
mode:
Diffstat (limited to 'libao2')
-rw-r--r--libao2/ao_oss.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/libao2/ao_oss.c b/libao2/ao_oss.c
index 35fcfd6e6c..b9939de8b7 100644
--- a/libao2/ao_oss.c
+++ b/libao2/ao_oss.c
@@ -147,6 +147,7 @@ static int oss2format(int format)
static char *dsp=PATH_DEV_DSP;
static audio_buf_info zz;
static int audio_fd=-1;
+static int prepause_space;
static const char *oss_mixer_device = PATH_DEV_MIXER;
static int oss_mixer_channel = SOUND_MIXER_PCM;
@@ -448,13 +449,21 @@ static void reset(void){
// stop playing, keep buffers (for pause)
static void audio_pause(void)
{
+ prepause_space = get_space();
uninit(1);
}
// resume playing, after audio_pause()
static void audio_resume(void)
{
+ int fillcnt;
reset();
+ fillcnt = get_space() - prepause_space;
+ if (fillcnt > 0) {
+ void *silence = calloc(fillcnt, 1);
+ play(silence, fillcnt, 0);
+ free(silence);
+ }
}