From: <en...@ke...> - 2008-12-16 09:38:11
|
CVS Root: /cvs/gstreamer Module: gstreamer Changes by: ensonic Date: Tue Dec 16 2008 09:38:08 UTC Log message: * gst/gsttaglist.c: Avoid copy of empty taglist. Modified files: . : ChangeLog gst : gsttaglist.c Links: http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/ChangeLog.diff?r1=1.4195&r2=1.4196 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/gst/gsttaglist.c.diff?r1=1.67&r2=1.68 ====Begin Diffs==== Index: ChangeLog =================================================================== RCS file: /cvs/gstreamer/gstreamer/ChangeLog,v retrieving revision 1.4195 retrieving revision 1.4196 diff -u -d -r1.4195 -r1.4196 --- ChangeLog 16 Dec 2008 09:23:18 -0000 1.4195 +++ ChangeLog 16 Dec 2008 09:37:51 -0000 1.4196 @@ -1,6 +1,11 @@ 2008-12-16 Stefan Kost <en...@us...> * gst/gsttaglist.c: + Avoid copy of empty taglist. + +2008-12-16 Stefan Kost <en...@us...> + * gst/gsttaglist.c: * tests/check/gst/gsttag.c: More complete unit tests. Fix handling of empty taglists (they were not merged before). Index: gsttaglist.c RCS file: /cvs/gstreamer/gstreamer/gst/gsttaglist.c,v retrieving revision 1.67 retrieving revision 1.68 diff -u -d -r1.67 -r1.68 --- gsttaglist.c 16 Dec 2008 09:23:21 -0000 1.67 +++ gsttaglist.c 16 Dec 2008 09:37:53 -0000 1.68 @@ -692,8 +692,8 @@ gst_tag_list_merge (const GstTagList * list1, const GstTagList * list2, GstTagMergeMode mode) { - const GstTagList *list1_cp, *list2_cp; - GstTagList *ret; + GstTagList *list1_cp; + const GstTagList *list2_cp; g_return_val_if_fail (list1 == NULL || GST_IS_TAG_LIST (list1), NULL); g_return_val_if_fail (list2 == NULL || GST_IS_TAG_LIST (list2), NULL); @@ -705,18 +705,15 @@ } /* create empty list, we need to do this to correctly handling merge modes */ - list1_cp = (list1) ? list1 : gst_tag_list_new (); + list1_cp = (list1) ? gst_tag_list_copy (list1) : gst_tag_list_new (); list2_cp = (list2) ? list2 : gst_tag_list_new (); - ret = gst_tag_list_copy (list1_cp); - gst_tag_list_insert (ret, list2_cp, mode); + gst_tag_list_insert (list1_cp, list2_cp, mode); - if (!list1) - gst_tag_list_free ((GstTagList *) list1_cp); if (!list2) gst_tag_list_free ((GstTagList *) list2_cp); - return ret; + return list1_cp; } /** |