Skip to content

Commit

Permalink
ao_oss: fix a dumb calculation
Browse files Browse the repository at this point in the history
period_size used the wrong unit, and even if the unit had been correct,
was assigned the wrong value.

Probably fixes #4642.
  • Loading branch information
wm4 committed Jul 21, 2017
1 parent f676f6d commit 8c82555
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions audio/out/ao_oss.c
Original file line number Diff line number Diff line change
Expand Up @@ -387,8 +387,9 @@ static int reopen_device(struct ao *ao, bool allow_format_changes)
}
}

ao->period_size = channels.num * af_fmt_to_bytes(format);
p->outburst -= p->outburst % ao->period_size; // round down
int sstride = channels.num * af_fmt_to_bytes(format);
p->outburst -= p->outburst % sstride; // round down
ao->period_size = p->outburst / sstride;

return 0;

Expand Down

0 comments on commit 8c82555

Please sign in to comment.