Revert "mpegtsparse: use fixed size array rather than dynamically allocating"
authorZaheer Abbas Merali <zaheerabbas@merali.org>
Sun, 20 Sep 2009 16:53:24 +0000 (17:53 +0100)
committerZaheer Abbas Merali <zaheerabbas@merali.org>
Sun, 20 Sep 2009 16:53:24 +0000 (17:53 +0100)
This reverts commit ae75b6f3666512887ae526f16a1ad41bbf2517ac.

gst/mpegdemux/mpegtspacketizer.c
gst/mpegdemux/mpegtspacketizer.h

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