rtsp-server : Async done message handling in pause and play case
Submitted by Srimanta Panda (trollkarlen)
In scenario when server is loaded, if you perform pause and play, rtsp-server play response contains range starting from 0.
The issue is basically when a pause carried out the multiudpsink perfroms the asynchronous state change. This send s a ASYNC DONE message to the bus.
But if the pause and play is quick enough then play request (with range) tries to do the rtsp_media_seek before the ASYNC DONE message is handled. But while performing seek and flush stop event has executed, but not the new segment event, in-between the async done is performed and query command fails because have_segment of basesink is false and resets the rtsp-media range start value to zero.
And because of that the server tries to send a reply back with incorrect range which starts from zero because of the failed query during async done.
So overall the issue is media_seek should wait till the async done is performed.
The other scenario to reproduce the issue is to send pause and play (with range) multiple time simultaneously using a script.