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 701943 - playbin: unit tests fail
playbin: unit tests fail
Product: GStreamer
Classification: Platform
Component: gst-plugins-base
git master
Other Linux
: Normal blocker
: 1.1.2
Assigned To: GStreamer Maintainers
GStreamer Maintainers
: 702895 (view as bug list)
Depends on:
Reported: 2013-06-10 15:53 UTC by Branko Subasic
Modified: 2013-07-10 11:23 UTC
See Also:
GNOME target: ---
GNOME version: ---

Description Branko Subasic 2013-06-10 15:53:31 UTC
Cloned gstreamer and gst-plugins-base 20130610. Ran unit tests, and the following tests for playbin fail:

test_uri, test_sink_usage_video_only_stream, test_suburi_error_wrongproto, test_suburi_error_invalidfile, test_suburi_error_unknowntype, test_refcount, test_source_setup

They all deadlock on line 343 in gst/playback/gststreamsynchronizer.c, waiting on a condition that's never signaled. 

The following lines 'GST_DEBUG=2,streamsynchronizer:5  GST_CHECKS=test_refcount make elements/playbin.check' produces the following output:
0:00:00.028108833  2458       0xcadd80 DEBUG     streamsynchronizer gststreamsynchronizer.c:800:gst_stream_synchronizer_change_state:<streamsynchronizer0> State change NULL->READY
0:00:00.028206148  2458       0xcadd80 DEBUG     streamsynchronizer gststreamsynchronizer.c:826:gst_stream_synchronizer_change_state:<streamsynchronizer0> Base class state changed returned: 1
0:00:00.028699312  2458       0xcadd80 DEBUG     streamsynchronizer gststreamsynchronizer.c:804:gst_stream_synchronizer_change_state:<streamsynchronizer0> State change READY->PAUSED
0:00:00.028751856  2458       0xcadd80 DEBUG     streamsynchronizer gststreamsynchronizer.c:826:gst_stream_synchronizer_change_state:<streamsynchronizer0> Base class state changed returned: 1
0:00:00.039262243  2458       0xcb10f0 DEBUG     streamsynchronizer gststreamsynchronizer.c:656:gst_stream_synchronizer_request_new_pad:<streamsynchronizer0> Requesting new pad for stream 0
0:00:00.040052190  2458       0xcb10f0 DEBUG     streamsynchronizer gststreamsynchronizer.c:276:gst_stream_synchronizer_sink_event:<streamsynchronizer0:sink_0> Stream 0 changed
0:00:00.040123686  2458       0xcb10f0 DEBUG     streamsynchronizer gststreamsynchronizer.c:291:gst_stream_synchronizer_sink_event:<streamsynchronizer0> All streams have changed -- unblocking
0:00:00.040167315  2458       0xcb10f0 DEBUG     streamsynchronizer gststreamsynchronizer.c:316:gst_stream_synchronizer_sink_event:<streamsynchronizer0> New group start time: 0:00:00.000000000
0:00:00.056724870  2458       0xcb10f0 WARN      streamsynchronizer gststreamsynchronizer.c:381:gst_stream_synchronizer_sink_event:<streamsynchronizer0:sink_0> Non-TIME segment: bytes
0:00:00.056913955  2458       0xcb10f0 DEBUG     streamsynchronizer gststreamsynchronizer.c:341:gst_stream_synchronizer_sink_event:<streamsynchronizer0:sink_0> Stream 0 is waiting

A little debugging shows that two SEGMENT events are received, the first sent by the basesrc when it starts, and the second is sent by the inputselector element when it receives the first buffer, and before it forwards it it pushes pending events, among which is a SEGMENT event. When the first SEGMENT event arrives to the streamsyncronizer it will set it's stream->wait flag to TRUE, because the segment is not in TIME format. When the second arrives it will check if the ->wait flag is TRUE, and if so it will wait for the stream->stream_finish_cond to be signaled, which will never happen because there are no other streams.

Finally backtraces of the threads:

Comment 1 Sebastian Dröge (slomo) 2013-07-10 08:26:17 UTC
*** Bug 702895 has been marked as a duplicate of this bug. ***
Comment 2 Sebastian Dröge (slomo) 2013-07-10 11:23:05 UTC
commit d7f1d9954fd16de65e20fee9f05422359a1c793d
Author: Sebastian Dröge <>
Date:   Wed Jul 10 13:22:04 2013 +0200

    playbin: Store a/v/t sinks locally too, not just in playsink

commit 4c1fc764075183628d474ba808693655c1cfc048
Author: Sebastian Dröge <>
Date:   Wed Jul 10 13:21:29 2013 +0200

    playsink: ref_sink() any sinks that are set on playsink
    Otherwise the behaviour of the properties is inconsistent.

commit f2bc24a5a9ff8507f1e7fe8d10cb395a1775029b
Author: Sebastian Dröge <>
Date:   Wed Jul 10 13:20:34 2013 +0200

    playbin: Fix assumptions in the unit test
    Unused sinks are still set to READY now during autoplugging
    to check their caps. Also playsink owns a ref to the sinks too.

commit 043c1888f33e0928e66da398fe5283493f4cae13
Author: Sebastian Dröge <>
Date:   Wed Jul 10 13:00:21 2013 +0200

    streamsynchronizer: Non-TIME segment streams are not waiting automatically
    This was leftover code from porting to 1.0 and fixes the playbin
    unit test.