// returns true if both buffers were // filled with data from the stream bool COggStream::StartPlaying() { if (!DecodeStream(buffers[0])) return false; if (!DecodeStream(buffers[1])) return false; alSourceQueueBuffers(source, 2, buffers); alSourcePlay(source); return true; }
// returns true if both buffers were // filled with data from the stream bool COggStream::StartPlaying() { msecsPlayed = 0; lastTick = SDL_GetTicks(); if (!DecodeStream(buffers[0])) { return false; } if (!DecodeStream(buffers[1])) { return false; } alSourceQueueBuffers(source, 2, buffers); CheckError("COggStream::StartPlaying"); alSourcePlay(source); CheckError("COggStream::StartPlaying"); return true; }
// returns true if both buffers were // filled with data from the stream bool COggStream::StartPlaying() { msecsPlayed = spring_nulltime; lastTick = spring_gettime(); if (!DecodeStream(buffers[0])) { return false; } if (!DecodeStream(buffers[1])) { return false; } alSourceQueueBuffers(source, 2, buffers); CheckError("COggStream::StartPlaying"); alSourcePlay(source); CheckError("COggStream::StartPlaying"); return true; }
ECode Movie::DecodeTempStream( /* [in] */ IInputStream* is, /* [out] */IMovie** movie) { // try { ECode ec = DecodeStream(is, movie); is->Close(); // } // catch (java.io.IOException e) { // /* do nothing. // If the exception happened on open, moov will be null. // If it happened on close, moov is still valid. // */ // } return ec; }
// pop the processed buffers from the queue, // refill them, and push them back in line bool COggStream::UpdateBuffers() { int buffersProcessed = 0; bool active = true; alGetSourcei(source, AL_BUFFERS_PROCESSED, &buffersProcessed); while (buffersProcessed-- > 0) { ALuint buffer; alSourceUnqueueBuffers(source, 1, &buffer); CheckError("COggStream::UpdateBuffers"); // false if we've reached end of stream active = DecodeStream(buffer); if (active) alSourceQueueBuffers(source, 1, &buffer); CheckError("COggStream::UpdateBuffers"); } return active; }