playbin2 flush doesn't travel upstream
Submitted by James
Created attachment 372712
test app to show problem. Can be built to send flush to appsrc or playbin.
I have an application that constructs a playbin2 based pipeline. It uses an appsrc element to write TS muxed data in push mode. The application has a need to flush the pipeline when starting playback of a new stream and it does this by sending a flush-start, flush-stop pair of events to the playbin.
We've recently updated from GStreamer 1.4.x to 1.8.3 and found that the appsrc elements aren't receiving the flush events when the playbin is flushed (they did when using 1.4). The particular change that caused this behaviour was introduced in 1.6.1 by https://cgit.freedesktop.org/gstreamer/gst-plugins-base/commit/gst/playback/gstplaybin2.c?h=1.6&id=cfb6d6e7b44fedddeb6aa6f0fdb1189541d3d035.
The GStreamer examples and documentation that I've seen state that flush events should be sent to the pipeline and my application has followed this advice. Since this change has been in place for so long I find it hard to believe that this is a bug so I'm looking for advice on whether the application behaviour is correct. I've attempted to reproduce the logic in a test application (see attached) and can confirm it's broken on 1.8.3 and git master. The test app builds a pipeline, pushes a large amount of data, then after 1 second issues a flush. If the flush is sent to the appsrc then all is well, however if it's sent to the playbin then it doesn't travel to the appsrc.
Should playbin/pipeline send the events upstream to the appsrc in push-mode? or should my app always have been sending the flush events to the appsrc?
Attachment 372712, "test app to show problem. Can be built to send flush to appsrc or playbin.":