GST_DEBUG_OBJECT (enc, "start");
speex_bits_init (&enc->bits);
- enc->tags = gst_tag_list_new ();
+ enc->tags = gst_tag_list_new_empty ();
enc->header_sent = FALSE;
return TRUE;
g_slist_foreach (enc->headers, (GFunc) gst_buffer_unref, NULL);
enc->headers = NULL;
+ gst_tag_setter_reset_tags (GST_TAG_SETTER (enc));
+
return TRUE;
}
gst_tag_setter_get_tag_merge_mode (GST_TAG_SETTER (enc)));
if (merged_tags == NULL)
- merged_tags = gst_tag_list_new ();
+ merged_tags = gst_tag_list_new_empty ();
GST_DEBUG_OBJECT (enc, "merged tags = %" GST_PTR_FORMAT, merged_tags);
comments = gst_tag_list_to_vorbiscomment_buffer (merged_tags, NULL,
gint frame_size = enc->frame_size;
gint bytes = frame_size * 2 * enc->channels, samples;
gint outsize, written, dtx_ret = 0;
- guint8 *data, *bdata, *outdata;
+ guint8 *data, *data0 = NULL, *bdata, *outdata;
gsize bsize, size;
GstBuffer *outbuf;
GstFlowReturn ret = GST_FLOW_OK;
GST_DEBUG_OBJECT (enc, "draining; adding silence samples");
size = ((bsize / bytes) + 1) * bytes;
- data = g_malloc0 (size);
+ data0 = data = g_malloc0 (size);
memcpy (data, bdata, bsize);
gst_buffer_unmap (buf, bdata, bsize);
bdata = NULL;
outbuf, samples);
done:
+ g_free (data0);
return ret;
}