patches/gst-plugins-base-02-fixcdda.diff
author bc99092
Wed, 12 Jul 2006 19:17:03 +0000
changeset 7611 0f4c698b0b97
child 7627 3259534ccb89
permissions -rw-r--r--
2006-07-12 Brian Cameron <[email protected]> * gst-plugins-base.spec, patches/gst-plugins-base-02-fixcdda.spec: Fix cdda base plugin so that it recognzies a CD device passed in as the URL. This makes cdda work on Solaris, so totem and rhythmbox should work better with CD's. * gtk2.spec: Bump to 2.8.20.

--- gst-plugins-base-0.10.8/gst-libs/gst/cdda/gstcddabasesrc.c-orig	2006-07-12 12:59:11.642456000 -0500
+++ gst-plugins-base-0.10.8/gst-libs/gst/cdda/gstcddabasesrc.c	2006-07-12 13:53:37.699805000 -0500
@@ -130,7 +130,7 @@ static void gst_cdda_base_src_set_index 
 static GstIndex *gst_cdda_base_src_get_index (GstElement * src);
 
 GST_BOILERPLATE_FULL (GstCddaBaseSrc, gst_cdda_base_src, GstPushSrc,
-    GST_TYPE_PUSH_SRC, gst_cdda_base_src_setup_interfaces);
+    GST_TYPE_PUSH_SRC, gst_cdda_base_src_setup_interfaces)
 
 #define SRC_CAPS \
   "audio/x-raw-int, "               \
@@ -949,6 +949,39 @@ gst_cdda_base_src_uri_set_uri (GstURIHan
     location = g_strdup ("1");
   }
 
+  if (strncmp (location, "/dev/", 5) == 0 ||
+      strncmp (location, "dev/", 4) == 0) {
+
+     gchar **uri_split;
+#ifdef __sun
+     /*
+      * On Solaris, /dev/rdsk is used for accessing the CD device, but some 
+      * applications pass in /dev/dsk, so correct.
+      */
+     gchar *test_for_dsk;
+
+     test_for_dsk = g_strrstr (location, "dev/dsk");
+
+     if (test_for_dsk != NULL)
+        location = g_strdup_printf ("/dev/rdsk%s", test_for_dsk + strlen ("dev/dsk"));
+#endif
+
+     uri_split = g_strsplit (location, "#", 0);
+
+     if (strncmp (location, "/dev/", 5) == 0)
+       src->device = g_strdup (uri_split[0]);
+     else
+       src->device = g_strdup_printf ("/%s", uri_split[0]);
+
+     if (uri_split[1] != NULL) {
+       location = uri_split[1];
+     } else {
+       location = g_strdup ("1");
+     }
+
+     g_strfreev (uri_split);
+  }
+     
   src->uri_track = strtol (location, NULL, 10);
   g_free (location);