Skip to content

Commit

Permalink
ALSA: hda-intel - fix wallclk variable update and condition
Browse files Browse the repository at this point in the history
This patch fixes thinko introduced in "last minutes" before commiting
of the last wallclk patch.

It also fixes the condition checking if the first period after last
wallclk update is processed. There is a little rounding error in
period_wallclk.

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
  • Loading branch information
Jaroslav Kysela committed Jun 2, 2010
1 parent aef4b9a commit 8fc6d41
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions sound/pci/hda/hda_intel.c
Original file line number Diff line number Diff line change
Expand Up @@ -1913,11 +1913,11 @@ static int azx_position_ok(struct azx *chip, struct azx_dev *azx_dev)
if (WARN_ONCE(!azx_dev->period_bytes,
"hda-intel: zero azx_dev->period_bytes"))
return -1; /* this shouldn't happen! */
if (wallclk <= azx_dev->period_wallclk &&
if (wallclk < (azx_dev->period_wallclk * 5) / 4 &&
pos % azx_dev->period_bytes > azx_dev->period_bytes / 2)
/* NG - it's below the first next period boundary */
return bdl_pos_adj[chip->dev_index] ? 0 : -1;
azx_dev->start_wallclk = wallclk;
azx_dev->start_wallclk += wallclk;
return 1; /* OK, it's fine */
}

Expand Down

0 comments on commit 8fc6d41

Please sign in to comment.