File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -159,13 +159,31 @@ void PlayerOpenAL::Source::play(double start)
159159 }
160160
161161 ALuint buf = audio->buffer ();
162+ if (buf == AL_NONE )
163+ {
164+ std::cerr << " Audio: OpenAL source play requested with invalid buffer for URL '" << audio->url () << " '" << std::endl;
165+ return ;
166+ }
167+
162168 alSourceQueueBuffers (alSource, 1 , &buf);
169+ ALenum queueError = alGetError ();
170+ if (queueError != AL_NO_ERROR )
171+ {
172+ std::cerr << " Audio: alSourceQueueBuffers failed with error " << queueError << " for URL '" << audio->url () << " '" << std::endl;
173+ return ;
174+ }
175+
163176 if (loop)
164177 {
165178 alSourcei (alSource, AL_LOOPING , AL_TRUE );
166179 }
167180
168181 alSourcePlay (alSource);
182+ ALenum playError = alGetError ();
183+ if (playError != AL_NO_ERROR )
184+ {
185+ std::cerr << " Audio: alSourcePlay failed with error " << playError << " for URL '" << audio->url () << " '" << std::endl;
186+ }
169187}
170188
171189void PlayerOpenAL::Source::stop ()
You can’t perform that action at this time.
0 commit comments