diff options
author | Takashi Iwai <tiwai@suse.de> | 2009-06-10 01:26:40 -0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2009-06-10 01:26:40 -0400 |
commit | eabaf0634a9034f2e487b0be347edc1460c026a4 (patch) | |
tree | e950df1ba10e0a29b25afdd446ac44988381a851 /sound/core | |
parent | 9dea75c70965c240012251dc5845fe0c1a061180 (diff) | |
parent | ae1ec5e1e97f67d41e641a73380129e5905e41cc (diff) |
Merge branch 'topic/pcm-delay' into for-linus
* topic/pcm-delay:
ALSA: usbaudio - Add delay account
ALSA: Add extra delay count in PCM
Diffstat (limited to 'sound/core')
-rw-r--r-- | sound/core/pcm_native.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/sound/core/pcm_native.c b/sound/core/pcm_native.c index b5da656d1ec..45dc53fcfa2 100644 --- a/sound/core/pcm_native.c +++ b/sound/core/pcm_native.c | |||
@@ -587,14 +587,15 @@ int snd_pcm_status(struct snd_pcm_substream *substream, | |||
587 | if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { | 587 | if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { |
588 | status->avail = snd_pcm_playback_avail(runtime); | 588 | status->avail = snd_pcm_playback_avail(runtime); |
589 | if (runtime->status->state == SNDRV_PCM_STATE_RUNNING || | 589 | if (runtime->status->state == SNDRV_PCM_STATE_RUNNING || |
590 | runtime->status->state == SNDRV_PCM_STATE_DRAINING) | 590 | runtime->status->state == SNDRV_PCM_STATE_DRAINING) { |
591 | status->delay = runtime->buffer_size - status->avail; | 591 | status->delay = runtime->buffer_size - status->avail; |
592 | else | 592 | status->delay += runtime->delay; |
593 | } else | ||
593 | status->delay = 0; | 594 | status->delay = 0; |
594 | } else { | 595 | } else { |
595 | status->avail = snd_pcm_capture_avail(runtime); | 596 | status->avail = snd_pcm_capture_avail(runtime); |
596 | if (runtime->status->state == SNDRV_PCM_STATE_RUNNING) | 597 | if (runtime->status->state == SNDRV_PCM_STATE_RUNNING) |
597 | status->delay = status->avail; | 598 | status->delay = status->avail + runtime->delay; |
598 | else | 599 | else |
599 | status->delay = 0; | 600 | status->delay = 0; |
600 | } | 601 | } |
@@ -2410,6 +2411,7 @@ static int snd_pcm_delay(struct snd_pcm_substream *substream, | |||
2410 | n = snd_pcm_playback_hw_avail(runtime); | 2411 | n = snd_pcm_playback_hw_avail(runtime); |
2411 | else | 2412 | else |
2412 | n = snd_pcm_capture_avail(runtime); | 2413 | n = snd_pcm_capture_avail(runtime); |
2414 | n += runtime->delay; | ||
2413 | break; | 2415 | break; |
2414 | case SNDRV_PCM_STATE_XRUN: | 2416 | case SNDRV_PCM_STATE_XRUN: |
2415 | err = -EPIPE; | 2417 | err = -EPIPE; |