[farsight2/master] Allocate CodecBlueprints using GSlice

Olivier Crête olivier.crete at collabora.co.uk
Tue Dec 23 15:22:33 PST 2008


---
 gst/fsrtpconference/fs-rtp-codec-cache.c       |    2 +-
 gst/fsrtpconference/fs-rtp-discover-codecs.c   |    4 ++--
 gst/fsrtpconference/fs-rtp-dtmf-event-source.c |    2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/gst/fsrtpconference/fs-rtp-codec-cache.c b/gst/fsrtpconference/fs-rtp-codec-cache.c
index e08d829..76d9f4b 100644
--- a/gst/fsrtpconference/fs-rtp-codec-cache.c
+++ b/gst/fsrtpconference/fs-rtp-codec-cache.c
@@ -163,7 +163,7 @@ read_codec_blueprint_string (gchar **in, gsize *size, gchar **str) {
 
 static CodecBlueprint *
 load_codec_blueprint (FsMediaType media_type, gchar **in, gsize *size) {
-  CodecBlueprint *codec_blueprint = g_new0 (CodecBlueprint, 1);
+  CodecBlueprint *codec_blueprint = g_slice_new0 (CodecBlueprint);
   gchar *tmp;
   gint tmp_size;
   int i;
diff --git a/gst/fsrtpconference/fs-rtp-discover-codecs.c b/gst/fsrtpconference/fs-rtp-discover-codecs.c
index 229f70d..2f5ee76 100644
--- a/gst/fsrtpconference/fs-rtp-discover-codecs.c
+++ b/gst/fsrtpconference/fs-rtp-discover-codecs.c
@@ -554,7 +554,7 @@ parse_codec_cap_list (GList *list, FsMediaType media_type)
 
   another:
 
-    codec_blueprint = g_new0 (CodecBlueprint, 1);
+    codec_blueprint = g_slice_new0 (CodecBlueprint);
     codec_blueprint->codec = codec;
     codec_blueprint->media_caps = gst_caps_copy (codec_cap->caps);
     codec_blueprint->rtp_caps = gst_caps_copy (codec_cap->rtp_caps);
@@ -937,7 +937,7 @@ codec_blueprint_destroy (CodecBlueprint *codec_blueprint)
   g_list_free (codec_blueprint->receive_pipeline_factory);
 
 
-  g_free (codec_blueprint);
+  g_slice_free (CodecBlueprint, codec_blueprint);
 }
 
 void
diff --git a/gst/fsrtpconference/fs-rtp-dtmf-event-source.c b/gst/fsrtpconference/fs-rtp-dtmf-event-source.c
index 343b6b1..2d6328a 100644
--- a/gst/fsrtpconference/fs-rtp-dtmf-event-source.c
+++ b/gst/fsrtpconference/fs-rtp-dtmf-event-source.c
@@ -162,7 +162,7 @@ fs_rtp_dtmf_event_source_class_add_blueprint (FsRtpSpecialSourceClass *klass,
     if (skip)
       continue;
 
-    new_bp = g_new0 (CodecBlueprint, 1);
+    new_bp = g_slice_new0 (CodecBlueprint);
 
     new_bp->codec = fs_codec_new (FS_CODEC_ID_ANY, "telephone-event",
         FS_MEDIA_TYPE_AUDIO, bp->codec->clock_rate);
-- 
1.5.6.5




More information about the farsight-commits mailing list