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 340174 - locking problem in gstbasesink
locking problem in gstbasesink
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gstreamer (core)
0.10.x
Other Linux
: Normal major
: 0.10.6
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2006-04-30 10:23 UTC by Philippe Rouquier
Modified: 2006-05-08 11:49 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
proposed patch (1.84 KB, patch)
2006-04-30 10:23 UTC, Philippe Rouquier
committed Details | Review

Description Philippe Rouquier 2006-04-30 10:23:19 UTC
I hope this won't be a bold comment again ;).

When changing state from PLAYING to PAUSED basesink tries to lock the PREROLL_LOCK (line 2476). It does the same thing before calling the ::render method of the object in gst_base_sink_queue_object (line 1664). So far so good.

But, if the sink is in ::render, blocking to wait for a condition that would allow it to write (like fdsink blocking on select(), waiting for the file descriptor to be ready for a write) it might block since gst_base_sink_change_state calls the ::unlock method of the object AFTER trying to take the PREROLL_LOCK

One obvious solution (and working though not necessarily the best) would be to call the ::unlock method before trying to take the preroll_lock in gst_base_sink_change_state.

Sorry if I'm not clear enough.

NOTE: I noticed that the same problem can happen in gst_base_sink_set_flushing ()
Comment 1 Philippe Rouquier 2006-04-30 10:23:51 UTC
Created attachment 64552 [details] [review]
proposed patch
Comment 2 Wim Taymans 2006-05-02 09:52:44 UTC
this looks indeed like a real problem. We seem to only use the unlock method in fdsink, currently.
Comment 3 Wim Taymans 2006-05-08 11:49:59 UTC
        Patch by: Philippe Rouquier <philippero at libertysurf dot fr>

        * libs/gst/base/gstbasesink.c: (gst_base_sink_set_flushing),
        (gst_base_sink_change_state):
        call ::unlock before taking the PREROLL_LOCK so we can safely
        handle elements that lock in ::render.
        Fixes #340174.