#1391: Audio queue overloaded (with fix)
----------------------------------------+-----------------------------------
        Reporter:  jovie1...@…          |        Type:  bug                 
          Status:  new                  |    Priority:  major               
       Milestone:  unspecified          |   Component:  Engine: Sound       
         Version:  2.3 beta 6           |    Keywords:  audio queue overload
Operating_system:  All/Non-Specific     |   Blockedby:                      
        Blocking:                       |  
----------------------------------------+-----------------------------------
 In lib/sound/audio.c, in the task audio_Update() is a loop that gets rid
 of audio samples that are finished playing.  However, due to the order of
 the call to audio_RemoveSample() and finding psSampleTemp, only the
 *first* finished audio sample will be removed.  This is because
 audio_RemoveSample() always sets the sample's next and prev to NULL, so
 psSampleTemp will always become NULL and the loop will exit.  If these
 lines are switched, then all finished audio samples will be released at
 the correct time instead of once-per-update.  This applies to all code,
 including 2.2.4, up to the current 2.3 betas.  I have not checked the
 trunk.  This fix should cut down memory usage a bit and helped alleviate
 the necessity of bringing up the escape menu to clear the sound queues.

-- 
Ticket URL: <http://developer.wz2100.net/ticket/1391>
Warzone 2100 Trac <http://developer.wz2100.net/>
The Warzone 2100 Project
_______________________________________________
Warzone-dev mailing list
Warzone-dev@gna.org
https://mail.gna.org/listinfo/warzone-dev

Reply via email to