best way to flush data in sink/queue

Mailing List SVR lists at svrinformatica.it
Mon Oct 2 14:40:35 UTC 2017


Hi,

I have to receive and playback a network stream, it basically works 
fine, I have a pipeline that receive audio and video and ends with 
something like this:

... ! queue ! videosink
... ! queue ! audiosink

sometime, when the stream start, the server sends about 10 seconds of 
data in one second of time. Since video and audio are played synced on 
the clock a delay is introduced. This is supposed to be a live stream 
even if it sometimes behaves in this strange way.

I can see that the queues overrun when the data arrives very fast and I 
would like to flush the queued data (from the queue and/or the sink) 
when this happen so I can play real time data, old data can be dropped 
in my use case. What is the best way to flush old data? After some 
searchs and looking at the code it seems that I can send a flush_stop 
event, are there better ways?

Of course I can manually handle this situation using appsink/appsrc and 
dropping data in appsink when the queue overrun and/or do something 
similar in a pad probe but I would like to avoid this manual handling if 
possibile,

thanks
Nicola


More information about the gstreamer-devel mailing list