How to clear a rtsp pipeline properly if its source suddenly stops

I need to handle this case. What I have done is to add a probe to the sink of the pipeline and then I try to stop the pipeline if frames do not come anymore in 4s.
However, the pipeline seems not stopped after the state of the pipeline is simply set to NULL. Later on a bus error message showed up. I would like to clear the pipeline immediately(not destroyed) and avoid the bus message. One idea is to pause the pipeline first and flush it. Then stop it. Is this the right way to do it?

I was able to stop RTSP pipeline by sending EOS event. Can you try that?

I do not want to send EOS event. The problem is solved.

Can you please share your solution? Maybe it will help others in the future :slight_smile:

I have different pipelines for different things and the top class has handler of EOS event in my app. For example, I have code to play a audio or video file in a loop and EOS event is used for restart when needed.