summaryrefslogtreecommitdiffstats
path: root/gst
diff options
context:
space:
mode:
Diffstat (limited to 'gst')
-rw-r--r--gst/mpegtsmux/mpegtsmux_aac.c3
-rw-r--r--gst/mpegtsmux/tsmux/tsmux.c8
-rw-r--r--gst/mpegtsmux/tsmux/tsmuxstream.c8
3 files changed, 9 insertions, 10 deletions
diff --git a/gst/mpegtsmux/mpegtsmux_aac.c b/gst/mpegtsmux/mpegtsmux_aac.c
index 71727f21..5afefc83 100644
--- a/gst/mpegtsmux/mpegtsmux_aac.c
+++ b/gst/mpegtsmux/mpegtsmux_aac.c
@@ -93,7 +93,7 @@ GST_DEBUG_CATEGORY_EXTERN (mpegtsmux_debug);
GstBuffer *
mpegtsmux_prepare_aac (GstBuffer * buf, MpegTsPadData * data, MpegTsMux * mux)
{
- guint8 *adts_header = g_malloc0 (7);
+ guint8 adts_header[7] = { 0, };
GstBuffer *out_buf = gst_buffer_new_and_alloc (GST_BUFFER_SIZE (buf) + 7);
gsize out_offset = 0;
guint8 rate_idx = 0, channels = 0, obj_type = 0;
@@ -140,7 +140,6 @@ mpegtsmux_prepare_aac (GstBuffer * buf, MpegTsPadData * data, MpegTsMux * mux)
/* Insert ADTS header */
memcpy (GST_BUFFER_DATA (out_buf) + out_offset, adts_header, 7);
- g_free (adts_header);
out_offset += 7;
/* Now copy complete frame */
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;