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 13:10:54 +0000

CVSROOT:        /sources/gnash
Module name:    gnash
Branch:         gnash_0_8_3_branch
Changes by:     Sandro Santilli <strk>  08/05/16 13:10:54

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

Log message:
                * libmedia/ffmpeg/sound_handler_sdl.h: add an
                  sound_data::clearActiveSounds() method to properly
                  drop active sounds w/out memory leaks.
                * libmedia/ffmpeg/sound_handler_sdl.cpp (stop_sound):
                  use sound_data::clearActiveSounds() fixing leak of
                  actual active sounds..

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&only_with_tag=gnash_0_8_3_branch&r1=1.6573.2.17&r2=1.6573.2.18
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&r2=1.7.2.1
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&r2=1.8.2.1

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.6573.2.17
retrieving revision 1.6573.2.18
diff -u -b -r1.6573.2.17 -r1.6573.2.18
--- ChangeLog   16 May 2008 11:04:21 -0000      1.6573.2.17
+++ ChangeLog   16 May 2008 13:10:51 -0000      1.6573.2.18
@@ -1,5 +1,14 @@
 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.
+       * libmedia/ffmpeg/sound_handler_sdl.cpp (stop_sound):
+         use sound_data::clearActiveSounds() fixing leak of
+         actual active sounds..
+
+2008-05-16 Sandro Santilli <address@hidden>
+
        * server/sprite_instance.{cpp,h}: remove unloaded TextField references
          from TextField variables container on ::cleanupDisplayList.
          Fixes bug #20076 (leak on curve_ball.swf).

Index: libmedia/ffmpeg/sound_handler_sdl.cpp
===================================================================
RCS file: /sources/gnash/gnash/libmedia/ffmpeg/sound_handler_sdl.cpp,v
retrieving revision 1.7
retrieving revision 1.7.2.1
diff -u -b -r1.7 -r1.7.2.1
--- libmedia/ffmpeg/sound_handler_sdl.cpp       8 May 2008 17:54:52 -0000       
1.7
+++ libmedia/ffmpeg/sound_handler_sdl.cpp       16 May 2008 13:10:53 -0000      
1.7.2.1
@@ -338,23 +338,18 @@
        if (sound_handle < 0 || (unsigned int) sound_handle >= 
m_sound_data.size())
        {
                // Invalid handle.
-       } else {
+               return;
+       }
+
        
                sound_data* sounddata = m_sound_data[sound_handle];
        
-               for (boost::int32_t i = (boost::int32_t) 
sounddata->m_active_sounds.size()-1; i >-1; i--) {
+       size_t nActiveSounds = sounddata->m_active_sounds.size();
 
-                       //active_sound* sound = sounddata->m_active_sounds[i];
-
-                       // Stop sound, remove it from the active list
-                       //sound->delete_raw_data();
-                       //delete sound->decoder;
-                       
sounddata->m_active_sounds.erase(sounddata->m_active_sounds.begin() + i);
+       soundsPlaying -= nActiveSounds;
+       _soundsStopped += nActiveSounds;
                        
-                       --soundsPlaying;
-                       ++_soundsStopped;
-               }
-       }
+       sounddata->clearActiveSounds();
 
 }
 
@@ -931,6 +926,16 @@
 
 }
 
+void
+sound_data::clearActiveSounds()
+{
+       for (ActiveSounds::iterator i=m_active_sounds.begin(), 
e=m_active_sounds.end(); i!=e; ++i)
+       {
+               delete *i;
+       }
+       m_active_sounds.clear();
+}
+
 
 } // gnash.media namespace 
 } // namespace gnash

Index: libmedia/ffmpeg/sound_handler_sdl.h
===================================================================
RCS file: /sources/gnash/gnash/libmedia/ffmpeg/sound_handler_sdl.h,v
retrieving revision 1.8
retrieving revision 1.8.2.1
diff -u -b -r1.8 -r1.8.2.1
--- libmedia/ffmpeg/sound_handler_sdl.h 8 May 2008 17:54:53 -0000       1.8
+++ libmedia/ffmpeg/sound_handler_sdl.h 16 May 2008 13:10:54 -0000      1.8.2.1
@@ -126,6 +126,8 @@
 
        ActiveSounds m_active_sounds;
 
+       /// Drop all active sounds
+       void clearActiveSounds();
 };
 
 /// Used to hold the info about active sounds
@@ -141,6 +143,7 @@
 public:
        active_sound()
                :
+               decoder(0),
                position(0),
                raw_position(0),
                loop_count(0),
@@ -275,10 +278,7 @@
 // This is here as it needs definition of active_sound
 sound_data::~sound_data()
 {
-       for (ActiveSounds::iterator i=m_active_sounds.begin(), 
e=m_active_sounds.end(); i!=e; ++i)
-       {
-               delete *i;
-       }
+       clearActiveSounds();
 }
 
 // Use SDL and ffmpeg/mad/nothing to handle sounds.




reply via email to

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