mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-04 13:29:59 -05:00
fix calculation of pa_usec_to_bytes, to make sure that it never returns fractions of a frame size
git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@1165 fefdeb5f-60dc-0310-8127-8f9354f1896f
This commit is contained in:
parent
b325e07c73
commit
9310a2e3b8
1 changed files with 1 additions and 1 deletions
|
|
@ -70,7 +70,7 @@ pa_usec_t pa_bytes_to_usec(uint64_t length, const pa_sample_spec *spec) {
|
||||||
size_t pa_usec_to_bytes(pa_usec_t t, const pa_sample_spec *spec) {
|
size_t pa_usec_to_bytes(pa_usec_t t, const pa_sample_spec *spec) {
|
||||||
assert(spec);
|
assert(spec);
|
||||||
|
|
||||||
return ((double) t * spec->rate / 1000000)*pa_frame_size(spec);
|
return (size_t) (((double) t * spec->rate / 1000000))*pa_frame_size(spec);
|
||||||
}
|
}
|
||||||
|
|
||||||
int pa_sample_spec_valid(const pa_sample_spec *spec) {
|
int pa_sample_spec_valid(const pa_sample_spec *spec) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue