Skip to content

Commit

Permalink
ALSA: vx: Don't try to update capture stream before running
Browse files Browse the repository at this point in the history
The update of stream costs significantly, and we should avoid it
unless the stream really has started.  Check pipe->running flag
instead of pipe->prepared.

Signed-off-by: Takashi Iwai <[email protected]>
  • Loading branch information
tiwai committed Jan 4, 2017
1 parent 874e1f6 commit ed3c177
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sound/drivers/vx/vx_pcm.c
Original file line number Diff line number Diff line change
Expand Up @@ -1015,7 +1015,7 @@ static void vx_pcm_capture_update(struct vx_core *chip, struct snd_pcm_substream
int size, space, count;
struct snd_pcm_runtime *runtime = subs->runtime;

if (! pipe->prepared || (chip->chip_status & VX_STAT_IS_STALE))
if (!pipe->running || (chip->chip_status & VX_STAT_IS_STALE))
return;

size = runtime->buffer_size - snd_pcm_capture_avail(runtime);
Expand Down

0 comments on commit ed3c177

Please sign in to comment.