From: ThorstenB Date: Sun, 24 Jun 2012 17:18:47 +0000 (+0200) Subject: Fix error handling in SGSampleGroup::stop X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=8e42e5bdba1b18fa3696d93ea97d7f6ef4820f4e;p=simgear.git 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. --- diff --git a/simgear/sound/sample_group.cxx b/simgear/sound/sample_group.cxx index c680b8f7..ee8080fa 100644 --- a/simgear/sound/sample_group.cxx +++ b/simgear/sound/sample_group.cxx @@ -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 diff --git a/simgear/sound/sample_group.hxx b/simgear/sound/sample_group.hxx index 56f1bd45..7d17f761 100644 --- a/simgear/sound/sample_group.hxx +++ b/simgear/sound/sample_group.hxx @@ -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 */ diff --git a/simgear/sound/soundmgr_openal.hxx b/simgear/sound/soundmgr_openal.hxx index e075a913..e34d6266 100644 --- a/simgear/sound/soundmgr_openal.hxx +++ b/simgear/sound/soundmgr_openal.hxx @@ -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.