From: Sebastian Dröge Date: Wed, 27 Jun 2012 14:42:10 +0000 (+0200) Subject: videodecoder: Use GSlice to allocate the timestamp tracking structures X-Git-Tag: 1.19.3~511^2~6280 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=43e94eea982da7783ec4a3871ce0baca7c9c92fc;p=platform%2Fupstream%2Fgstreamer.git videodecoder: Use GSlice to allocate the timestamp tracking structures --- diff --git a/gst-libs/gst/video/gstvideodecoder.c b/gst-libs/gst/video/gstvideodecoder.c index 55437ad..77e37da 100644 --- a/gst-libs/gst/video/gstvideodecoder.c +++ b/gst-libs/gst/video/gstvideodecoder.c @@ -1433,12 +1433,18 @@ struct _Timestamp }; static void +timestamp_free (Timestamp * ts) +{ + g_slice_free (Timestamp, ts); +} + +static void gst_video_decoder_add_timestamp (GstVideoDecoder * decoder, GstBuffer * buffer) { GstVideoDecoderPrivate *priv = decoder->priv; Timestamp *ts; - ts = g_malloc (sizeof (Timestamp)); + ts = g_slice_new (Timestamp); GST_LOG_OBJECT (decoder, "adding PTS %" GST_TIME_FORMAT " DTS %" GST_TIME_FORMAT @@ -1479,7 +1485,7 @@ gst_video_decoder_get_timestamp_at_offset (GstVideoDecoder * *pts = ts->pts; *dts = ts->dts; *duration = ts->duration; - g_free (ts); + timestamp_free (ts); g = g->next; decoder->priv->timestamps = g_list_remove (decoder->priv->timestamps, ts); } else { @@ -1549,7 +1555,7 @@ gst_video_decoder_reset (GstVideoDecoder * decoder, gboolean full) priv->frame_offset = 0; gst_adapter_clear (priv->input_adapter); gst_adapter_clear (priv->output_adapter); - g_list_free_full (priv->timestamps, (GDestroyNotify) g_free); + g_list_free_full (priv->timestamps, (GDestroyNotify) timestamp_free); priv->timestamps = NULL; if (priv->current_frame) {