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 729114 - audiodecoder: default caps nego will manually fixate non-mutable caps
audiodecoder: default caps nego will manually fixate non-mutable caps
Product: GStreamer
Classification: Platform
Component: gst-plugins-base
git master
Other All
: Normal normal
: 1.3.1
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Reported: 2014-04-28 15:07 UTC by Haakon Sporsheim (ieei)
Modified: 2014-04-29 07:58 UTC
See Also:
GNOME target: ---
GNOME version: ---

Simple oneliner to make caps writable. (737 bytes, patch)
2014-04-28 15:07 UTC, Haakon Sporsheim (ieei)
committed Details | Review

Description Haakon Sporsheim (ieei) 2014-04-28 15:07:22 UTC
Created attachment 275355 [details] [review]
Simple oneliner to make caps writable.

gst_audio_decoder_negotiate_default_caps iterates over allowed caps and manually
fixates audio channels and rate using either gst_structure_set or gst_structure_fixate_field_nearest_int.

The latter asserts that the structure (parent caps) is mutable, which can fail.

Attached is a patch that makes the caps writable before manually fixating.
You might want to rewrite the whole function. Iterating over all internal structures before calling gst_caps_fixate which will truncate the caps anyway seems a bit of a waste.
Comment 1 Sebastian Dröge (slomo) 2014-04-29 07:58:49 UTC
commit 7c97a1c6cffbdc516ced11f7743c4292eae91e1d
Author: Haakon Sporsheim <>
Date:   Tue Apr 29 09:58:21 2014 +0200

    audiodecoder: Make caps writable before fixating