static ogg_packet *
_ogg_packet_copy (const ogg_packet * packet)
{
- ogg_packet *ret = g_new0 (ogg_packet, 1);
+ ogg_packet *ret = g_slice_new (ogg_packet);
*ret = *packet;
ret->packet = g_memdup (packet->packet, packet->bytes);
_ogg_packet_free (ogg_packet * packet)
{
g_free (packet->packet);
- g_free (packet);
+ g_slice_free (ogg_packet, packet);
}
static ogg_page *
gst_ogg_page_copy (ogg_page * page)
{
- ogg_page *p = g_new0 (ogg_page, 1);
+ ogg_page *p = g_slice_new (ogg_page);
/* make a copy of the page */
p->header = g_memdup (page->header, page->header_len);
{
g_free (page->header);
g_free (page->body);
- g_free (page);
+ g_slice_free (ogg_page, page);
}
static gboolean gst_ogg_demux_collect_chain_info (GstOggDemux * ogg,
static GstOggChain *
gst_ogg_chain_new (GstOggDemux * ogg)
{
- GstOggChain *chain = g_new0 (GstOggChain, 1);
+ GstOggChain *chain = g_slice_new0 (GstOggChain);
GST_DEBUG_OBJECT (ogg, "creating new chain %p", chain);
chain->ogg = ogg;
gst_object_unref (pad);
}
g_array_free (chain->streams, TRUE);
- g_free (chain);
+ g_slice_free (GstOggChain, chain);
}
static void
g_list_foreach (stream->unknown_pages, (GFunc) gst_mini_object_unref, NULL);
g_list_foreach (stream->stored_buffers, (GFunc) gst_mini_object_unref, NULL);
- g_free (stream);
+ g_slice_free (GstOggStream, stream);
}
static void
GST_DEBUG_OBJECT (parser, "creating new stream %08x", serialno);
- stream = g_new0 (GstOggStream, 1);
+ stream = g_slice_new0 (GstOggStream);
stream->serialno = serialno;
stream->in_headers = 1;