diff options
author | Mauro Carvalho Chehab <mchehab@redhat.com> | 2011-06-19 12:39:31 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2011-07-27 16:53:04 -0400 |
commit | dff0f8c279e34089128e9687d77bfc72dbb471bd (patch) | |
tree | 04ba0d2f27da5fe363dc1a0890bfb94219ee638c /drivers/media/video/em28xx | |
parent | debb7241498001a0da10ee01b72f9ec1f9b1edc8 (diff) |
[media] em28xx-audio: Some Alsa API fixes
Mark the alsa stream with SNDRV_PCM_INFO_BATCH,
as the timing to get audio streams can vary.
Also, add SNDRV_PCM_TRIGGER for pause/release.
while here, fix the stop indicator, to be sure that audio
will be properly released at the stop events.
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/em28xx')
-rw-r--r-- | drivers/media/video/em28xx/em28xx-audio.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/media/video/em28xx/em28xx-audio.c b/drivers/media/video/em28xx/em28xx-audio.c index 5381f6d7427d..47f21a382546 100644 --- a/drivers/media/video/em28xx/em28xx-audio.c +++ b/drivers/media/video/em28xx/em28xx-audio.c | |||
@@ -249,6 +249,7 @@ static struct snd_pcm_hardware snd_em28xx_hw_capture = { | |||
249 | .info = SNDRV_PCM_INFO_BLOCK_TRANSFER | | 249 | .info = SNDRV_PCM_INFO_BLOCK_TRANSFER | |
250 | SNDRV_PCM_INFO_MMAP | | 250 | SNDRV_PCM_INFO_MMAP | |
251 | SNDRV_PCM_INFO_INTERLEAVED | | 251 | SNDRV_PCM_INFO_INTERLEAVED | |
252 | SNDRV_PCM_INFO_BATCH | | ||
252 | SNDRV_PCM_INFO_MMAP_VALID, | 253 | SNDRV_PCM_INFO_MMAP_VALID, |
253 | 254 | ||
254 | .formats = SNDRV_PCM_FMTBIT_S16_LE, | 255 | .formats = SNDRV_PCM_FMTBIT_S16_LE, |
@@ -401,11 +402,15 @@ static int snd_em28xx_capture_trigger(struct snd_pcm_substream *substream, | |||
401 | int retval = 0; | 402 | int retval = 0; |
402 | 403 | ||
403 | switch (cmd) { | 404 | switch (cmd) { |
405 | case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: /* fall through */ | ||
406 | case SNDRV_PCM_TRIGGER_RESUME: /* fall through */ | ||
404 | case SNDRV_PCM_TRIGGER_START: | 407 | case SNDRV_PCM_TRIGGER_START: |
405 | atomic_set(&dev->stream_started, 1); | 408 | atomic_set(&dev->stream_started, 1); |
406 | break; | 409 | break; |
410 | case SNDRV_PCM_TRIGGER_PAUSE_PUSH: /* fall through */ | ||
411 | case SNDRV_PCM_TRIGGER_SUSPEND: /* fall through */ | ||
407 | case SNDRV_PCM_TRIGGER_STOP: | 412 | case SNDRV_PCM_TRIGGER_STOP: |
408 | atomic_set(&dev->stream_started, 1); | 413 | atomic_set(&dev->stream_started, 0); |
409 | break; | 414 | break; |
410 | default: | 415 | default: |
411 | retval = -EINVAL; | 416 | retval = -EINVAL; |