Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 132752
b: refs/heads/master
c: ded652f
h: refs/heads/master
v: v3
  • Loading branch information
Takashi Iwai committed Mar 19, 2009
1 parent cf47a2b commit e5e9dc4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 5f513e1197f27e9a0bcfec0feaac59f976f4a37e
refs/heads/master: ded652f7024bc2d7b6118b561a44187af30841b0
9 changes: 7 additions & 2 deletions trunk/sound/core/pcm_lib.c
Original file line number Diff line number Diff line change
Expand Up @@ -221,8 +221,11 @@ static int snd_pcm_update_hw_ptr_interrupt(struct snd_pcm_substream *substream)
new_hw_ptr = hw_base + pos;
hw_ptr_interrupt = runtime->hw_ptr_interrupt + runtime->period_size;
delta = new_hw_ptr - hw_ptr_interrupt;
if (hw_ptr_interrupt == runtime->boundary)
hw_ptr_interrupt = 0;
if (hw_ptr_interrupt >= runtime->boundary) {
hw_ptr_interrupt %= runtime->boundary;
if (!hw_base) /* hw_base was already lapped; recalc delta */
delta = new_hw_ptr - hw_ptr_interrupt;
}
if (delta < 0) {
delta += runtime->buffer_size;
if (delta < 0) {
Expand All @@ -233,6 +236,8 @@ static int snd_pcm_update_hw_ptr_interrupt(struct snd_pcm_substream *substream)
(long)hw_ptr_interrupt);
/* rebase to interrupt position */
hw_base = new_hw_ptr = hw_ptr_interrupt;
/* align hw_base to buffer_size */
hw_base -= hw_base % runtime->buffer_size;
delta = 0;
} else {
hw_base += runtime->buffer_size;
Expand Down

0 comments on commit e5e9dc4

Please sign in to comment.