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 573823 - pad block callback if it is re-blocked while the previous callback is running
pad block callback if it is re-blocked while the previous callback is running
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gstreamer (core)
git master
Other Linux
: Normal normal
: 0.10.23
Assigned To: Wim Taymans
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2009-03-02 21:12 UTC by Olivier Crête
Modified: 2009-03-09 10:52 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch to add a test case to the unit tests (3.33 KB, patch)
2009-03-02 21:13 UTC, Olivier Crête
committed Details | Review
Patch to try to fix the problem (4.20 KB, patch)
2009-03-02 21:17 UTC, Olivier Crête
committed Details | Review

Description Olivier Crête 2009-03-02 21:12:27 UTC
There is a race if while a pad block callback if executed, after it has done gst_pad_set_blocked_sync(FALSE), another thread re-sets it to true. The pad will never be unblocked and the second callback will never be called.

I'm attaching a patch, but I'm not sure its the right approach, maybe a counter would be better.
Comment 1 Olivier Crête 2009-03-02 21:13:17 UTC
Created attachment 129886 [details] [review]
Patch to add a test case to the unit tests
Comment 2 Olivier Crête 2009-03-02 21:17:39 UTC
Created attachment 129887 [details] [review]
Patch to try to fix the problem

This patch just adds a "called" flag that is unset when a new callbacks is set and unset once its called, it should ensure that a callback is at least called once. Does it make sense?
Comment 3 Wim Taymans 2009-03-09 10:52:09 UTC
sorry, wrong author field here..

commit da0060d3aadb15d6a05812a17c9a32db82c1c4ec
Author: Wim Taymans <wim.taymans@collabora.co.uk>
Date:   Mon Mar 9 11:39:34 2009 +0100

    pad: call new callbacks set in the block callback
    
    Keep track of when a new callback is installed in the callback and call the new
    callback in that case.
    Add unit test for checking pad blocking.
    Fixes #573823.