diff options
author | Stefan Kost <ensonic@users.sourceforge.net> | 2008-12-16 11:57:01 +0000 |
---|---|---|
committer | Stefan Kost <ensonic@users.sourceforge.net> | 2008-12-16 11:57:01 +0000 |
commit | b067b814538fc453e5d889b56789c68f914cc1a0 (patch) | |
tree | d67ad50dc7d2c45bc3bb8e805799a9e783dfbe96 /gst/avi | |
parent | 8add29398d86b9daf4d03c1c1d9d808c009c1309 (diff) |
gst/avi/gstavimux.*: Totally remove the internal taglists and fully use tagsetter.
Original commit message from CVS:
* gst/avi/gstavimux.c:
* gst/avi/gstavimux.h:
Totally remove the internal taglists and fully use tagsetter.
Diffstat (limited to 'gst/avi')
-rw-r--r-- | gst/avi/gstavimux.c | 36 | ||||
-rw-r--r-- | gst/avi/gstavimux.h | 4 |
2 files changed, 8 insertions, 32 deletions
diff --git a/gst/avi/gstavimux.c b/gst/avi/gstavimux.c index 697ae9ee..3a9e91dc 100644 --- a/gst/avi/gstavimux.c +++ b/gst/avi/gstavimux.c @@ -383,15 +383,6 @@ gst_avi_mux_reset (GstAviMux * avimux) avimux->avi_hdr.max_bps = 10000000; avimux->codec_data_size = 0; - if (avimux->tags) { - gst_tag_list_free (avimux->tags); - avimux->tags = NULL; - } - if (avimux->tags_snap) { - gst_tag_list_free (avimux->tags_snap); - avimux->tags_snap = NULL; - } - g_free (avimux->idx); avimux->idx = NULL; @@ -958,8 +949,7 @@ gst_avi_mux_write_tag (const GstTagList * list, const gchar * tag, static GstBuffer * gst_avi_mux_riff_get_avi_header (GstAviMux * avimux) { - GstTagList *tags; - const GstTagList *iface_tags; + const GstTagList *tags; GstBuffer *buffer; guint8 *buffdata; guint size = 0; @@ -972,24 +962,13 @@ gst_avi_mux_riff_get_avi_header (GstAviMux * avimux) GST_DEBUG_OBJECT (avimux, "creating avi header, data_size %u, idx_size %u", avimux->data_size, avimux->idx_size); - /* need to take snapshot of tags now */ - iface_tags = gst_tag_setter_get_tag_list (GST_TAG_SETTER (avimux)); - if ((iface_tags || avimux->tags) && !avimux->tags_snap) { - /* gst_tag_list_merge() will handle NULL for either or both lists fine */ - tags = gst_tag_list_merge (iface_tags, avimux->tags, - gst_tag_setter_get_tag_merge_mode (GST_TAG_SETTER (avimux))); - gst_tag_list_add (tags, GST_TAG_MERGE_REPLACE, GST_TAG_ENCODER, - PACKAGE_STRING " AVI muxer", NULL); - } else { - tags = avimux->tags_snap; - } - avimux->tags_snap = tags; - if (avimux->tags_snap) { + tags = gst_tag_setter_get_tag_list (GST_TAG_SETTER (avimux)); + if (tags) { /* that should be the strlen of all tags + header sizes * not all of tags end up in a avi, still this is a good estimate */ - gchar *str = gst_structure_to_string (avimux->tags_snap); - size += strlen (str) + 8 * gst_structure_n_fields (avimux->tags_snap); + gchar *str = gst_structure_to_string (tags); + size += strlen (str) + 8 * gst_structure_n_fields (tags); g_free (str); } @@ -1689,10 +1668,11 @@ gst_avi_mux_handle_event (GstPad * pad, GstEvent * event) switch (GST_EVENT_TYPE (event)) { case GST_EVENT_TAG:{ GstTagList *list; + GstTagSetter *setter = GST_TAG_SETTER (avimux); + const GstTagMergeMode mode = gst_tag_setter_get_tag_merge_mode (setter); gst_event_parse_tag (event, &list); - avimux->tags = gst_tag_list_merge (avimux->tags, list, - gst_tag_setter_get_tag_merge_mode (GST_TAG_SETTER (avimux))); + gst_tag_setter_merge_tags (setter, list, mode); break; } default: diff --git a/gst/avi/gstavimux.h b/gst/avi/gstavimux.h index 6fb9a475..f3b0665d 100644 --- a/gst/avi/gstavimux.h +++ b/gst/avi/gstavimux.h @@ -148,10 +148,6 @@ struct _GstAviMux { gboolean write_header; gboolean restart; - /* tags */ - GstTagList *tags; - GstTagList *tags_snap; - /* information about the AVI index ('idx') */ gst_riff_index_entry *idx; gint idx_index, idx_count; |