Fix delay loop condition in BPushGamesound test. It seems to work mostly fine.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@43069 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -127,7 +127,7 @@ main(int argc, char *argv[])
|
|||||||
& media_raw_audio_format::B_AUDIO_SIZE_MASK);
|
& media_raw_audio_format::B_AUDIO_SIZE_MASK);
|
||||||
size_t decodedSize = 0;
|
size_t decodedSize = 0;
|
||||||
size_t partPos = 0;
|
size_t partPos = 0;
|
||||||
size_t pos = pushGameSound.CurrentPosition();
|
size_t pos = 0; /*pushGameSound.CurrentPosition();*/
|
||||||
key_info keyInfo;
|
key_info keyInfo;
|
||||||
|
|
||||||
while (true) {
|
while (true) {
|
||||||
@@ -159,6 +159,7 @@ main(int argc, char *argv[])
|
|||||||
printf("\rtime: %.2f",
|
printf("\rtime: %.2f",
|
||||||
(double)mediaTrack->CurrentTime() / 1000000LL);
|
(double)mediaTrack->CurrentTime() / 1000000LL);
|
||||||
fflush(stdout);
|
fflush(stdout);
|
||||||
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -168,9 +169,11 @@ main(int argc, char *argv[])
|
|||||||
if (bufferSize <= pos)
|
if (bufferSize <= pos)
|
||||||
pos = 0;
|
pos = 0;
|
||||||
|
|
||||||
// playback sync
|
// playback sync - wait for the buffer part we're about to fill to be
|
||||||
while (pushGameSound.CurrentPosition() == pos)
|
// played
|
||||||
snooze(100);
|
while (pushGameSound.CurrentPosition() >= pos + bufferPartSize
|
||||||
|
|| pushGameSound.CurrentPosition() < pos)
|
||||||
|
snooze(1000 * framesPerBufferPart / gsFormat.frame_rate);
|
||||||
|
|
||||||
// check escape key state
|
// check escape key state
|
||||||
if (get_key_info(&keyInfo) != B_OK) {
|
if (get_key_info(&keyInfo) != B_OK) {
|
||||||
|
|||||||
Reference in New Issue
Block a user