summaryrefslogtreecommitdiffstats
path: root/gst/real
diff options
context:
space:
mode:
Diffstat (limited to 'gst/real')
-rw-r--r--gst/real/gstrealaudiodec.c14
-rw-r--r--gst/real/gstrealvideodec.c20
2 files changed, 23 insertions, 11 deletions
diff --git a/gst/real/gstrealaudiodec.c b/gst/real/gstrealaudiodec.c
index 1a94a77b..5f5b900d 100644
--- a/gst/real/gstrealaudiodec.c
+++ b/gst/real/gstrealaudiodec.c
@@ -262,12 +262,20 @@ open_library (GstRealAudioDec * dec, gint version, GstRADecLibrary * lib)
GST_LOG_OBJECT (dec, "opening module %s", codec);
- lib->module = g_module_open (codec, G_MODULE_BIND_LAZY);
+ /* This is racy, but it doesn't matter here; would be nice if GModule
+ * gave us a GError instead of an error string, but it doesn't, so.. */
+ if (g_file_test (codec, G_FILE_TEST_EXISTS)) {
+ lib->module = g_module_open (codec, G_MODULE_BIND_LAZY);
+ if (lib->module == NULL) {
+ GST_ERROR_OBJECT (dec, "Could not open codec library '%s': %s",
+ codec, g_module_error ());
+ }
+ } else {
+ GST_DEBUG_OBJECT (dec, "%s does not exist", codec);
+ }
g_free (codec);
if (lib->module)
goto codec_search_done;
-
- GST_LOG_OBJECT (dec, "failure, try next one...");
}
}
diff --git a/gst/real/gstrealvideodec.c b/gst/real/gstrealvideodec.c
index 74cb6f5a..313a99f2 100644
--- a/gst/real/gstrealvideodec.c
+++ b/gst/real/gstrealvideodec.c
@@ -480,7 +480,17 @@ open_library (GstRealVideoDec * dec, GstRealVideoDecVersion version,
gchar *codec = g_strconcat (split_path[i], "/", split_names[j], NULL);
GST_DEBUG_OBJECT (dec, "trying %s", codec);
- module = g_module_open (codec, G_MODULE_BIND_LAZY);
+ /* This is racy, but it doesn't matter here; would be nice if GModule
+ * gave us a GError instead of an error string, but it doesn't, so.. */
+ if (g_file_test (codec, G_FILE_TEST_EXISTS)) {
+ module = g_module_open (codec, G_MODULE_BIND_LAZY);
+ if (module == NULL) {
+ GST_ERROR_OBJECT (dec, "Could not open codec library '%s': %s",
+ codec, g_module_error ());
+ }
+ } else {
+ GST_LOG_OBJECT (dec, "%s does not exist", codec);
+ }
g_free (codec);
if (module)
goto codec_search_done;
@@ -492,7 +502,7 @@ codec_search_done:
g_strfreev (split_names);
if (module == NULL)
- goto could_not_open;
+ return FALSE;
GST_DEBUG_OBJECT (dec, "module opened, finding symbols");
@@ -527,12 +537,6 @@ unknown_version:
GST_ERROR_OBJECT (dec, "Cannot handle version %i.", version);
return FALSE;
}
-could_not_open:
- {
- GST_ERROR_OBJECT (dec, "Could not open library '%s' in '%s': %s", names,
- path, g_module_error ());
- return FALSE;
- }
could_not_load:
{
close_library (dec, lib);