After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 395554 - gst_tag_setter_merge_tags works at most once
gst_tag_setter_merge_tags works at most once
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gstreamer (core)
git master
Other All
: Normal normal
: 0.10.12
Assigned To: Tim-Philipp Müller
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2007-01-11 20:24 UTC by René Stadler
Modified: 2007-01-12 10:49 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Fix gst_tag_setter_merge_tags (352 bytes, patch)
2007-01-11 20:25 UTC, René Stadler
committed Details | Review

Description René Stadler 2007-01-11 20:24:11 UTC
Fun question: What's wrong with this code from gst/gsttagsetter.c:

void
gst_tag_setter_merge_tags (GstTagSetter * setter, const GstTagList * list,
    GstTagMergeMode mode)
{
  GstTagData *data;

  g_return_if_fail (GST_IS_TAG_SETTER (setter));
  g_return_if_fail (GST_TAG_MODE_IS_VALID (mode));

  data = gst_tag_setter_get_data (setter);
  if (!data->list) {
    data->list = gst_tag_list_copy (list);
  } else {
    gst_tag_list_merge (data->list, list, mode);
  }
}

Answer: gst_tag_list_merge merges the two lists that are passed to it and _returns_ the result as a new list.  Note how the return value is ignored here.  The solution is to use gst_tag_list_insert instead.  Attaching trivial patch.
Comment 1 René Stadler 2007-01-11 20:25:29 UTC
Created attachment 80066 [details] [review]
Fix gst_tag_setter_merge_tags
Comment 2 Tim-Philipp Müller 2007-01-12 10:49:07 UTC
 2007-01-11  Tim-Philipp Müller  <tim at centricular dot net>

        Patch by: René Stadler <mail at renestadler dot de>

        * gst/gsttagsetter.c: (gst_tag_setter_merge_tags):
          gst_tag_list_merge() returns a new list, so it's not the best idea
          to ingore its return value. Effectively meant that tags could only
          be merged on a GstTagSetter once using _merge_tags(). Fixes #395554.
          Also add function guard to require a non-NULL taglist as input (has
          always been so due to gst_tag_list_copy(), just making it explicit).