Closed slime73 closed 13 years ago
Original comment by Danny Fritz (Bitbucket: dannyfritz, GitHub: dannyfritz).
Wasn't happening on my Ubuntu machine with 0.7.1.
Original comment by Danny Fritz (Bitbucket: dannyfritz, GitHub: dannyfritz).
I have the problem on rescue.love with 0.7.1 Windows 7 x64
Original comment by Boolsheet (Bitbucket: Boolsheet, GitHub: Boolsheet).
I've found some things that could be a problem in the openal code. Looking some more into it to be sure what exactly is relevant to this issue.\ There's also a bug in the Mpg123Decoder.cpp which has probably a part in all this, but it's not the main cause: https://bitbucket.org/rude/love/src/0aa215028607/src/modules/sound/lullaby/Mpg123Decoder.cpp#cl-130 \\In case of MPG123_NEED_MORE the decoder may have decoded some data and the code does not respect this. numbytes should be added to size.
(Oh, I just realised that this is the bug that causes the click and popping with mp3s)
Original comment by Boolsheet (Bitbucket: Boolsheet, GitHub: Boolsheet).
Turns out the code in Source.cpp may leak a OpenAL buffer if Decoder::decode() returns 0. This is possible on eof or on decoding error maybe. anjo already made some changes to the function that leaks for 0.8.0, but it looks like it still will leak. \Also noticed 2 decoder bugs. The mpg123 noted above and one in the VorbisDecoder that sets eof too early. \\ Please don't apply the patch. I just added it to show what I mean in code form.
Original comment by Boolsheet (Bitbucket: Boolsheet, GitHub: Boolsheet).
Yes, that fixed some of it.\ Now looping sources keep looping, mp3 plays without the clicking and vorbis does not cut off the end. \\ Unfortuantely Source::isStopped() relies on the fact that OpenAL stops a source if it runs out of buffers and that's exactly what Source::update() used to do if the decoder is done. isStopped() will now always return false if the Source is not stopped manually. I noticed this when I poked around with the FLAC decoder.\ Source::update() or Source::streamAtomic() probably need to check for Decoder->isFinished() and stop the non-looping source. \\ There's another problem with Source::streamAtomic(). Because the code now always queues the unqueued buffer right away it has to update the buffer even if there's no new data. streamAtomic() currently only updates the buffer if it has at least 1 byte of data. OpenAL will loop the last buffer(s) repeatedly at the end with non-looping sources.\ I think you could just drop the if on line 466, since passing a 0 size buffer seems to be a valid operation in OpenAL.
Original report by Danny Fritz (Bitbucket: dannyfritz, GitHub: dannyfritz).
I made that annoying nyancat program, and I loop a 24 second clip. The loop stops about 3 minutes in for me and the game becomes silent.