[pulseaudio-commits] r1165 - /trunk/src/pulse/sample.c

svnmailer-noreply at 0pointer.de svnmailer-noreply at 0pointer.de
Sat Jul 29 08:02:54 PDT 2006


Author: lennart
Date: Sat Jul 29 17:02:53 2006
New Revision: 1165

URL: http://0pointer.de/cgi-bin/viewcvs.cgi?rev=1165&root=pulseaudio&view=rev
Log:
fix calculation of pa_usec_to_bytes, to make sure that it never returns fractions of a frame size

Modified:
    trunk/src/pulse/sample.c

Modified: trunk/src/pulse/sample.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/trunk/src/pulse/sample.c?rev=1165&root=pulseaudio&r1=1164&r2=1165&view=diff
==============================================================================
--- trunk/src/pulse/sample.c (original)
+++ trunk/src/pulse/sample.c Sat Jul 29 17:02:53 2006
@@ -70,7 +70,7 @@
 size_t pa_usec_to_bytes(pa_usec_t t, const pa_sample_spec *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) {




More information about the pulseaudio-commits mailing list