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 328423 - [gnomevfs] doesn't handle case when gnomevfs can't init
[gnomevfs] doesn't handle case when gnomevfs can't init
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-base
git master
Other Linux
: Normal normal
: 0.10.2
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2006-01-24 13:03 UTC by Andy Wingo
Modified: 2006-02-06 19:12 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Andy Wingo 2006-01-24 13:03:23 UTC
There are cases when gnomevfs can't init. Mostly this is if there is no ~/.gnome2 directory, and that directory can't be made. However our plugin doesn't check the return value of gnome_vfs_init(), just assuming that it succeeds.

Either we:

 - call _init in the instance init, as we do now, and store the result in a variable that makes the plugin refuse to go to READY
 - call _init() in NULL->READY
 - call _init() in the plugin init
 - somehow make upstream not check for .gnome2 (why does it need it?) -- but it's possible there are other ways it can fail (e.g. bonobo)

c.f. https://core.fluendo.com/flumotion/trac/ticket/278
Comment 1 Tim-Philipp Müller 2006-01-24 13:42:46 UTC
One thing to keep in mind here is gst_element_make_from_uri() and how it goes by rank. If gnomevfssrc cannot be used because it fails to initialise for some reason, it would be good if another element with a lower rank was chosen for a specific uri.

That's why I'd go for calling _init() in the plugin init function and setting a flag somewhere. If _init() fails, gnomevfssrc is registered with GST_RANK_NONE, otherwise it is registered with the original rank. In NULL => READY state change the flag is checked and state change fails if _init() failed earlier. Not registering the element at all when _init() fails can only lead to confusion IMHO.


Comment 2 Andy Wingo 2006-01-24 17:35:22 UTC
Ah yes. Well I suppose the best is to return False from the plugin's init function, to indicate an error loading the plugin. That will prevent plugin registration, and therefore plugin instantiation.
Comment 3 Tim-Philipp Müller 2006-02-06 19:12:46 UTC
Fixed as you suggested:

2006-02-06  Tim-Philipp Müller  <tim at centricular dot net>

       * ext/gnomevfs/gstgnomevfs.c: (plugin_init):
         Return FALSE from plugin_init() when GnomeVFS can't
         be initialised for some reason (#328423).