diff options
Diffstat (limited to 'sound/usb/caiaq/audio.c')
-rw-r--r-- | sound/usb/caiaq/audio.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/sound/usb/caiaq/audio.c b/sound/usb/caiaq/audio.c index 121af0644fd9..e76017cd5acf 100644 --- a/sound/usb/caiaq/audio.c +++ b/sound/usb/caiaq/audio.c | |||
@@ -269,16 +269,22 @@ snd_usb_caiaq_pcm_pointer(struct snd_pcm_substream *sub) | |||
269 | { | 269 | { |
270 | int index = sub->number; | 270 | int index = sub->number; |
271 | struct snd_usb_caiaqdev *dev = snd_pcm_substream_chip(sub); | 271 | struct snd_usb_caiaqdev *dev = snd_pcm_substream_chip(sub); |
272 | snd_pcm_uframes_t ptr; | ||
273 | |||
274 | spin_lock(&dev->spinlock); | ||
272 | 275 | ||
273 | if (dev->input_panic || dev->output_panic) | 276 | if (dev->input_panic || dev->output_panic) |
274 | return SNDRV_PCM_POS_XRUN; | 277 | ptr = SNDRV_PCM_POS_XRUN; |
275 | 278 | ||
276 | if (sub->stream == SNDRV_PCM_STREAM_PLAYBACK) | 279 | if (sub->stream == SNDRV_PCM_STREAM_PLAYBACK) |
277 | return bytes_to_frames(sub->runtime, | 280 | ptr = bytes_to_frames(sub->runtime, |
278 | dev->audio_out_buf_pos[index]); | 281 | dev->audio_out_buf_pos[index]); |
279 | else | 282 | else |
280 | return bytes_to_frames(sub->runtime, | 283 | ptr = bytes_to_frames(sub->runtime, |
281 | dev->audio_in_buf_pos[index]); | 284 | dev->audio_in_buf_pos[index]); |
285 | |||
286 | spin_unlock(&dev->spinlock); | ||
287 | return ptr; | ||
282 | } | 288 | } |
283 | 289 | ||
284 | /* operators for both playback and capture */ | 290 | /* operators for both playback and capture */ |