diff options
author | Mark Nauwelaerts <mark.nauwelaerts@collabora.co.uk> | 2009-01-06 17:48:10 +0000 |
---|---|---|
committer | Mark Nauwelaerts <mark.nauwelaerts@collabora.co.uk> | 2009-01-06 17:48:10 +0000 |
commit | 85c6c25264b54c3a04675183e5281bbd23120a72 (patch) | |
tree | ef9a34d5e76f2a9880aada0f6d646bb93411ef8f | |
parent | b506ab991808be4a38858a93dda617ad235b1d6a (diff) |
gst/matroska/matroska-mux.*: Remove internal taglist and fully use tagsetter interface.
Original commit message from CVS:
* gst/matroska/matroska-mux.c: (gst_matroska_mux_reset),
(gst_matroska_mux_handle_sink_event), (gst_matroska_mux_finish):
* gst/matroska/matroska-mux.h:
Remove internal taglist and fully use tagsetter interface.
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | gst/matroska/matroska-mux.c | 23 | ||||
-rw-r--r-- | gst/matroska/matroska-mux.h | 2 |
3 files changed, 15 insertions, 17 deletions
@@ -1,5 +1,12 @@ 2009-01-06 Mark Nauwelaerts <mark.nauwelaerts@collabora.co.uk> + * gst/matroska/matroska-mux.c: (gst_matroska_mux_reset), + (gst_matroska_mux_handle_sink_event), (gst_matroska_mux_finish): + * gst/matroska/matroska-mux.h: + Remove internal taglist and fully use tagsetter interface. + +2009-01-06 Mark Nauwelaerts <mark.nauwelaerts@collabora.co.uk> + * gst/avi/gstavimux.c: (gst_avi_mux_reset), (gst_avi_mux_riff_get_avi_header): * gst/avi/gstavimux.h: diff --git a/gst/matroska/matroska-mux.c b/gst/matroska/matroska-mux.c index 3299d5f3..e16b9350 100644 --- a/gst/matroska/matroska-mux.c +++ b/gst/matroska/matroska-mux.c @@ -463,10 +463,7 @@ gst_matroska_mux_reset (GstElement * element) mux->cluster_pos = 0; /* reset tags */ - if (mux->tags) { - gst_tag_list_free (mux->tags); - mux->tags = NULL; - } + gst_tag_setter_reset_tags (GST_TAG_SETTER (mux)); } /** @@ -518,7 +515,9 @@ gst_matroska_mux_handle_sink_event (GstPad * pad, GstEvent * event) switch (GST_EVENT_TYPE (event)) { case GST_EVENT_TAG: + GST_DEBUG_OBJECT (mux, "received tag event"); gst_event_parse_tag (event, &list); + collect_pad = (GstMatroskaPad *) gst_pad_get_element_private (pad); g_assert (collect_pad); context = collect_pad->track; @@ -528,12 +527,8 @@ gst_matroska_mux_handle_sink_event (GstPad * pad, GstEvent * event) * 639-2 according to matroska specs, but it will have to do for now */ gst_tag_list_get_string (list, GST_TAG_LANGUAGE_CODE, &context->language); - if (mux->tags) { - gst_tag_list_insert (mux->tags, list, GST_TAG_MERGE_PREPEND); - } else { - mux->tags = gst_tag_list_copy (list); - } - + gst_tag_setter_merge_tags (GST_TAG_SETTER (mux), list, + gst_tag_setter_get_tag_merge_mode (GST_TAG_SETTER (mux))); break; case GST_EVENT_NEWSEGMENT: /* We don't support NEWSEGMENT events */ @@ -1801,7 +1796,7 @@ gst_matroska_mux_finish (GstMatroskaMux * mux) guint64 pos; guint64 duration = 0; GSList *collected; - GstTagList *tags; + const GstTagList *tags; /* finish last cluster */ if (mux->cluster) { @@ -1838,10 +1833,9 @@ gst_matroska_mux_finish (GstMatroskaMux * mux) } /* tags */ - tags = gst_tag_list_merge (gst_tag_setter_get_tag_list (GST_TAG_SETTER (mux)), - mux->tags, GST_TAG_MERGE_APPEND); + tags = gst_tag_setter_get_tag_list (GST_TAG_SETTER (mux)); - if (tags != NULL) { + if (tags != NULL && !gst_tag_list_is_empty (tags)) { guint64 master_tags, master_tag; GST_DEBUG ("Writing tags"); @@ -1853,7 +1847,6 @@ gst_matroska_mux_finish (GstMatroskaMux * mux) gst_tag_list_foreach (tags, gst_matroska_mux_write_simple_tag, ebml); gst_ebml_write_master_finish (ebml, master_tag); gst_ebml_write_master_finish (ebml, master_tags); - gst_tag_list_free (tags); } /* update seekhead. We know that: diff --git a/gst/matroska/matroska-mux.h b/gst/matroska/matroska-mux.h index 57828036..4ca0035f 100644 --- a/gst/matroska/matroska-mux.h +++ b/gst/matroska/matroska-mux.h @@ -131,8 +131,6 @@ typedef struct _GstMatroskaMux { cluster_time, cluster_pos; - /* tags */ - GstTagList *tags; } GstMatroskaMux; typedef struct _GstMatroskaMuxClass { |