diff options
author | Takashi Iwai <tiwai@suse.de> | 2010-01-26 18:13:04 +0100 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2010-01-26 18:13:04 +0100 |
commit | d0d2c38e3963f4f86a9e62d74f45a371458f2787 (patch) | |
tree | 8ab868d67fcd4151e9b7a8158edc0cb2e1a19f66 /sound/core | |
parent | cf944ee55cc318bdb1d4b2f3f5cce3257f7c07b3 (diff) | |
parent | e7636925789b042ff9d98c51d48392e8c5549480 (diff) | |
download | linux-3.10-d0d2c38e3963f4f86a9e62d74f45a371458f2787.tar.gz linux-3.10-d0d2c38e3963f4f86a9e62d74f45a371458f2787.tar.bz2 linux-3.10-d0d2c38e3963f4f86a9e62d74f45a371458f2787.zip |
Merge remote branch 'alsa/devel' into topic/misc
Diffstat (limited to 'sound/core')
-rw-r--r-- | sound/core/oss/pcm_oss.c | 3 | ||||
-rw-r--r-- | sound/core/pcm_lib.c | 7 | ||||
-rw-r--r-- | sound/core/pcm_native.c | 2 |
3 files changed, 8 insertions, 4 deletions
diff --git a/sound/core/oss/pcm_oss.c b/sound/core/oss/pcm_oss.c index 255ad910077..82d4e3329b3 100644 --- a/sound/core/oss/pcm_oss.c +++ b/sound/core/oss/pcm_oss.c @@ -635,8 +635,7 @@ static long snd_pcm_alsa_frames(struct snd_pcm_substream *substream, long bytes) static inline snd_pcm_uframes_t get_hw_ptr_period(struct snd_pcm_runtime *runtime) { - snd_pcm_uframes_t ptr = runtime->status->hw_ptr; - return ptr - (ptr % runtime->period_size); + return runtime->hw_ptr_interrupt; } /* define extended formats in the recent OSS versions (if any) */ diff --git a/sound/core/pcm_lib.c b/sound/core/pcm_lib.c index 272f15d1901..b546ac2660f 100644 --- a/sound/core/pcm_lib.c +++ b/sound/core/pcm_lib.c @@ -325,8 +325,7 @@ static int snd_pcm_update_hw_ptr0(struct snd_pcm_substream *substream, if (in_interrupt) { /* we know that one period was processed */ /* delta = "expected next hw_ptr" for in_interrupt != 0 */ - delta = old_hw_ptr - (old_hw_ptr % runtime->period_size) - + runtime->period_size; + delta = runtime->hw_ptr_interrupt + runtime->period_size; if (delta > new_hw_ptr) { hw_base += runtime->buffer_size; if (hw_base >= runtime->boundary) @@ -437,6 +436,10 @@ static int snd_pcm_update_hw_ptr0(struct snd_pcm_substream *substream, runtime->silence_size > 0) snd_pcm_playback_silence(substream, new_hw_ptr); + if (in_interrupt) { + runtime->hw_ptr_interrupt = new_hw_ptr - + (new_hw_ptr % runtime->period_size); + } runtime->hw_ptr_base = hw_base; runtime->status->hw_ptr = new_hw_ptr; runtime->hw_ptr_jiffies = jiffies; diff --git a/sound/core/pcm_native.c b/sound/core/pcm_native.c index b53fa845004..b79c777d211 100644 --- a/sound/core/pcm_native.c +++ b/sound/core/pcm_native.c @@ -1252,6 +1252,8 @@ static int snd_pcm_do_reset(struct snd_pcm_substream *substream, int state) if (err < 0) return err; runtime->hw_ptr_base = 0; + runtime->hw_ptr_interrupt = runtime->status->hw_ptr - + runtime->status->hw_ptr % runtime->period_size; runtime->silence_start = runtime->status->hw_ptr; runtime->silence_filled = 0; return 0; |