GNOME Bugzilla – Bug 623301
gst_caps_normalize : doesn't normalize completely
Last modified: 2010-07-01 16:20:05 UTC
Created attachment 165034 [details] [review] Fix + unit test First of all : yes, I know, it's a regression I introduced over a year ago in commit 5d819beffba6d7f33f09317e4abdff2fa2450e93. Right now gst_caps_normalize() doesn't expand/normalize if structures are added in some previous passes because we don't recalculate the new size of the newcaps. This leads to the following problems : input caps : some/type, foo=(string){ 1 , 2 }, bar=(string) { 3 } normalized caps : some/type, foo=(string) 1, bar=(string) 3; some/type, foo=(string) 2, bar=(string) 3 actual current result : some/type, foo=(string) 1, bar=(string) 3; some/type, foo=(string) 2, bar=(string) { 3 } Find attached fix and unit test.
Seems pretty straight-forward to me, let's get that in for the next pre-release. The unit test looks like it could be shortened a bit with a utility function or an array of in/out-string-pairs and a loop, but then I guess it's just a unit test :)
commit 70d1f1f177fae7c5743ec7614d152f5cbe80a9d9 Author: Edward Hervey <bilboed@bilboed.com> Date: Thu Jul 1 17:56:33 2010 +0200 gstcaps: Make sure _normalize() is applied on all structures. We need to use gst_caps_get_size() in the loop counter since some structures could be added while iterating. Fixes #623301