After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 562794 - rtspsrc fails to create a socket on Win32 sometimes.
rtspsrc fails to create a socket on Win32 sometimes.
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-base
git master
Other All
: Normal normal
: 0.10.23
Assigned To: Wim Taymans
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2008-11-30 20:08 UTC by 이문형
Modified: 2009-02-24 11:14 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Fixes #562794 (958 bytes, patch)
2008-11-30 20:10 UTC, 이문형
committed Details | Review

Description 이문형 2008-11-30 20:08:31 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.
Comment 1 이문형 2008-11-30 20:10:55 UTC
Created attachment 123710 [details] [review]
Fixes #562794
Comment 2 이문형 2008-11-30 20:28:01 UTC
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.
Comment 3 Wim Taymans 2009-02-24 10:52:19 UTC
to Comment #2, you should go back to NULL after an error and then back to PLAYING.
Comment 4 Wim Taymans 2009-02-24 11:14:35 UTC
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.