playbin3 hang when one of video/audio/text track failed to setup in decodebin3

Jared Hu at
Wed Dec 14 06:40:07 UTC 2022


We found when use playbin3 as playback pipeline, it will hang at startup when one of video/audio/text track setup fail.

After some analysis, eg, when video track setup fail, the hang happens like below:

Parsebin post stream collection message to parent bin when it expose all src pad (video audio & text)
Playbin3 will handle stream collection message and do stream selection.
Playbin3 will continue request sink pad for selected stream, eg, video and audio pad.
But when setup video track in decodebin3, it failed (missing decoder) and didn't release playsink video pad.
Playsink will block sink pads until all pads receive something but video pad will never receive data.

Can we request playsink pads when decodebin emit no_more_pad signal, in this way, playsink only request the needed pads just like playbin2 do?

Attachment is my debug log, here I paste some key log:
Decoder selection fail:
0:00:00.196080488   785 0xffff7c06ee40 DEBUG             decodebin3 gstdecodebin3.c:2232:reconfigure_output_stream:<decodebin3-0> Reconfiguring output 0xffff74002490 to slot 0xffff80035f10, needs_decoder:1
0:00:00.200613128   785 0xffff7c06ee40 DEBUG             decodebin3 gstdecodebin3.c:2323:reconfigure_output_stream: Could not find an element for caps video/x-pn-realvideo, width=(int)1920, height=(int)1080, framerate=(fraction)785645/32768, codec_data=(buffer)000000225649444f5256343007800438000c000000000017f9da0148102040008000
0:00:00.200686688   785 0xffff7c06ee40 LOG               decodebin3 gstdecodebin3.c:2329:reconfigure_output_stream:<decodebin3-0> selection unlocking from thread 0xffff7c06ee40
0:00:00.200935928   785 0xffff7c06ee40 LOG               decodebin3 gstdecodebin3.c:2336:reconfigure_output_stream:<decodebin3-0> selection locking from thread 0xffff7c06ee40
0:00:00.200967608   785 0xffff7c06ee40 LOG               decodebin3 gstdecodebin3.c:2336:reconfigure_output_stream:<decodebin3-0> selection locked from thread 0xffff7c06ee40
0:00:00.200994968   785 0xffff7c06ee40 DEBUG             decodebin3 gstdecodebin3.c:2426:reconfigure_output_stream:<decodebin3-0> Cleanup

Audio pad is blocked, but video pad cannot been block, playsink only un block all pad when they are all blocked.
0:00:00.268118651   785 0xffff7c06eea0 LOG                 playsink gstplaysink.c:4425:sinkpad_blocked_cb:<playsink> locking from thread 0xffff7c06eea0
0:00:00.268144571   785 0xffff7c06eea0 LOG                 playsink gstplaysink.c:4425:sinkpad_blocked_cb:<playsink> locked from thread 0xffff7c06eea0
0:00:00.268166531   785 0xffff7c06eea0 DEBUG               playsink gstplaysink.c:4433:sinkpad_blocked_cb:<playsink:audio_sink> Audio pad blocked
0:00:00.268189451   785 0xffff7c06eea0 LOG                 playsink gstplaysink.c:4451:sinkpad_blocked_cb:<playsink> unlocking from thread 0xffff7c06eea0

Playsink: sinkpad_blocked_cb:
  if (gst_play_sink_ready_to_reconfigure_locked (playsink)) {
    GST_DEBUG_OBJECT (playsink, "All pads blocked -- reconfiguring");

    gst_play_sink_do_reconfigure (playsink);

    video_set_blocked (playsink, FALSE);
    audio_set_blocked (playsink, FALSE);
    text_set_blocked (playsink, FALSE);

Best regards
Jared Hu
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: playbin3.log
Type: application/octet-stream
Size: 95224 bytes
Desc: playbin3.log
URL: <>

More information about the gstreamer-devel mailing list