Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 132753
b: refs/heads/master
c: 8b22d94
h: refs/heads/master
i:
  132751: cf47a2b
v: v3
  • Loading branch information
Takashi Iwai committed Mar 20, 2009
1 parent e5e9dc4 commit 3f193bf
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 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: ded652f7024bc2d7b6118b561a44187af30841b0
refs/heads/master: 8b22d943c34b616eefbd6d2f8f197a53b1f29fd0
9 changes: 5 additions & 4 deletions trunk/sound/core/pcm_lib.c
Original file line number Diff line number Diff line change
Expand Up @@ -222,8 +222,9 @@ static int snd_pcm_update_hw_ptr_interrupt(struct snd_pcm_substream *substream)
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 %= runtime->boundary;
if (!hw_base) /* hw_base was already lapped; recalc delta */
hw_ptr_interrupt -= runtime->boundary;
if (hw_base < runtime->boundary / 2)
/* hw_base was already lapped; recalc delta */
delta = new_hw_ptr - hw_ptr_interrupt;
}
if (delta < 0) {
Expand All @@ -241,7 +242,7 @@ static int snd_pcm_update_hw_ptr_interrupt(struct snd_pcm_substream *substream)
delta = 0;
} else {
hw_base += runtime->buffer_size;
if (hw_base == runtime->boundary)
if (hw_base >= runtime->boundary)
hw_base = 0;
new_hw_ptr = hw_base + pos;
}
Expand Down Expand Up @@ -296,7 +297,7 @@ int snd_pcm_update_hw_ptr(struct snd_pcm_substream *substream)
return 0;
}
hw_base += runtime->buffer_size;
if (hw_base == runtime->boundary)
if (hw_base >= runtime->boundary)
hw_base = 0;
new_hw_ptr = hw_base + pos;
}
Expand Down

0 comments on commit 3f193bf

Please sign in to comment.