diff options
Diffstat (limited to 'sound/core/pcm_lib.c')
| -rw-r--r-- | sound/core/pcm_lib.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/sound/core/pcm_lib.c b/sound/core/pcm_lib.c index 40013b26f671..6c99fa8ac5fa 100644 --- a/sound/core/pcm_lib.c +++ b/sound/core/pcm_lib.c | |||
| @@ -2112,6 +2112,13 @@ int pcm_lib_apply_appl_ptr(struct snd_pcm_substream *substream, | |||
| 2112 | return 0; | 2112 | return 0; |
| 2113 | } | 2113 | } |
| 2114 | 2114 | ||
| 2115 | /* allow waiting for a capture stream that hasn't been started */ | ||
| 2116 | #if IS_ENABLED(CONFIG_SND_PCM_OSS) | ||
| 2117 | #define wait_capture_start(substream) ((substream)->oss.oss) | ||
| 2118 | #else | ||
| 2119 | #define wait_capture_start(substream) false | ||
| 2120 | #endif | ||
| 2121 | |||
| 2115 | /* the common loop for read/write data */ | 2122 | /* the common loop for read/write data */ |
| 2116 | snd_pcm_sframes_t __snd_pcm_lib_xfer(struct snd_pcm_substream *substream, | 2123 | snd_pcm_sframes_t __snd_pcm_lib_xfer(struct snd_pcm_substream *substream, |
| 2117 | void *data, bool interleaved, | 2124 | void *data, bool interleaved, |
| @@ -2182,7 +2189,7 @@ snd_pcm_sframes_t __snd_pcm_lib_xfer(struct snd_pcm_substream *substream, | |||
| 2182 | err = snd_pcm_start(substream); | 2189 | err = snd_pcm_start(substream); |
| 2183 | if (err < 0) | 2190 | if (err < 0) |
| 2184 | goto _end_unlock; | 2191 | goto _end_unlock; |
| 2185 | } else { | 2192 | } else if (!wait_capture_start(substream)) { |
| 2186 | /* nothing to do */ | 2193 | /* nothing to do */ |
| 2187 | err = 0; | 2194 | err = 0; |
| 2188 | goto _end_unlock; | 2195 | goto _end_unlock; |
