GNOME Bugzilla – Bug 562794
rtspsrc fails to create a socket on Win32 sometimes.
Last modified: 2009-02-24 11:14:35 UTC
Please describe the problem: gstrtspconnection.c contains code calling WSAStartup()/WSACleanup() which is not ballanced well. So it could lock up whole WinSock. Steps to reproduce: 1. set up a pipeline containing rtspsrc. 2. let it run 3. if pipeline reports an error on its bus, set it to GST_STATE_NULL 4. wait a while, and issue GST_STATE_PLAYING Actual results: After several tries, rtspsrc fails to create a socket because WSAStartup() is not called. Expected results: Does this happen every time? Yes, I think Other information: In my opinion, WSAStartup/Cleanup should not be called from plugins at all.
Created attachment 123710 [details] [review] Fixes #562794
Q: Is it possible to restart a pipeline (containing rtspsrc) when connection failure reported on the bus? If it's possible, what is a proper procedure then? NULL -> PLAYING method shown above never worked for me :-( Thanks.
to Comment #2, you should go back to NULL after an error and then back to PLAYING.
It would be nice if we did not have to call these functions in a library but I guess it does not hurt. Below is a patch that still calls the functions but at create/destroy time to make sure they are always matched correctly. commit bb5e2d3f56a994b42a84678661bbc097709c890b Author: Wim Taymans <wim.taymans@collabora.co.uk> Date: Tue Feb 24 12:11:00 2009 +0100 Match WSAStartup and WSACleanup correctly Don't randomly call WSAStartup and WSACleanup but instead call the startup when we create a connection and cleanup when we free it again. Because the internal datastructure is refcounted, this should not cause any refcounting leaks when the connection is managed correctly. Fixes #562794.