gnash-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gnash-commit] gnash ChangeLog libmedia/ffmpeg/sound_handler_s... [gnash


From: Sandro Santilli
Subject: [Gnash-commit] gnash ChangeLog libmedia/ffmpeg/sound_handler_s... [gnash_0_8_3_branch]
Date: Fri, 16 May 2008 14:04:20 +0000

CVSROOT:        /sources/gnash
Module name:    gnash
Branch:         gnash_0_8_3_branch
Changes by:     Sandro Santilli <strk>  08/05/16 14:04:20

Modified files:
        .              : ChangeLog 
        libmedia/ffmpeg: sound_handler_sdl.cpp sound_handler_sdl.h 

Log message:
        * libmedia/ffmpeg/sound_handler_sdl.{cpp,h}: fix memory leak in
          stop_all_sounds too..

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&only_with_tag=gnash_0_8_3_branch&r1=1.6573.2.18&r2=1.6573.2.19
http://cvs.savannah.gnu.org/viewcvs/gnash/libmedia/ffmpeg/sound_handler_sdl.cpp?cvsroot=gnash&only_with_tag=gnash_0_8_3_branch&r1=1.7.2.1&r2=1.7.2.2
http://cvs.savannah.gnu.org/viewcvs/gnash/libmedia/ffmpeg/sound_handler_sdl.h?cvsroot=gnash&only_with_tag=gnash_0_8_3_branch&r1=1.8.2.1&r2=1.8.2.2

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.6573.2.18
retrieving revision 1.6573.2.19
diff -u -b -r1.6573.2.18 -r1.6573.2.19
--- ChangeLog   16 May 2008 13:10:51 -0000      1.6573.2.18
+++ ChangeLog   16 May 2008 14:04:16 -0000      1.6573.2.19
@@ -1,5 +1,10 @@
 2008-05-16 Sandro Santilli <address@hidden>
 
+       * libmedia/ffmpeg/sound_handler_sdl.{cpp,h}: fix memory leak in
+         stop_all_sounds too..
+
+2008-05-16 Sandro Santilli <address@hidden>
+
        * libmedia/ffmpeg/sound_handler_sdl.h: add an
          sound_data::clearActiveSounds() method to properly
          drop active sounds w/out memory leaks.

Index: libmedia/ffmpeg/sound_handler_sdl.cpp
===================================================================
RCS file: /sources/gnash/gnash/libmedia/ffmpeg/sound_handler_sdl.cpp,v
retrieving revision 1.7.2.1
retrieving revision 1.7.2.2
diff -u -b -r1.7.2.1 -r1.7.2.2
--- libmedia/ffmpeg/sound_handler_sdl.cpp       16 May 2008 13:10:53 -0000      
1.7.2.1
+++ libmedia/ffmpeg/sound_handler_sdl.cpp       16 May 2008 14:04:19 -0000      
1.7.2.2
@@ -374,21 +374,15 @@
 {
        boost::mutex::scoped_lock lock(_mutex);
 
-       boost::int32_t num_sounds = (boost::int32_t) m_sound_data.size()-1;
-       for (boost::int32_t j = num_sounds; j > -1; j--) {//Optimized
-               sound_data* sounddata = m_sound_data[j];
-               boost::int32_t num_active_sounds = (boost::int32_t) 
sounddata->m_active_sounds.size()-1;
-               for (boost::int32_t i = num_active_sounds; i > -1; i--) {
-
-                       //active_sound* sound = sounddata->m_active_sounds[i];
-
-                       // Stop sound, remove it from the active list
-                       //delete sound->decoder;
-                       
sounddata->m_active_sounds.erase(sounddata->m_active_sounds.begin() + i);
+       for (Sounds::iterator i=m_sound_data.begin(), e=m_sound_data.end(); 
i!=e; ++i)
+       {
+               sound_data* sounddata = *i;
+               size_t nActiveSounds = sounddata->m_active_sounds.size();
                        
-                       --soundsPlaying;
-                       ++_soundsStopped;
-               }
+               soundsPlaying -= nActiveSounds;
+               _soundsStopped += nActiveSounds;
+
+               sounddata->clearActiveSounds();
        }
 }
 

Index: libmedia/ffmpeg/sound_handler_sdl.h
===================================================================
RCS file: /sources/gnash/gnash/libmedia/ffmpeg/sound_handler_sdl.h,v
retrieving revision 1.8.2.1
retrieving revision 1.8.2.2
diff -u -b -r1.8.2.1 -r1.8.2.2
--- libmedia/ffmpeg/sound_handler_sdl.h 16 May 2008 13:10:54 -0000      1.8.2.1
+++ libmedia/ffmpeg/sound_handler_sdl.h 16 May 2008 14:04:19 -0000      1.8.2.2
@@ -293,7 +293,8 @@
        //
        /// Elemenst of the vector are owned by this class
        ///
-       std::vector<sound_data*>        m_sound_data;
+       typedef std::vector<sound_data*> Sounds;
+       Sounds  m_sound_data;
 
        /// Is sound device opened?
        bool soundOpened;




reply via email to

[Prev in Thread] Current Thread [Next in Thread]