]> git.neil.brown.name Git - history.git/commitdiff
ALSA CVS update
authorJaroslav Kysela <perex@suse.cz>
Thu, 25 Sep 2003 17:17:33 +0000 (19:17 +0200)
committerJaroslav Kysela <perex@suse.cz>
Thu, 25 Sep 2003 17:17:33 +0000 (19:17 +0200)
D:2003/09/08 08:14:17
C:ALSA<-OSS emulation
A:Jaroslav Kysela <perex@suse.cz>
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

index 0d572b7ba328eb5bcf39bb50f5fd83509b8b4240..32ed134d15a8ca7ae56189b1d414f5dd83b2b984 100644 (file)
@@ -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);
                }