From f7c354d7eeaf20e1fccf043444cc805e0aaa77c4 Mon Sep 17 00:00:00 2001 From: Marcus Overhagen Date: Mon, 20 Mar 2006 19:28:03 +0000 Subject: [PATCH] not sure if this helps: when the file end is reached, playback should be stopped. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16845 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/kits/game/FileGameSound.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/kits/game/FileGameSound.cpp b/src/kits/game/FileGameSound.cpp index 75a5ec13e5..af38d1d859 100644 --- a/src/kits/game/FileGameSound.cpp +++ b/src/kits/game/FileGameSound.cpp @@ -452,7 +452,10 @@ BFileGameSound::Load() { int64 frames; char * buffer = &fBuffer[fBufferSize + fAudioStream->position]; - fAudioStream->stream->ReadFrames(buffer, &frames); + status_t err = fAudioStream->stream->ReadFrames(buffer, &frames); + if (err < B_OK) { + StopPlaying(); // XXX this is a hack, the whole class design is broken + } int32 frame = fAudioStream->stream->CurrentFrame();