decodebin2: Fix detecting when a group or chain is really done
Submitted by GstBlub
Link to original bug (#794099)
Description
Created attachment 369367
decodebin2: Fix detecting when a group or chain is really done
I ran into a problem where decodebin2 accidentally emits the "drained" signal (which an application could act on) and then causes the pipeline to stall with the demuxer continuing on. This happened when using hlsdemux with a video stream, but without any (suitable) video decoder plugin present. The application intentionally ignores the typefind error as we're only interested in the audio portion. This works fine until hlsdemux triggers a bitrate switch, which causes decodebin2 to believe everything is drained (despite the new pads being added and properly signalled). When this happens there are two chains in a group, one for the video portion (that isn't active) and one for the audio portion.
I attached a patch that appears to fix this issue for me. Since I'm not too familiar with this code, I'd appreciate any feedback.
Patch 369367, "decodebin2: Fix detecting when a group or chain is really done":
0001-decodebin2-Fix-detecting-when-a-group-or-chain-is-re.patch