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 741893 - inputselector: Get the active sinkpad again after taking the lock when handling events
inputselector: Get the active sinkpad again after taking the lock when handli...
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gstreamer (core)
git master
Other Linux
: Normal normal
: 1.5.1
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2014-12-23 05:40 UTC by kevin
Modified: 2014-12-23 11:59 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch to fix the issue. (933 bytes, patch)
2014-12-23 05:46 UTC, kevin
committed Details | Review

Description kevin 2014-12-23 05:40:28 UTC
I found below patch remove one line one latest code. But the line is critical and can't removed. We should keep get the active sink pad in lock as change active sink pad also work in lock. Attached patch to fix the issue.

commit 82850026934b3c89465ac8d02e671d6268ba1586
Author: Stefan Sauer <ensonic@users.sf.net>
Date:   Fri Oct 3 14:01:59 2014 +0200

    input-selector: small code cleanups
    
    Rename TIMESTAMP -> PTS. Move a var down to the scope where it is used. Use
    g_queue_free_full().

@@ -470,7 +465,6 @@ gst_selector_pad_event (GstPad * pad, GstObject * parent, GstEvent * event)
     gst_object_unref (prev_active_sinkpad);
 
   GST_INPUT_SELECTOR_LOCK (sel);
-  active_sinkpad = gst_input_selector_activate_sinkpad (sel, pad);
 
   /* only forward if we are dealing with the active sinkpad */
   forward = (pad == active_sinkpad);
Comment 1 kevin 2014-12-23 05:46:36 UTC
Created attachment 293221 [details] [review]
patch to fix the issue.
Comment 2 Sebastian Dröge (slomo) 2014-12-23 11:57:38 UTC
Thanks for the patch, but please attach patches in "git format-patch" format :)

commit 12a905929f239eb8fe111527d2244d19c6a97efa
Author: Sebastian Dröge <sebastian@centricular.com>
Date:   Tue Dec 23 12:54:50 2014 +0100

    inputselector: Keep a ref of the currently active sinkpad around
    
    Otherwise we can't be sure that the pointer points to a still existing
    pad instance after releasing the lock.

commit 3137043c3a63748a882409dd75ab9706b7f3b09c
Author: Song Bing <b06498@freescale.com>
Date:   Tue Dec 23 12:53:58 2014 +0100

    inputselector: Get the active sinkpad again after taking the lock when handling events
    
    It might have changed in the meantime.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=741893