diff options
author | Sebastian Dröge <slomo@circular-chaos.org> | 2008-09-01 17:49:59 +0000 |
---|---|---|
committer | Sebastian Dröge <slomo@circular-chaos.org> | 2008-09-01 17:49:59 +0000 |
commit | 7ac077828f3fed0104757f2ce2407d69417823ea (patch) | |
tree | 0fa7df98f4d726d4b3a8bffbce108bf562fe19be /gst/mpegtsmux/tsmux | |
parent | b24d38315f03bdc84700e4da4bbd62563c9c0f1f (diff) | |
download | gst-plugins-bad-7ac077828f3fed0104757f2ce2407d69417823ea.tar.gz gst-plugins-bad-7ac077828f3fed0104757f2ce2407d69417823ea.tar.bz2 gst-plugins-bad-7ac077828f3fed0104757f2ce2407d69417823ea.zip |
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.
Diffstat (limited to 'gst/mpegtsmux/tsmux')
-rw-r--r-- | gst/mpegtsmux/tsmux/tsmux.c | 8 | ||||
-rw-r--r-- | gst/mpegtsmux/tsmux/tsmuxstream.c | 8 |
2 files changed, 8 insertions, 8 deletions
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; |