emotion: temporary fix gstreamer uri to match other engine behaviour.
authorcedric <cedric@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Thu, 16 Jun 2011 15:29:29 +0000 (15:29 +0000)
committercedric <cedric@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Thu, 16 Jun 2011 15:29:29 +0000 (15:29 +0000)
git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/emotion@60398 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

src/modules/gstreamer/emotion_gstreamer_pipeline.c

index 9429659..7493aa2 100644 (file)
@@ -1,3 +1,9 @@
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#define _GNU_SOURCE
+
 #include <unistd.h>
 #include <fcntl.h>
 
@@ -109,22 +115,27 @@ _emotion_pipeline_build(Emotion_Gstreamer_Video *ev, const char *file)
      }
    g_object_set(G_OBJECT(ev->pipeline), "audio-sink", sink, NULL);
 
-   if ((*file == '/') || (*file == '~'))
+   if (strstr(file, "://") == NULL)
      {
-       char *uri;
+       Eina_Strbuf *sbuf;
 
-       uri = g_filename_to_uri(file, NULL, NULL);
-       if (uri)
-         {
-           DBG("Setting file %s\n", uri);
-           g_object_set(G_OBJECT(ev->pipeline), "uri", uri, NULL);
-           free(uri);
-         }
-       else
-         {
-           ERR("could not create new uri from %s", file);
-           goto unref_pipeline;
-         }
+       sbuf = eina_strbuf_new();
+       eina_strbuf_append(sbuf, "file://");
+       if (*file != '.' && *file != '/')
+        {
+          char *tmp;
+
+          tmp = get_current_dir_name();
+          eina_strbuf_append(sbuf, tmp);
+          eina_strbuf_append(sbuf, "/");
+          free(tmp);
+        }
+       eina_strbuf_append(sbuf, file);
+
+       DBG("Setting file %s\n", eina_strbuf_string_get(sbuf));
+       g_object_set(G_OBJECT(ev->pipeline), "uri", eina_strbuf_string_get(sbuf), NULL);
+
+       eina_strbuf_free(sbuf);
      }
    else
      {