Fix error handling in SGSampleGroup::stop
Move error check to correct location: needs to be done immediately after the alSourceStop call - and only if it was called at all.
This commit is contained in:
@@ -273,6 +273,7 @@ SGSampleGroup::stop ()
|
||||
ALint source = sample->get_source();
|
||||
if ( sample->is_playing() ) {
|
||||
alSourceStop( source );
|
||||
testForALError("stop");
|
||||
}
|
||||
_smgr->release_source( source );
|
||||
sample->no_valid_source();
|
||||
@@ -283,7 +284,6 @@ SGSampleGroup::stop ()
|
||||
sample->no_valid_buffer();
|
||||
}
|
||||
}
|
||||
testForALError("stop");
|
||||
}
|
||||
|
||||
// stop playing all associated samples
|
||||
|
||||
@@ -145,7 +145,7 @@ public:
|
||||
void resume();
|
||||
|
||||
/**
|
||||
* Request to start playing the refered audio sample.
|
||||
* Request to start playing the referred audio sample.
|
||||
* @param refname Reference name of the audio sample to start playing
|
||||
* @param looping Define if the sound should loop continuously
|
||||
* @return true if the audio sample exsists and is scheduled for playing
|
||||
@@ -153,7 +153,7 @@ public:
|
||||
bool play( const string& refname, bool looping );
|
||||
|
||||
/**
|
||||
* Request to start playing the refered audio sample looping.
|
||||
* Request to start playing the referred audio sample looping.
|
||||
* @param refname Reference name of the audio sample to start playing
|
||||
* @return true if the audio sample exsists and is scheduled for playing
|
||||
*/
|
||||
@@ -162,9 +162,9 @@ public:
|
||||
}
|
||||
|
||||
/**
|
||||
* Request to start playing the refered audio sample once.
|
||||
* Request to start playing the referred audio sample once.
|
||||
* @param refname Reference name of the audio sample to start playing
|
||||
* @return true if the audio sample exsists and is scheduled for playing
|
||||
* @return true if the audio sample exists and is scheduled for playing
|
||||
*/
|
||||
inline bool play_once( const string& refname ) {
|
||||
return play( refname, false );
|
||||
@@ -178,7 +178,7 @@ public:
|
||||
bool is_playing( const string& refname );
|
||||
|
||||
/**
|
||||
* Request to stop playing the refered audio sample.
|
||||
* Request to stop playing the referred audio sample.
|
||||
* @param refname Reference name of the audio sample to stop
|
||||
* @return true if the audio sample exists and is scheduled to stop
|
||||
*/
|
||||
|
||||
@@ -113,7 +113,7 @@ public:
|
||||
|
||||
/**
|
||||
* Register a sample group to the sound manager.
|
||||
* @para sgrp Pointer to a sample group to add
|
||||
* @param sgrp Pointer to a sample group to add
|
||||
* @param refname Reference name of the sample group
|
||||
* @return true if successful, false otherwise
|
||||
*/
|
||||
@@ -250,7 +250,7 @@ public:
|
||||
inline bool has_changed() { return _changed; }
|
||||
|
||||
/**
|
||||
* Some implementations seem to need the velocity miltyplied by a
|
||||
* Some implementations seem to need the velocity multiplied by a
|
||||
* factor of 100 to make them distinct. I've not found if this is
|
||||
* a problem in the implementation or in out code. Until then
|
||||
* this function is used to detect the problematic implementations.
|
||||
|
||||
Reference in New Issue
Block a user