mpegtsparse: use fixed size array rather than dynamically allocating
authorZaheer Abbas Merali <zaheerabbas@merali.org>
Sun, 20 Sep 2009 14:30:59 +0000 (15:30 +0100)
committerZaheer Abbas Merali <zaheerabbas@merali.org>
Sun, 20 Sep 2009 14:32:14 +0000 (15:32 +0100)
gst/mpegdemux/mpegtspacketizer.c
gst/mpegdemux/mpegtspacketizer.h

index 53fe8f24826c8fd2b24e8c8faf0fa47f776fb8cb..9de766efd75127a0c1ee7842cd396d5435bcad1f 100644 (file)
@@ -155,7 +155,7 @@ static void
 mpegts_packetizer_init (MpegTSPacketizer * packetizer)
 {
   packetizer->adapter = gst_adapter_new ();
-  packetizer->streams = g_new0 (MpegTSPacketizerStream *, 8192);
+  memset (packetizer->streams, 0, 8192);
   packetizer->know_packet_size = FALSE;
 }
 
@@ -176,7 +176,6 @@ mpegts_packetizer_dispose (GObject * object)
         if (packetizer->streams[i])
           mpegts_packetizer_stream_free (packetizer->streams[i]);
       }
-      g_free (packetizer->streams);
     }
 
     gst_adapter_clear (packetizer->adapter);
index 1f82848aef1a1e20104859ad815373eedd5bc9e4..764dc01802dea83120a4993c24a0b99f206b089e 100644 (file)
@@ -67,7 +67,7 @@ struct _MpegTSPacketizer {
 
   GstAdapter *adapter;
   /* streams hashed by pid */
-  MpegTSPacketizerStream **streams;
+  MpegTSPacketizerStream *streams[8192];
   gboolean disposed;
   gboolean know_packet_size;
   guint16 packet_size;