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.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
7611
0f4c698b0b97 2006-07-12 Brian Cameron <[email protected]>
bc99092
parents:
diff changeset
     1
--- gst-plugins-base-0.10.8/gst-libs/gst/cdda/gstcddabasesrc.c-orig	2006-07-12 12:59:11.642456000 -0500
0f4c698b0b97 2006-07-12 Brian Cameron <[email protected]>
bc99092
parents:
diff changeset
     2
+++ gst-plugins-base-0.10.8/gst-libs/gst/cdda/gstcddabasesrc.c	2006-07-12 13:53:37.699805000 -0500
0f4c698b0b97 2006-07-12 Brian Cameron <[email protected]>
bc99092
parents:
diff changeset
     3
@@ -130,7 +130,7 @@ static void gst_cdda_base_src_set_index 
0f4c698b0b97 2006-07-12 Brian Cameron <[email protected]>
bc99092
parents:
diff changeset
     4
 static GstIndex *gst_cdda_base_src_get_index (GstElement * src);
0f4c698b0b97 2006-07-12 Brian Cameron <[email protected]>
bc99092
parents:
diff changeset
     5
 
0f4c698b0b97 2006-07-12 Brian Cameron <[email protected]>
bc99092
parents:
diff changeset
     6
 GST_BOILERPLATE_FULL (GstCddaBaseSrc, gst_cdda_base_src, GstPushSrc,
0f4c698b0b97 2006-07-12 Brian Cameron <[email protected]>
bc99092
parents:
diff changeset
     7
-    GST_TYPE_PUSH_SRC, gst_cdda_base_src_setup_interfaces);
0f4c698b0b97 2006-07-12 Brian Cameron <[email protected]>
bc99092
parents:
diff changeset
     8
+    GST_TYPE_PUSH_SRC, gst_cdda_base_src_setup_interfaces)
0f4c698b0b97 2006-07-12 Brian Cameron <[email protected]>
bc99092
parents:
diff changeset
     9
 
0f4c698b0b97 2006-07-12 Brian Cameron <[email protected]>
bc99092
parents:
diff changeset
    10
 #define SRC_CAPS \
0f4c698b0b97 2006-07-12 Brian Cameron <[email protected]>
bc99092
parents:
diff changeset
    11
   "audio/x-raw-int, "               \
0f4c698b0b97 2006-07-12 Brian Cameron <[email protected]>
bc99092
parents:
diff changeset
    12
@@ -949,6 +949,39 @@ gst_cdda_base_src_uri_set_uri (GstURIHan
0f4c698b0b97 2006-07-12 Brian Cameron <[email protected]>
bc99092
parents:
diff changeset
    13
     location = g_strdup ("1");
0f4c698b0b97 2006-07-12 Brian Cameron <[email protected]>
bc99092
parents:
diff changeset
    14
   }
0f4c698b0b97 2006-07-12 Brian Cameron <[email protected]>
bc99092
parents:
diff changeset
    15
 
0f4c698b0b97 2006-07-12 Brian Cameron <[email protected]>
bc99092
parents:
diff changeset
    16
+  if (strncmp (location, "/dev/", 5) == 0 ||
0f4c698b0b97 2006-07-12 Brian Cameron <[email protected]>
bc99092
parents:
diff changeset
    17
+      strncmp (location, "dev/", 4) == 0) {
0f4c698b0b97 2006-07-12 Brian Cameron <[email protected]>
bc99092
parents:
diff changeset
    18
+
0f4c698b0b97 2006-07-12 Brian Cameron <[email protected]>
bc99092
parents:
diff changeset
    19
+     gchar **uri_split;
0f4c698b0b97 2006-07-12 Brian Cameron <[email protected]>
bc99092
parents:
diff changeset
    20
+#ifdef __sun
0f4c698b0b97 2006-07-12 Brian Cameron <[email protected]>
bc99092
parents:
diff changeset
    21
+     /*
0f4c698b0b97 2006-07-12 Brian Cameron <[email protected]>
bc99092
parents:
diff changeset
    22
+      * On Solaris, /dev/rdsk is used for accessing the CD device, but some 
0f4c698b0b97 2006-07-12 Brian Cameron <[email protected]>
bc99092
parents:
diff changeset
    23
+      * applications pass in /dev/dsk, so correct.
0f4c698b0b97 2006-07-12 Brian Cameron <[email protected]>
bc99092
parents:
diff changeset
    24
+      */
0f4c698b0b97 2006-07-12 Brian Cameron <[email protected]>
bc99092
parents:
diff changeset
    25
+     gchar *test_for_dsk;
0f4c698b0b97 2006-07-12 Brian Cameron <[email protected]>
bc99092
parents:
diff changeset
    26
+
0f4c698b0b97 2006-07-12 Brian Cameron <[email protected]>
bc99092
parents:
diff changeset
    27
+     test_for_dsk = g_strrstr (location, "dev/dsk");
0f4c698b0b97 2006-07-12 Brian Cameron <[email protected]>
bc99092
parents:
diff changeset
    28
+
0f4c698b0b97 2006-07-12 Brian Cameron <[email protected]>
bc99092
parents:
diff changeset
    29
+     if (test_for_dsk != NULL)
0f4c698b0b97 2006-07-12 Brian Cameron <[email protected]>
bc99092
parents:
diff changeset
    30
+        location = g_strdup_printf ("/dev/rdsk%s", test_for_dsk + strlen ("dev/dsk"));
0f4c698b0b97 2006-07-12 Brian Cameron <[email protected]>
bc99092
parents:
diff changeset
    31
+#endif
0f4c698b0b97 2006-07-12 Brian Cameron <[email protected]>
bc99092
parents:
diff changeset
    32
+
0f4c698b0b97 2006-07-12 Brian Cameron <[email protected]>
bc99092
parents:
diff changeset
    33
+     uri_split = g_strsplit (location, "#", 0);
0f4c698b0b97 2006-07-12 Brian Cameron <[email protected]>
bc99092
parents:
diff changeset
    34
+
0f4c698b0b97 2006-07-12 Brian Cameron <[email protected]>
bc99092
parents:
diff changeset
    35
+     if (strncmp (location, "/dev/", 5) == 0)
0f4c698b0b97 2006-07-12 Brian Cameron <[email protected]>
bc99092
parents:
diff changeset
    36
+       src->device = g_strdup (uri_split[0]);
0f4c698b0b97 2006-07-12 Brian Cameron <[email protected]>
bc99092
parents:
diff changeset
    37
+     else
0f4c698b0b97 2006-07-12 Brian Cameron <[email protected]>
bc99092
parents:
diff changeset
    38
+       src->device = g_strdup_printf ("/%s", uri_split[0]);
0f4c698b0b97 2006-07-12 Brian Cameron <[email protected]>
bc99092
parents:
diff changeset
    39
+
0f4c698b0b97 2006-07-12 Brian Cameron <[email protected]>
bc99092
parents:
diff changeset
    40
+     if (uri_split[1] != NULL) {
0f4c698b0b97 2006-07-12 Brian Cameron <[email protected]>
bc99092
parents:
diff changeset
    41
+       location = uri_split[1];
0f4c698b0b97 2006-07-12 Brian Cameron <[email protected]>
bc99092
parents:
diff changeset
    42
+     } else {
0f4c698b0b97 2006-07-12 Brian Cameron <[email protected]>
bc99092
parents:
diff changeset
    43
+       location = g_strdup ("1");
0f4c698b0b97 2006-07-12 Brian Cameron <[email protected]>
bc99092
parents:
diff changeset
    44
+     }
0f4c698b0b97 2006-07-12 Brian Cameron <[email protected]>
bc99092
parents:
diff changeset
    45
+
0f4c698b0b97 2006-07-12 Brian Cameron <[email protected]>
bc99092
parents:
diff changeset
    46
+     g_strfreev (uri_split);
0f4c698b0b97 2006-07-12 Brian Cameron <[email protected]>
bc99092
parents:
diff changeset
    47
+  }
0f4c698b0b97 2006-07-12 Brian Cameron <[email protected]>
bc99092
parents:
diff changeset
    48
+     
0f4c698b0b97 2006-07-12 Brian Cameron <[email protected]>
bc99092
parents:
diff changeset
    49
   src->uri_track = strtol (location, NULL, 10);
0f4c698b0b97 2006-07-12 Brian Cameron <[email protected]>
bc99092
parents:
diff changeset
    50
   g_free (location);
0f4c698b0b97 2006-07-12 Brian Cameron <[email protected]>
bc99092
parents:
diff changeset
    51