msmith gstreamer: gstreamer/ gstreamer/gst/

[email protected]
Newsgroups gmane.comp.video.gstreamer.cvs
Message-ID <[email protected]>
CVS Root:       /cvs/gstreamer
Module:         gstreamer
Changes by:     msmith
Date:           Thu Nov 20 2008  20:45:11 UTC

Log message:
    * gst/gstregistrybinary.c:
      In win32 codepath, if we fail to write the registry, create the
      directory for it and try again, matching the behaviour in non-win32
      codepaths.

Modified files:
    .               : ChangeLog
    gst             : gstregistrybinary.c

Links:
http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/ChangeLog.diff?r1=1.4165&r2=1.4166
http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/gst/gstregistrybinary.c.diff?r1=1.41&r2=1.42

====Begin Diffs====
Index: ChangeLog
===================================================================
RCS file: /cvs/gstreamer/gstreamer/ChangeLog,v
retrieving revision 1.4165
retrieving revision 1.4166
diff -u -d -r1.4165 -r1.4166
--- ChangeLog	20 Nov 2008 14:23:03 -0000	1.4165
+++ ChangeLog	20 Nov 2008 20:44:54 -0000	1.4166
@@ -1,3 +1,10 @@
+2008-11-20  Michael Smith <[email protected]>
+
+	* gst/gstregistrybinary.c:
+	  In win32 codepath, if we fail to write the registry, create the
+	  directory for it and try again, matching the behaviour in non-win32
+	  codepaths.
 2008-11-20  Wim Taymans  <[email protected]>
 
 	* libs/gst/base/gstbasesink.c: (gst_base_sink_set_render_delay):
Index: gstregistrybinary.c
RCS file: /cvs/gstreamer/gstreamer/gst/gstregistrybinary.c,v
retrieving revision 1.41
retrieving revision 1.42
diff -u -d -r1.41 -r1.42
--- gstregistrybinary.c	12 Nov 2008 10:39:25 -0000	1.41
+++ gstregistrybinary.c	20 Nov 2008 20:44:56 -0000	1.42
@@ -134,9 +134,21 @@
   GError *error = NULL;
   if (!g_file_set_contents (cache->location, (const gchar *) cache->mem,
           cache->len, &error)) {
-    GST_ERROR ("Failed to write to cache file: %s", error->message);
+    /* Probably the directory didn't exist; create it */
+    gchar *dir;
+    dir = g_path_get_dirname (cache->location);
+    g_mkdir_with_parents (dir, 0777);
+    g_free (dir);
     g_error_free (error);
-    ret = FALSE;
+    error = NULL;
+    if (!g_file_set_contents (cache->location, (const gchar *) cache->mem,
+            cache->len, &error)) {
+      GST_ERROR ("Failed to write to cache file: %s", error->message);
+      g_error_free (error);
+      ret = FALSE;
+    }
   }
   g_free (cache->mem);

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.