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 646118 - [gstmultiqueue] if arbitrary sink number is specified by caller, use this as single queue id
[gstmultiqueue] if arbitrary sink number is specified by caller, use this as ...
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gstreamer (core)
unspecified
Other All
: Normal normal
: 0.10.33
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2011-03-29 15:23 UTC by Andreas Frisch
Modified: 2011-03-30 08:53 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
[gstmultiqueue] if arbitrary sink number is specified by caller, use this as single queue id (3.20 KB, patch)
2011-03-29 15:23 UTC, Andreas Frisch
none Details | Review
[gstmultiqueue] if arbitrary sink number is specified by caller, use this as single queue id (3.10 KB, patch)
2011-03-29 15:27 UTC, Andreas Frisch
needs-work Details | Review
[gstmultiqueue] if arbitrary sink number is specified by caller, use as single queue id if not already taken, otherwise increase until free (3.53 KB, patch)
2011-03-29 22:01 UTC, Andreas Frisch
committed Details | Review

Description Andreas Frisch 2011-03-29 15:23:44 UTC
use sscanf to extract desired sink number if explicitely specified. otherwise use zero based counter
Comment 1 Andreas Frisch 2011-03-29 15:23:46 UTC
Created attachment 184599 [details] [review]
[gstmultiqueue] if arbitrary sink number is specified by caller, use this as single queue id
Comment 2 Andreas Frisch 2011-03-29 15:27:54 UTC
Created attachment 184600 [details] [review]
[gstmultiqueue] if arbitrary sink number is specified by caller, use this as single queue id
Comment 3 Sebastian Dröge (slomo) 2011-03-29 18:53:10 UTC
Review of attachment 184600 [details] [review]:

::: plugins/elements/gstmultiqueue.c
@@ +598,3 @@
+    sscanf (name + 4, "%d", &id);
+  } else
+    id = mqueue->nbqueues++;

You should hold the multiqueue mutex while accessing the nbqueues variable. Also double check (while holding that mutex) that the ID is not used yet when a name was provided by the caller
Comment 4 Andreas Frisch 2011-03-29 22:01:52 UTC
Created attachment 184635 [details] [review]
[gstmultiqueue] if arbitrary sink number is specified by caller, use as single queue id if not already taken, otherwise increase until free

not sure if this behaviour is what you intendend, or if you preferred erroring out in case the pad/id number already exist
Comment 5 Sebastian Dröge (slomo) 2011-03-30 08:53:21 UTC
commit 8db570f48cf129ae28e36bab58729017d7577a78
Author: Sebastian Dröge <sebastian.droege@collabora.co.uk>
Date:   Wed Mar 30 10:48:47 2011 +0200

    multiqueue: Make assignment of queue IDs and pad names threadsafe
    
    Also add a test for naming pads by the caller and return NULL
    when requesting an already existing pad.

commit 5368406a57bbc8e2a72768797a16302aa888907f
Author: Andreas Frisch <fraxinas@opendreambox.org>
Date:   Tue Mar 29 23:58:43 2011 +0200

    multiqueue: Set the single queue ID to the ID of the requested pad if one wa