Bug#289470: aditional info to totem crash

Josselin Mouette 289470@bugs.debian.org, 289470@bugs.debian.org
Thu, 10 Feb 2005 10:45:39 +0100


This is a multi-part message in MIME format.
--------------060604030606070209000401
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

Alexander Dreweke wrote:
> Hi
> 
> totem doesn't work for me eigther. But by readling all the other problem
> descriptions I found the problem (alteast the problem why it doesn't work for
> me). I've got a laptop with a external cdrom device. So most time the cdrom
> device is not attached to the laptop. But because as you can see it is listed
> as mediadev (but /dev/sr0 is only created if I attach the cdrom drive) totem
> can't open that device and therefor crashes. :( With an attached cdrom totem
> works just fine.
> 
> Is there a way how I can say totem that it should not check, access, or what
> ever totem does with /dev/sr0 ?

Thanks for pointing us to this! I get it now. I can reproduce the crash 
when my CD drive isn't attached.

The attached patch (untested) should do the trick.
-- 
  .''`.           Josselin Mouette        /\./\
: :' :           josselin.mouette@ens-lyon.org
`. `'                        joss@debian.org
   `-  Debian GNU/Linux -- The power of freedom

--------------060604030606070209000401
Content-Type: text/plain;
 name="totem-crash.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="totem-crash.patch"

--- src/totem-preferences.c.orig        2005-02-10 10:27:49.000000000 +0100
+++ src/totem-preferences.c     2005-02-10 10:36:25.000000000 +0100
@@ -215,6 +215,9 @@
        const char *str;

        str = bacon_cd_selection_get_device (bcs);
+       if (str == NULL) {
+               str = "/dev/cdrom";
+       }
        gconf_client_set_string (totem->gc, GCONF_PREFIX"/mediadev", str, NULL);
        bacon_video_widget_set_media_device
                (BACON_VIDEO_WIDGET (totem->bvw), str);
@@ -482,6 +485,9 @@
        {
                mediadev = g_strdup (bacon_cd_selection_get_default_device
                                     (BACON_CD_SELECTION (item)));
+               if (mediadev == NULL) {
+                       mediadev = g_strdup ("/dev/cdrom");
+               }
                gconf_client_set_string (totem->gc, GCONF_PREFIX"/mediadev",
                                mediadev, NULL);
        }

--------------060604030606070209000401--