From 7ac077828f3fed0104757f2ce2407d69417823ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Mon, 1 Sep 2008 17:49:59 +0000 Subject: gst/mpegtsmux/mpegtsmux_aac.c: Allocate a fixed size buffer on the stack instead of using malloc(). Original commit message from CVS: * gst/mpegtsmux/mpegtsmux_aac.c: (mpegtsmux_prepare_aac): Allocate a fixed size buffer on the stack instead of using malloc(). * gst/mpegtsmux/tsmux/tsmux.c: (tsmux_new), (tsmux_free), (tsmux_program_new), (tsmux_program_free): * gst/mpegtsmux/tsmux/tsmuxstream.c: (tsmux_stream_new), (tsmux_stream_free), (tsmux_stream_consume), (tsmux_stream_add_data): Use GSlice. --- gst/mpegtsmux/tsmux/tsmux.c | 8 ++++---- gst/mpegtsmux/tsmux/tsmuxstream.c | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) (limited to 'gst/mpegtsmux/tsmux') diff --git a/gst/mpegtsmux/tsmux/tsmux.c b/gst/mpegtsmux/tsmux/tsmux.c index 0952f699..ffb92388 100644 --- a/gst/mpegtsmux/tsmux/tsmux.c +++ b/gst/mpegtsmux/tsmux/tsmux.c @@ -130,7 +130,7 @@ tsmux_new () { TsMux *mux; - mux = g_new0 (TsMux, 1); + mux = g_slice_new0 (TsMux); mux->transport_id = TSMUX_DEFAULT_TS_ID; @@ -229,7 +229,7 @@ tsmux_free (TsMux * mux) } g_list_free (mux->streams); - g_free (mux); + g_slice_free (TsMux, mux); } /** @@ -252,7 +252,7 @@ tsmux_program_new (TsMux * mux) if (mux->nb_programs == TSMUX_MAX_PROGRAMS) return NULL; - program = g_new0 (TsMuxProgram, 1); + program = g_slice_new0 (TsMuxProgram); program->pmt_changed = TRUE; program->last_pmt_ts = -1; @@ -811,7 +811,7 @@ tsmux_program_free (TsMuxProgram * program) g_return_if_fail (program != NULL); g_array_free (program->streams, TRUE); - g_free (program); + g_slice_free (TsMuxProgram, program); } static gboolean diff --git a/gst/mpegtsmux/tsmux/tsmuxstream.c b/gst/mpegtsmux/tsmux/tsmuxstream.c index 74b3c82b..342bb9ea 100644 --- a/gst/mpegtsmux/tsmux/tsmuxstream.c +++ b/gst/mpegtsmux/tsmux/tsmuxstream.c @@ -115,7 +115,7 @@ struct TsMuxStreamBuffer TsMuxStream * tsmux_stream_new (guint16 pid, TsMuxStreamType stream_type) { - TsMuxStream *stream = g_new0 (TsMuxStream, 1); + TsMuxStream *stream = g_slice_new0 (TsMuxStream); stream->state = TSMUX_STREAM_STATE_HEADER; stream->pi.pid = pid; @@ -193,7 +193,7 @@ tsmux_stream_free (TsMuxStream * stream) { g_return_if_fail (stream != NULL); - g_free (stream); + g_slice_free (TsMuxStream, stream); } /** @@ -243,7 +243,7 @@ tsmux_stream_consume (TsMuxStream * stream, guint len) stream->cur_buffer->user_data); } - g_free (stream->cur_buffer); + g_slice_free (TsMuxStreamBuffer, stream->cur_buffer); stream->cur_buffer = NULL; /* FIXME: As a hack, for unbounded streams, start a new PES packet for each * incoming packet we receive. This assumes that incoming data is @@ -571,7 +571,7 @@ tsmux_stream_add_data (TsMuxStream * stream, guint8 * data, guint len, g_return_if_fail (stream != NULL); - packet = g_new (TsMuxStreamBuffer, 1); + packet = g_slice_new (TsMuxStreamBuffer); packet->data = data; packet->size = len; packet->user_data = user_data; -- cgit v1.2.1