Re: Bug in PlayFile.cpp
Re: Bug in PlayFile.cpp
- Subject: Re: Bug in PlayFile.cpp
- From: William Stewart <email@hidden>
- Date: Mon, 12 Jun 2006 11:26:22 -0700
This is the code I have for this:
usleep ((int)(fileDuration * 1000. * 1000.));
usleep sleeps in microseconds
fileDuration is in seconds, so the calculation is:
fileDuration * 1000 * 1000 -> then the (Float64) result is cast to an
int - the rounding error is negligible
Bill
On 12/06/2006, at 6:16 AM, William Reading wrote:
Howdy,
I don't know if this is the right place for these things, but I
thought I'd mention it here and hope it gets routed where it should
go.
The copy of PlayFile.cpp included in the v1.4.3 SDK has a little
rounding bug that I noticed when I tried to playback a file shorter
than a second in length:
Line 99 should be something like: usleep (lroundl(fileDuration *
1000 * 1000));
If it's just truncated by casting to (int), then the value becomes
zero for files shorter than a second and has the potential to
truncate playback in other ways.
Regards,
William Reading
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
--
mailto:email@hidden
tel: +1 408 974 4056
________________________________________________________________________
__
"Much human ingenuity has gone into finding the ultimate Before.
The current state of knowledge can be summarized thus:
In the beginning, there was nothing, which exploded" - Terry Pratchett
________________________________________________________________________
__
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden