? po/stamp-it
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/totem/ChangeLog,v
retrieving revision 1.1626
diff -u -u -r1.1626 ChangeLog
--- ChangeLog	5 Feb 2006 15:46:16 -0000	1.1626
+++ ChangeLog	6 Feb 2006 12:16:39 -0000
@@ -1,3 +1,8 @@
+2006-02-06  Fernando Herrera  <fherrera@onirica.com>
+
+	* src/backend/bacon-video-widget-gst-0.10.c: (gst_check_feature),
+	(bacon_video_widget_can_play): Check for dvd support properly.
+
 2006-02-05  Tim-Philipp Müller  <tim at centricular dot net>
 
 	* src/backend/bacon-video-widget-gst-0.10.c:
Index: src/backend/bacon-video-widget-gst-0.10.c
===================================================================
RCS file: /cvs/gnome/totem/src/backend/bacon-video-widget-gst-0.10.c,v
retrieving revision 1.48
diff -u -u -r1.48 bacon-video-widget-gst-0.10.c
--- src/backend/bacon-video-widget-gst-0.10.c	5 Feb 2006 15:46:17 -0000	1.48
+++ src/backend/bacon-video-widget-gst-0.10.c	6 Feb 2006 12:16:39 -0000
@@ -3188,20 +3188,46 @@
   return res;
 }
 
+static gboolean
+gst_check_feature (GstRegistry *registry, char *name)
+{
+  GstPluginFeature *feature;
+
+  feature = gst_registry_lookup_feature (registry, name);
+  if (!feature) {
+    return FALSE;
+  }
+  gst_object_unref (feature);
+
+  return TRUE;
+}
+
 gboolean
 bacon_video_widget_can_play (BaconVideoWidget * bvw, MediaType type)
 {
+  GstRegistry *registry;
+  GstPluginFeature *feature;
   gboolean res;
 
   g_return_val_if_fail (bvw != NULL, FALSE);
   g_return_val_if_fail (BACON_IS_VIDEO_WIDGET (bvw), FALSE);
   g_return_val_if_fail (GST_IS_ELEMENT (bvw->priv->play), FALSE);
 
+
   switch (type) {
     case MEDIA_TYPE_CDDA:
     case MEDIA_TYPE_VCD:
-    case MEDIA_TYPE_DVD:
       res = TRUE;
+      break;
+    case MEDIA_TYPE_DVD:
+      registry = gst_registry_get_default ();
+      if (!gst_check_feature (registry, "dvdread") ||
+          !gst_check_feature (registry, "dvdcss") ||
+          !gst_check_feature (registry, "dvdnac")) {
+        res = FALSE;
+      } else {
+        res = TRUE;
+      }
       break;
     default:
       res = FALSE;
