Connecting to some signals of a GstElement errors with "too much recursion"
System information
What is your operating system and version? Fedora 36
What is your version of GJS? 1.72.2
Bug information
Steps to reproduce
Run this code:
import GLib from 'gi://GLib';
import Gst from 'gi://Gst';
Gst.init(null);
const pipeline = Gst.ElementFactory.make('playbin', 'playbin');
pipeline.connect('about-to-finish', () => { console.log('about to finish') });
pipeline.connect('source-setup', () => { console.log('source setup') });
pipeline.connect('element-setup', () => { console.log('element setup') });
pipeline.set_property('uri', 'file:///path/to/audio.ogg');
pipeline.set_state(Gst.State.PLAYING);
const loop = GLib.MainLoop.new(null, false);
loop.run();
Current behaviour
When the signal is emitted, there's a different behavior depending on the signal:
-
about-to-finish
: a singleGjs-CRITICAL **: 14:23:12.521: JS ERROR: too much recursion
-
source-setup
: works as expected -
element-setup
: works at first, then prints empty errors and a singletoo much recursion
:Gjs-Console-Message: 09:36:51.653: element setup Gjs-Console-Message: 09:36:51.654: element setup Gjs-Console-Message: 09:36:51.655: element setup Gjs-Console-Message: 09:36:51.655: element setup (gjs:370164): Gjs-WARNING **: 09:36:51.668: JS ERROR: (gjs:370164): Gjs-WARNING **: 09:36:51.668: JS ERROR: (gjs:370164): Gjs-WARNING **: 09:36:51.894: JS ERROR: (gjs:370164): Gjs-WARNING **: 09:36:51.898: JS ERROR: (gjs:370164): Gjs-WARNING **: 09:36:51.898: JS ERROR: (gjs:370164): Gjs-CRITICAL **: 09:36:51.899: JS ERROR: too much recursion @file:///home/romain/test.js:13:6 (gjs:370164): Gjs-WARNING **: 09:36:51.899: JS ERROR: (gjs:370164): Gjs-WARNING **: 09:36:51.899: JS ERROR: (gjs:370164): Gjs-WARNING **: 09:36:51.899: JS ERROR: (gjs:370164): Gjs-WARNING **: 09:36:51.899: JS ERROR: (gjs:370164): Gjs-WARNING **: 09:36:51.899: JS ERROR: (gjs:370164): Gjs-WARNING **: 09:36:51.899: JS ERROR:
Expected behaviour
The callback function should be called.