mpegtsdemux: drop use of GSlice

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3695>
This commit is contained in:
Tim-Philipp Müller 2023-01-08 18:46:03 +00:00 committed by GStreamer Marge Bot
parent 85eb323b08
commit 2b4b23d2a2
2 changed files with 8 additions and 9 deletions

View file

@ -94,7 +94,7 @@ get_pcr_table (MpegTSPacketizer2 * packetizer, guint16 pid)
res->prev_out_time = GST_CLOCK_TIME_NONE;
res->pcroffset = 0;
res->current = g_slice_new0 (PCROffsetCurrent);
res->current = g_new0 (PCROffsetCurrent, 1);
}
return res;
@ -104,7 +104,7 @@ static void
pcr_offset_group_free (PCROffsetGroup * group)
{
g_free (group->values);
g_slice_free (PCROffsetGroup, group);
g_free (group);
}
static void
@ -115,8 +115,7 @@ flush_observations (MpegTSPacketizer2 * packetizer)
for (i = 0; i < packetizer->lastobsid; i++) {
g_list_free_full (packetizer->observations[i]->groups,
(GDestroyNotify) pcr_offset_group_free);
if (packetizer->observations[i]->current)
g_slice_free (PCROffsetCurrent, packetizer->observations[i]->current);
g_free (packetizer->observations[i]->current);
g_free (packetizer->observations[i]);
packetizer->observations[i] = NULL;
}
@ -1788,7 +1787,7 @@ _reevaluate_group_pcr_offset (MpegTSPCR * pcrtable, PCROffsetGroup * group)
static PCROffsetGroup *
_new_group (guint64 pcr, guint64 offset, guint64 pcr_offset, guint flags)
{
PCROffsetGroup *group = g_slice_new0 (PCROffsetGroup);
PCROffsetGroup *group = g_new0 (PCROffsetGroup, 1);
GST_DEBUG ("Input PCR %" GST_TIME_FORMAT " offset:%" G_GUINT64_FORMAT
" pcr_offset:%" G_GUINT64_FORMAT " flags:%d",

View file

@ -2165,7 +2165,7 @@ gst_ts_demux_stream_flush (TSDemuxStream * stream, GstTSDemux * tsdemux,
for (tmp = stream->pending; tmp; tmp = tmp->next) {
PendingBuffer *pend = (PendingBuffer *) tmp->data;
gst_buffer_unref (pend->buffer);
g_slice_free (PendingBuffer, pend);
g_free (pend);
}
g_list_free (stream->pending);
stream->pending = NULL;
@ -3448,7 +3448,7 @@ gst_ts_demux_push_pending_data (GstTSDemux * demux, TSDemuxStream * stream,
if (G_UNLIKELY (stream->pending_ts && !check_pending_buffers (demux))) {
if (buffer) {
PendingBuffer *pend;
pend = g_slice_new0 (PendingBuffer);
pend = g_new0 (PendingBuffer, 1);
pend->buffer = buffer;
pend->pts = stream->raw_pts;
pend->dts = stream->raw_dts;
@ -3459,7 +3459,7 @@ gst_ts_demux_push_pending_data (GstTSDemux * demux, TSDemuxStream * stream,
n = gst_buffer_list_length (buffer_list);
for (i = 0; i < n; i++) {
PendingBuffer *pend;
pend = g_slice_new0 (PendingBuffer);
pend = g_new0 (PendingBuffer, 1);
pend->buffer = gst_buffer_ref (gst_buffer_list_get (buffer_list, i));
pend->pts = i == 0 ? stream->raw_pts : -1;
pend->dts = i == 0 ? stream->raw_dts : -1;
@ -3493,7 +3493,7 @@ gst_ts_demux_push_pending_data (GstTSDemux * demux, TSDemuxStream * stream,
res = gst_pad_push (stream->pad, pend->buffer);
stream->nb_out_buffers += 1;
g_slice_free (PendingBuffer, pend);
g_free (pend);
}
g_list_free (stream->pending);
stream->pending = NULL;