diff options
author | Stefan Kost <ensonic@users.sourceforge.net> | 2008-12-16 16:26:52 +0000 |
---|---|---|
committer | Stefan Kost <ensonic@users.sourceforge.net> | 2008-12-16 16:26:52 +0000 |
commit | 1ea02b7a383f461d948eaeba82adb248e01e9127 (patch) | |
tree | c925ec2a1f159ee0df72fc77276a95dac5244c36 /ext/celt | |
parent | da7ea42f920df07059e5eab0208fcaec535d187a (diff) | |
download | gstreamer-plugins-bad-1ea02b7a383f461d948eaeba82adb248e01e9127.tar.gz |
Totally remove the internal taglists and fully use tagsetter. Fixes various tag muxing issues.
Original commit message from CVS:
* ext/celt/gstceltenc.c:
* ext/celt/gstceltenc.h:
* ext/metadata/gstmetadatamux.c:
* gst/qtmux/gstqtmux.c:
* gst/qtmux/gstqtmux.h:
Totally remove the internal taglists and fully use tagsetter. Fixes
various tag muxing issues.
Diffstat (limited to 'ext/celt')
-rw-r--r-- | ext/celt/gstceltenc.c | 40 | ||||
-rw-r--r-- | ext/celt/gstceltenc.h | 2 |
2 files changed, 18 insertions, 24 deletions
diff --git a/ext/celt/gstceltenc.c b/ext/celt/gstceltenc.c index 58b3b299a..d76fd8860 100644 --- a/ext/celt/gstceltenc.c +++ b/ext/celt/gstceltenc.c @@ -513,30 +513,29 @@ gst_celt_enc_init (GstCeltEnc * enc, GstCeltEncClass * klass) static GstBuffer * gst_celt_enc_create_metadata_buffer (GstCeltEnc * enc) { - const GstTagList *user_tags; - GstTagList *merged_tags; + const GstTagList *tags; + GstTagList *empty_tags; GstBuffer *comments = NULL; - user_tags = gst_tag_setter_get_tag_list (GST_TAG_SETTER (enc)); + tags = gst_tag_setter_get_tag_list (GST_TAG_SETTER (enc)); - GST_DEBUG_OBJECT (enc, "upstream tags = %" GST_PTR_FORMAT, enc->tags); - GST_DEBUG_OBJECT (enc, "user-set tags = %" GST_PTR_FORMAT, user_tags); + GST_DEBUG_OBJECT (enc, "tags = %" GST_PTR_FORMAT, tags); - /* gst_tag_list_merge() will handle NULL for either or both lists fine */ - merged_tags = gst_tag_list_merge (user_tags, enc->tags, - gst_tag_setter_get_tag_merge_mode (GST_TAG_SETTER (enc))); - - if (merged_tags == NULL) - merged_tags = gst_tag_list_new (); - - GST_DEBUG_OBJECT (enc, "merged tags = %" GST_PTR_FORMAT, merged_tags); - comments = gst_tag_list_to_vorbiscomment_buffer (merged_tags, NULL, + if (tags == NULL) { + /* FIXME: better fix chain of callers to not write metadata at all, + * if there is none */ + empty_tags = gst_tag_list_new (); + tags = empty_tags; + } + comments = gst_tag_list_to_vorbiscomment_buffer (tags, NULL, 0, "Encoded with GStreamer Celtenc"); - gst_tag_list_free (merged_tags); GST_BUFFER_OFFSET (comments) = enc->bytes_out; GST_BUFFER_OFFSET_END (comments) = 0; + if (empty_tags) + gst_tag_list_free (empty_tags); + return comments; } @@ -685,12 +684,11 @@ gst_celt_enc_sinkevent (GstPad * pad, GstEvent * event) case GST_EVENT_TAG: { GstTagList *list; + GstTagSetter *setter = GST_TAG_SETTER (enc); + const GstTagMergeMode mode = gst_tag_setter_get_tag_merge_mode (setter); gst_event_parse_tag (event, &list); - if (enc->tags) { - gst_tag_list_insert (enc->tags, list, - gst_tag_setter_get_tag_merge_mode (GST_TAG_SETTER (enc))); - } + gst_tag_setter_merge_tags (setter, list, mode); res = gst_pad_event_default (pad, event); break; } @@ -983,7 +981,6 @@ gst_celt_enc_change_state (GstElement * element, GstStateChange transition) switch (transition) { case GST_STATE_CHANGE_NULL_TO_READY: - enc->tags = gst_tag_list_new (); break; case GST_STATE_CHANGE_READY_TO_PAUSED: enc->frameno = 0; @@ -1020,8 +1017,7 @@ gst_celt_enc_change_state (GstElement * element, GstStateChange transition) memset (&enc->header, 0, sizeof (enc->header)); break; case GST_STATE_CHANGE_READY_TO_NULL: - gst_tag_list_free (enc->tags); - enc->tags = NULL; + gst_tag_setter_reset_tags (GST_TAG_SETTER (enc)); default: break; } diff --git a/ext/celt/gstceltenc.h b/ext/celt/gstceltenc.h index 6dc7c96a6..c0c554b86 100644 --- a/ext/celt/gstceltenc.h +++ b/ext/celt/gstceltenc.h @@ -73,8 +73,6 @@ struct _GstCeltEnc { guint64 samples_in; guint64 bytes_out; - GstTagList *tags; - guint64 frameno; guint64 frameno_out; |