]> git.sesse.net Git - vlc/commitdiff
* Backported lool's fix for the Gtk+ playlist crash.
authorSam Hocevar <sam@videolan.org>
Sat, 29 Dec 2001 23:35:10 +0000 (23:35 +0000)
committerSam Hocevar <sam@videolan.org>
Sat, 29 Dec 2001 23:35:10 +0000 (23:35 +0000)
  * If $DISPLAY isn't set, don't try to run the Gtk+ interface.
  * Fixed a segfault in input_dvd.c:DVDInit.

plugins/dvd/input_dvd.c
plugins/gtk/gtk_playlist.c
plugins/gtk/intf_gnome.c
plugins/gtk/intf_gtk.c
plugins/mpeg_vdec/vpar_headers.c
plugins/text/intf_rc.c

index 0decae62fa17ca34721fefecf51b06e871bed560..796e60222e68d7eecd46cd34a14ff67338227cc7 100644 (file)
@@ -10,7 +10,7 @@
  *  -dvd_udf to find files
  *****************************************************************************
  * Copyright (C) 1998-2001 VideoLAN
- * $Id: input_dvd.c,v 1.105 2001/12/07 18:33:07 sam Exp $
+ * $Id: input_dvd.c,v 1.105.2.1 2001/12/29 23:35:10 sam Exp $
  *
  * Author: Stéphane Borel <stef@via.ecp.fr>
  *
@@ -220,7 +220,6 @@ static void DVDInit( input_thread_t * p_input )
     if( IfoCreate( p_dvd ) < 0 )
     {
         intf_ErrMsg( "dvd error: allcation error in ifo" );
-        dvdcss_close( p_dvd->dvdhandle );
         free( p_dvd );
         p_input->b_error = 1;
         return;
@@ -230,7 +229,6 @@ static void DVDInit( input_thread_t * p_input )
     {
         intf_ErrMsg( "dvd error: fatal failure in ifo" );
         IfoDestroy( p_dvd->p_ifo );
-        dvdcss_close( p_dvd->dvdhandle );
         free( p_dvd );
         p_input->b_error = 1;
         return;
index 54b53ca05cd2063a52131760ebc8b64183901cb0..3bd7cf29d810083620142a75d9f51fd4b92dc7b5 100644 (file)
@@ -2,7 +2,7 @@
  * gtk_playlist.c : Interface for the playlist dialog
  *****************************************************************************
  * Copyright (C) 2001 VideoLAN
- * $Id: gtk_playlist.c,v 1.22 2001/12/07 18:33:07 sam Exp $
+ * $Id: gtk_playlist.c,v 1.22.2.1 2001/12/29 23:35:10 sam Exp $
  *
  * Authors: Pierre Baillet <oct@zoy.org>
  *          Stéphane Borel <stef@via.ecp.fr>
@@ -706,17 +706,24 @@ void GtkRebuildCList( GtkCList * p_clist, playlist_t * p_playlist )
     for( i_dummy = 0; i_dummy < p_playlist->i_size ; i_dummy++ )
     {
 #ifdef WIN32 /* WIN32 HACK */
-        ppsz_text[0] = g_strdup( "" );
+        ppsz_text[0] = "";
 #else
-        ppsz_text[0] = g_strdup( rindex( (char *)(p_playlist->p_item[
-                p_playlist->i_size - 1 - i_dummy].psz_name ), '/' ) + 1 );
+        ppsz_text[0] = rindex( p_playlist->p_item[
+                p_playlist->i_size - 1 - i_dummy].psz_name, '/' );
+        if ( ppsz_text[0] == NULL )
+        {
+            ppsz_text[0] =
+              p_playlist->p_item[ p_playlist->i_size - 1 - i_dummy ].psz_name;
+        }
+        else
+        {
+            /* Skip leading '/' */
+            ppsz_text[0]++;
+        }
 #endif
-        ppsz_text[1] = g_strdup( "no info");
+        ppsz_text[1] = "no info";
         
         gtk_clist_insert( p_clist, 0, ppsz_text );
-        
-        free( ppsz_text[0] );
-        free( ppsz_text[1] );
     }
     gtk_clist_set_background( p_clist, p_playlist->i_index, &red);
     gtk_clist_thaw( p_clist );
index f1874d76f73e98cbd8676614d885a880551ea261..1cba9b38054f5a45addcfa56e7f4b4b17c434f07 100644 (file)
@@ -2,7 +2,7 @@
  * intf_gnome.c: Gnome interface
  *****************************************************************************
  * Copyright (C) 1999-2001 VideoLAN
- * $Id: intf_gnome.c,v 1.7 2001/12/07 18:33:07 sam Exp $
+ * $Id: intf_gnome.c,v 1.7.2.1 2001/12/29 23:35:10 sam Exp $
  *
  * Authors: Samuel Hocevar <sam@zoy.org>
  *          Stéphane Borel <stef@via.ecp.fr>
@@ -125,6 +125,13 @@ static int intf_Probe( probedata_t *p_data )
         return( 200 );
     }
 
+#ifndef WIN32
+    if( getenv( "DISPLAY" ) == NULL )
+    {
+        return( 15 );
+    }
+#endif
+
     return( 100 );
 }
 
index 670777c0e217686ccae134c7fbe6bccf79db45c5..b1d87bf9a6f834a2fb11f6959ccc73f53d354ee0 100644 (file)
@@ -2,7 +2,7 @@
  * intf_gtk.c: Gtk+ interface
  *****************************************************************************
  * Copyright (C) 1999-2001 VideoLAN
- * $Id: intf_gtk.c,v 1.29 2001/12/07 18:33:07 sam Exp $
+ * $Id: intf_gtk.c,v 1.29.2.1 2001/12/29 23:35:10 sam Exp $
  *
  * Authors: Samuel Hocevar <sam@zoy.org>
  *          Stéphane Borel <stef@via.ecp.fr>
@@ -126,6 +126,13 @@ static int intf_Probe( probedata_t *p_data )
         return( 190 );
     }
 
+#ifndef WIN32
+    if( getenv( "DISPLAY" ) == NULL )
+    {
+        return( 10 );
+    }
+#endif
+
     return( 90 );
 }
 
index e66a0f04c3169b8cdbf8d5fdf19b804d7f1c5112..e8c5bdf15593287ce7d98fab053dad1335dd42c1 100644 (file)
@@ -2,7 +2,7 @@
  * vpar_headers.c : headers parsing
  *****************************************************************************
  * Copyright (C) 1999-2001 VideoLAN
- * $Id: vpar_headers.c,v 1.2.2.2 2001/12/13 23:56:18 sam Exp $
+ * $Id: vpar_headers.c,v 1.2.2.3 2001/12/29 23:35:10 sam Exp $
  *
  * Authors: Christophe Massiot <massiot@via.ecp.fr>
  *          Stéphane Borel <stef@via.ecp.fr>
@@ -484,7 +484,7 @@ static void SequenceHeader( vpar_thread_t * p_vpar )
             intf_ErrMsg( "vpar error: can't open vout, aborting" );
             vlc_mutex_unlock( &p_vout_bank->lock );
 
-            /* XXX ! XXX ! XXX ! what to do here ? */
+            p_vpar->p_fifo->b_error = 1;
             return;
         }
         
index 130cd0a987cb04b1220e97118843d12d7b376d74..9b8a021a91fd6450483d821164320c9769302383 100644 (file)
@@ -105,7 +105,7 @@ static int intf_Probe( probedata_t *p_data )
         return( 999 );
     }
 
-    return( 2 );
+    return( 20 );
 }
 
 /*****************************************************************************