mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-03-22 15:05:03 +01:00
Fixes OpenAL crash and adds extra OpenAL error logging.
This commit is contained in:
@@ -69,7 +69,7 @@ openal_buffer::openal_buffer( std::string const &Filename ) :
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
id = null_resource;
|
id = null_resource;
|
||||||
ErrorLog("sound: failed to create AL buffer");
|
ErrorLog("sound: failed to create AL buffer: " + std::string(alGetString(alGetError())));
|
||||||
}
|
}
|
||||||
|
|
||||||
delete[] buf;
|
delete[] buf;
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ openal_source::bind( sound_source *Controller, uint32_sequence Sounds, Iterator_
|
|||||||
|
|
||||||
is_multipart = ( buffers.size() > 1 );
|
is_multipart = ( buffers.size() > 1 );
|
||||||
|
|
||||||
if( id != audio::null_resource ) {
|
if( id != audio::null_resource && !buffers.empty()) {
|
||||||
::alSourceQueueBuffers( id, static_cast<ALsizei>( buffers.size() ), buffers.data() );
|
::alSourceQueueBuffers( id, static_cast<ALsizei>( buffers.size() ), buffers.data() );
|
||||||
::alSourceRewind( id );
|
::alSourceRewind( id );
|
||||||
// sound controller can potentially request playback to start from certain buffer point
|
// sound controller can potentially request playback to start from certain buffer point
|
||||||
|
|||||||
Reference in New Issue
Block a user