From c45b306f6f48164b6328eb715ccc4d87a455b295 Mon Sep 17 00:00:00 2001 From: Jaroslav Kysela Date: Thu, 25 Sep 2003 19:17:33 +0200 Subject: [PATCH] ALSA CVS update D:2003/09/08 08:14:17 C:ALSA<-OSS emulation A:Jaroslav Kysela F:core/oss/pcm_oss.c:1.47->1.48 L:Added handling for -EPIPE and -ESTRPIPE error codes in get_ptr and get_space L:functions. --- sound/core/oss/pcm_oss.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/sound/core/oss/pcm_oss.c b/sound/core/oss/pcm_oss.c index 0d572b7ba328e..32ed134d15a8c 100644 --- a/sound/core/oss/pcm_oss.c +++ b/sound/core/oss/pcm_oss.c @@ -1394,6 +1394,10 @@ static int snd_pcm_oss_get_ptr(snd_pcm_oss_file_t *pcm_oss_file, int stream, str } if (stream == SNDRV_PCM_STREAM_PLAYBACK) { err = snd_pcm_kernel_ioctl(substream, SNDRV_PCM_IOCTL_DELAY, &delay); + if (err == -EPIPE || err == -ESTRPIPE) { + err = 0; + delay = 0; + } } else { err = snd_pcm_oss_capture_position_fixup(substream, &delay); } @@ -1454,7 +1458,12 @@ static int snd_pcm_oss_get_space(snd_pcm_oss_file_t *pcm_oss_file, int stream, s } else { if (stream == SNDRV_PCM_STREAM_PLAYBACK) { err = snd_pcm_kernel_ioctl(substream, SNDRV_PCM_IOCTL_DELAY, &avail); - avail = runtime->buffer_size - avail; + if (err == -EPIPE || err == -ESTRPIPE) { + avail = runtime->buffer_size; + err = 0; + } else { + avail = runtime->buffer_size - avail; + } } else { err = snd_pcm_oss_capture_position_fixup(substream, &avail); } -- 2.53.0