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 123957 - [PATCH] multidisksrc should emit its new-file signal even if it failed to open it
[PATCH] multidisksrc should emit its new-file signal even if it failed to ope...
Status: RESOLVED OBSOLETE
Product: GStreamer
Classification: Platform
Component: gstreamer (core)
0.8.0
Other Linux
: Normal normal
: git master
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2003-10-06 14:36 UTC by Christophe Fergeau
Modified: 2005-11-22 21:27 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
reworked new-file signal emission (1.08 KB, patch)
2003-10-06 14:38 UTC, Christophe Fergeau
needs-work Details | Review
patch adding add-locations and remove-locations properties (5.70 KB, patch)
2003-10-07 12:03 UTC, Christophe Fergeau
needs-work Details | Review
same patch as previously with more properties added (compiles but not tested ;) (13.15 KB, patch)
2003-10-07 13:28 UTC, Christophe Fergeau
none Details | Review

Description Christophe Fergeau 2003-10-06 14:36:45 UTC
multidisksrc emits a new-file signal when it starts playing a new file. The
main purpose of this signal seems to be to let the user of multidisksrc be
able to free the file name and the memory used by the list if he wants to.
Consequently, this signal should be emitted even if multidisksrc fails to
open the current file. Here's a patch which does that
Comment 1 Christophe Fergeau 2003-10-06 14:38:39 UTC
Created attachment 20510 [details] [review]
reworked new-file signal emission
Comment 2 Ronald Bultje 2003-10-06 14:53:45 UTC
Shouldn't the plugin free such memory itself? Plugins are responsible
for their own memory management...
Comment 3 Christophe Fergeau 2003-10-06 15:06:40 UTC
Actually it's doing something very weird atm: the "locations" property
is a user-provided pointer to a GSList containing gchar*, and
multidisksrc doesn't copy this gslist, it only stores a pointer to it
(my guess is that it was done to allow the user of multidisksrc to add
files to the locations list without having to stop the element).
Comment 4 David Schleef 2003-10-06 18:49:24 UTC
That's ugly.  Feel free to implement something different.
Comment 5 Christophe Fergeau 2003-10-06 19:42:27 UTC
After discussing on IRC with Ronald, I made the "locations" property
read-only, and added "add-locations" and "remove-locations" write-only
properties which get a GSList* of filenames, and then copy it in an
internal GSList*
I'll attach the corresponding patch tomorrow morning
Comment 6 David Schleef 2003-10-06 19:52:35 UTC
Sounds good.  However, it makes more sense from an API standpoint to
have "add-location" that takes a gchar *.
Comment 7 Christophe Fergeau 2003-10-06 20:34:46 UTC
That's what was suggested at first, but I think a gobject "notify"
signal would be emitted each time you add a song to the src, which
would be suboptimal if the user of the src wants to queue 100 or 1000
songs imo.
Comment 8 David Schleef 2003-10-06 21:40:52 UTC
I don't think that 100 or 1000 songs are a target application for
multidisksrc.  Or rather, it _shouldn't_ be.  An element that can
handle 100-1000 files easily should have a much more powerful API.

(btw, we'd eventually like to make multidisksrc a subclass of filesrc.
 If you don't want to do that yourself, that's cool, but it would be a
good thing to keep in mind while working on it.)
Comment 9 Ronald Bultje 2003-10-07 09:18:53 UTC
You can use both properties. So "locations" is aread-only and returns
the internal list. "add-location" and "remove-location" adds and
removes a single file (gchar *), and "add-locations" and
"remove-locations" removes a GSList * of files.

Oh, and this filesrc-as-parent-of-multidisksrc is a really cool idea,
I favour that, too.
Comment 10 Christophe Fergeau 2003-10-07 12:01:14 UTC
I'll attach what I have done so far in case there are some "do that,
don't do that comments". I'll add the "add-location" and
"remove-location" properties. I don't have the slightest idea how I
could make multidisksrc be a subclass of filesrc (and don't have much
time to learn how to do it), so I'll let that to someone else :) What
I can do though is rename multidisksrc to multifilesrc as it is
suggested in another bug.
Comment 11 Christophe Fergeau 2003-10-07 12:03:39 UTC
Created attachment 20530 [details] [review]
patch adding add-locations and remove-locations properties
Comment 12 Christophe Fergeau 2003-10-07 12:05:38 UTC
For the record, there is more brokeness in the current code dealing
with the new_file signal: the .h files say the signal handler will
receive a gchar * corresponding to the new file name, while the code
passes a GSList* when it emits the signal.
Comment 13 Ronald Bultje 2003-10-07 12:23:44 UTC
Subclassing of filesrc allows to use filesrc's file_open() and
file_close() routines, which do all read()/mmap() bladiebla. They can
also do the signalling, which would mean filesrc/multifilesrc use
exactly the same signals. This should make multifilesrc's code a lot
simpler, too.

And for the record, the other multidisksrc bug is #122200.

Thanks for the work, evne though you didn't subclass it. ;).
Comment 14 Christophe Fergeau 2003-10-07 13:28:37 UTC
Created attachment 20532 [details] [review]
same patch as previously with more properties added (compiles but not tested ;)
Comment 15 Stephane Loeuillet 2004-12-19 11:15:34 UTC
ok, so what is multidisksrc ? look like the grandpa of multifilesrc

if yes, is this patch applicable/needed to multifilesrc or should this be closed ?
Comment 16 Edward Hervey 2005-11-22 21:27:47 UTC
doesn't exist anymore... DIE DIE DIE !