aboutsummaryrefslogtreecommitdiffstats
path: root/sound/core/pcm_lib.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/core/pcm_lib.c')
-rw-r--r--sound/core/pcm_lib.c15
1 files changed, 3 insertions, 12 deletions
diff --git a/sound/core/pcm_lib.c b/sound/core/pcm_lib.c
index f4a19509cccf..44b5ae833082 100644
--- a/sound/core/pcm_lib.c
+++ b/sound/core/pcm_lib.c
@@ -191,10 +191,7 @@ int snd_pcm_update_state(struct snd_pcm_substream *substream,
191{ 191{
192 snd_pcm_uframes_t avail; 192 snd_pcm_uframes_t avail;
193 193
194 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) 194 avail = snd_pcm_avail(substream);
195 avail = snd_pcm_playback_avail(runtime);
196 else
197 avail = snd_pcm_capture_avail(runtime);
198 if (avail > runtime->avail_max) 195 if (avail > runtime->avail_max)
199 runtime->avail_max = avail; 196 runtime->avail_max = avail;
200 if (runtime->status->state == SNDRV_PCM_STATE_DRAINING) { 197 if (runtime->status->state == SNDRV_PCM_STATE_DRAINING) {
@@ -1856,10 +1853,7 @@ static int wait_for_avail(struct snd_pcm_substream *substream,
1856 * This check must happen after been added to the waitqueue 1853 * This check must happen after been added to the waitqueue
1857 * and having current state be INTERRUPTIBLE. 1854 * and having current state be INTERRUPTIBLE.
1858 */ 1855 */
1859 if (is_playback) 1856 avail = snd_pcm_avail(substream);
1860 avail = snd_pcm_playback_avail(runtime);
1861 else
1862 avail = snd_pcm_capture_avail(runtime);
1863 if (avail >= runtime->twake) 1857 if (avail >= runtime->twake)
1864 break; 1858 break;
1865 snd_pcm_stream_unlock_irq(substream); 1859 snd_pcm_stream_unlock_irq(substream);
@@ -2175,10 +2169,7 @@ snd_pcm_sframes_t __snd_pcm_lib_xfer(struct snd_pcm_substream *substream,
2175 runtime->twake = runtime->control->avail_min ? : 1; 2169 runtime->twake = runtime->control->avail_min ? : 1;
2176 if (runtime->status->state == SNDRV_PCM_STATE_RUNNING) 2170 if (runtime->status->state == SNDRV_PCM_STATE_RUNNING)
2177 snd_pcm_update_hw_ptr(substream); 2171 snd_pcm_update_hw_ptr(substream);
2178 if (is_playback) 2172 avail = snd_pcm_avail(substream);
2179 avail = snd_pcm_playback_avail(runtime);
2180 else
2181 avail = snd_pcm_capture_avail(runtime);
2182 while (size > 0) { 2173 while (size > 0) {
2183 snd_pcm_uframes_t frames, appl_ptr, appl_ofs; 2174 snd_pcm_uframes_t frames, appl_ptr, appl_ofs;
2184 snd_pcm_uframes_t cont; 2175 snd_pcm_uframes_t cont;