gnash-commit
[Top][All Lists]
Advanced

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

[Gnash-commit] gnash ChangeLog server/asobj/NetStreamGst.cpp


From: Sandro Santilli
Subject: [Gnash-commit] gnash ChangeLog server/asobj/NetStreamGst.cpp
Date: Thu, 17 May 2007 13:38:18 +0000

CVSROOT:        /sources/gnash
Module name:    gnash
Changes by:     Sandro Santilli <strk>  07/05/17 13:38:18

Modified files:
        .              : ChangeLog 
        server/asobj   : NetStreamGst.cpp 

Log message:
                * server/asobj/NetStreamGst.cpp (unrefElements): don't attempt
                  to unref NULL objects, set objects to NULL after unreffing. 
Add
                  TODO item.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.3249&r2=1.3250
http://cvs.savannah.gnu.org/viewcvs/gnash/server/asobj/NetStreamGst.cpp?cvsroot=gnash&r1=1.45&r2=1.46

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.3249
retrieving revision 1.3250
diff -u -b -r1.3249 -r1.3250
--- ChangeLog   17 May 2007 11:06:21 -0000      1.3249
+++ ChangeLog   17 May 2007 13:38:17 -0000      1.3250
@@ -1,5 +1,8 @@
 2007-05-17 Sandro Santilli <address@hidden>
 
+       * server/asobj/NetStreamGst.cpp (unrefElements): don't attempt
+         to unref NULL objects, set objects to NULL after unreffing. Add
+         TODO item.
        * testsuite/misc-ming.all/NetStream-SquareTest.c:
          Add self-contained tests.
        * testsuite/misc-ming.all/NetStream-SquareTestRunner.cpp:

Index: server/asobj/NetStreamGst.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/asobj/NetStreamGst.cpp,v
retrieving revision 1.45
retrieving revision 1.46
diff -u -b -r1.45 -r1.46
--- server/asobj/NetStreamGst.cpp       16 May 2007 17:50:03 -0000      1.45
+++ server/asobj/NetStreamGst.cpp       17 May 2007 13:38:17 -0000      1.46
@@ -17,7 +17,7 @@
 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 //
 
-/* $Id: NetStreamGst.cpp,v 1.45 2007/05/16 17:50:03 tgc Exp $ */
+/* $Id: NetStreamGst.cpp,v 1.46 2007/05/17 13:38:17 strk Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -356,29 +356,128 @@
 NetStreamGst::unrefElements()
 {
 log_debug("unreffing elements");
+
+       // TODO: Define an GstElement class for storing all these elements,
+       //       and have it's destructor take care of unreffing...
+       //
+       // TODO2: check if calling gst_object_unref is enough to release all
+       //       resources allocated by gst_*_new or gst_element_factory_make
+
+       if ( pipeline )
+       {
        gst_object_unref (GST_OBJECT (pipeline));
+               pipeline = NULL;
+       }
+
+       if ( audiosink )
+       {
        gst_object_unref (GST_OBJECT (audiosink));
+               audiosink = NULL;
+       }
+
+       if ( videosink )
+       {
        gst_object_unref (GST_OBJECT (videosink));
+               videosink = NULL;
+       }
 
+       if ( volume )
+       {
        gst_object_unref (GST_OBJECT (volume));
+               volume = NULL;
+       }
+
+       if ( colorspace )
+       {
        gst_object_unref (GST_OBJECT (colorspace));
+               colorspace = NULL;
+       }
+
+       if ( videorate )
+       {
        gst_object_unref (GST_OBJECT (videorate));
+               videorate = NULL;
+       }
+
+       if ( videocaps )
+       {
        gst_object_unref (GST_OBJECT (videocaps));
+               videocaps = NULL;
+       }
+
+       if ( videoflip )
+       {
        gst_object_unref (GST_OBJECT (videoflip));
+               videoflip = NULL;
+       }
+
+       if ( audioconv )
+       {
        gst_object_unref (GST_OBJECT (audioconv));
+               audioconv = NULL;
+       }
 
-       if (m_isFLV) {
+       if (m_isFLV)
+       {
+               if ( audiosource )
+               {
                gst_object_unref (GST_OBJECT (audiosource));
+                       audiosource = NULL;
+               }
+
+               if ( videosource )
+               {
                gst_object_unref (GST_OBJECT (videosource));
+                       videosource = NULL;
+               }
+
+               if ( videodecoder )
+               {
                gst_object_unref (GST_OBJECT (videodecoder));
+                       videodecoder = NULL;
+               }
+
+               if ( audiodecoder )
+               {
                gst_object_unref (GST_OBJECT (audiodecoder));
+                       audiodecoder = NULL;
+               }
+
+               if ( videoinputcaps )
+               {
                gst_object_unref (GST_OBJECT (videoinputcaps));
+                       videoinputcaps = NULL;
+               }
+
+               if ( audioinputcaps )
+               {
                gst_object_unref (GST_OBJECT (audioinputcaps));
+                       audioinputcaps = NULL;
+               }
 
-       } else {
+               assert(source == NULL);
+               assert(decoder == NULL);
+       }
+       else
+       {
+               if ( source )
+               {
                gst_object_unref (GST_OBJECT (source));
+                       source = NULL;
+               }
+
+               if ( decoder )
+               {
                gst_object_unref (GST_OBJECT (decoder));
+                       decoder = NULL;
+               }
 
+               assert( audiosource == NULL);
+               assert( videosource == NULL);
+               assert( videodecoder == NULL);
+               assert( audiodecoder == NULL);
+               assert( videoinputcaps == NULL);
+               assert( audioinputcaps == NULL);
        }
 }
 




reply via email to

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