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 623301 - gst_caps_normalize : doesn't normalize completely
gst_caps_normalize : doesn't normalize completely
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gstreamer (core)
git master
Other Linux
: Normal blocker
: 0.10.30
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2010-07-01 15:58 UTC by Edward Hervey
Modified: 2010-07-01 16:20 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Fix + unit test (3.84 KB, patch)
2010-07-01 15:58 UTC, Edward Hervey
committed Details | Review

Description Edward Hervey 2010-07-01 15:58:16 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.
Comment 1 Tim-Philipp Müller 2010-07-01 16:11:36 UTC
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 :)
Comment 2 Edward Hervey 2010-07-01 16:19:02 UTC
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