]> git.sesse.net Git - vlc/commitdiff
-fixed css authentication under linux since it has been broken for a few
authorStéphane Borel <stef@videolan.org>
Sun, 8 Apr 2001 09:04:33 +0000 (09:04 +0000)
committerStéphane Borel <stef@videolan.org>
Sun, 8 Apr 2001 09:04:33 +0000 (09:04 +0000)
days: we have to initialize agid of authinfo struct.

-fixed a segfault on exit when DVDInit fails

plugins/dvd/dvd_ioctl.c
plugins/dvd/input_dvd.c
src/input/input.c

index 05d5b6c2129f1b79dfbcbf2ce608af75c01190cb..ba99236274862e1bb36b0e2ecae786563d438255 100644 (file)
@@ -2,7 +2,7 @@
  * dvd_ioctl.c: DVD ioctl replacement function
  *****************************************************************************
  * Copyright (C) 1999-2001 VideoLAN
- * $Id: dvd_ioctl.c,v 1.7 2001/04/06 09:15:47 sam Exp $
+ * $Id: dvd_ioctl.c,v 1.8 2001/04/08 09:04:33 stef Exp $
  *
  * Authors: Markus Kuespert <ltlBeBoy@beosmail.com>
  *          Samuel Hocevar <sam@zoy.org>
@@ -216,6 +216,7 @@ int ioctl_LUSendChallenge( css_t *p_css, u8 *p_challenge )
     dvd_authinfo auth_info;
 
     auth_info.type = DVD_LU_SEND_CHALLENGE;
+    auth_info.lsa.agid = p_css->i_agid;
 
     i_ret = ioctl( p_css->i_fd, DVD_AUTH, &auth_info );
 
@@ -382,6 +383,7 @@ int ioctl_HostSendChallenge( css_t *p_css, u8 *p_challenge )
     dvd_authinfo auth_info;
 
     auth_info.type = DVD_HOST_SEND_CHALLENGE;
+    auth_info.lsa.agid = p_css->i_agid;
 
     memcpy( auth_info.hsc.chal, p_challenge, sizeof(dvd_challenge) );
 
index 7483959b0d5a7ed844d1ef2d0793041e43aba59b..8752f7b39d11e7fd6d3b04417096505105cf7adc 100644 (file)
@@ -10,7 +10,7 @@
  *  -dvd_udf to find files
  *****************************************************************************
  * Copyright (C) 1998-2001 VideoLAN
- * $Id: input_dvd.c,v 1.38 2001/04/08 07:24:47 stef Exp $
+ * $Id: input_dvd.c,v 1.39 2001/04/08 09:04:33 stef Exp $
  *
  * Author: Stéphane Borel <stef@via.ecp.fr>
  *
@@ -742,10 +742,13 @@ static void DVDInit( input_thread_t * p_input )
     int                  i_chapter;
     int                  i;
 
+    /* I don't want DVDs to start playing immediately */
+//    p_input->stream.i_new_status = PAUSE_S;
+
     p_dvd = malloc( sizeof(thread_dvd_data_t) );
     if( p_dvd == NULL )
     {
-        intf_ErrMsg( "Out of memory" );
+        intf_ErrMsg( "dvd error: out of memory" );
         p_input->b_error = 1;
         return;
     }
@@ -783,7 +786,7 @@ static void DVDInit( input_thread_t * p_input )
     /* Ifo initialisation */
     if( IfoInit( &p_dvd->p_ifo, p_input->i_handle ) < 0 )
     {
-        intf_ErrMsg( "ifo error: fatal failure" );
+        intf_ErrMsg( "dvd error: fatal failure in IFO" );
         free( p_dvd );
         p_input->b_error = 1;
         return;
@@ -795,7 +798,7 @@ static void DVDInit( input_thread_t * p_input )
         p_dvd->p_css = malloc( sizeof(css_t) );
         if( p_dvd->p_css == NULL )
         {
-            intf_ErrMsg( "css error: couldn't create CSS structure" );
+            intf_ErrMsg( "dvd error: couldn't create CSS structure" );
             free( p_dvd );
             p_input->b_error = 1;
             return;
@@ -806,14 +809,14 @@ static void DVDInit( input_thread_t * p_input )
 
         if( CSSInit( p_dvd->p_css ) )
         {
-            intf_ErrMsg( "css error: fatal failure" );
+            intf_ErrMsg( "dvd error: fatal failure in CSS" );
             free( p_dvd->p_css );
             free( p_dvd );
             p_input->b_error = 1;
             return;
         }
 
-        intf_WarnMsg( 2, "css info: initialized" );
+        intf_WarnMsg( 2, "dvd info: CSS initialized" );
     }
 
     /* Initialize ES structures */
index de724b8523f45bbd9f7d4fff31abc72ced021dc1..e7c09ac1b55b3fb38a94450130dda62133652ed2 100644 (file)
@@ -4,7 +4,7 @@
  * decoders.
  *****************************************************************************
  * Copyright (C) 1998, 1999, 2000 VideoLAN
- * $Id: input.c,v 1.94 2001/03/19 13:26:59 sam Exp $
+ * $Id: input.c,v 1.95 2001/04/08 09:04:33 stef Exp $
  *
  * Authors: Christophe Massiot <massiot@via.ecp.fr>
  *
@@ -345,6 +345,14 @@ static int InitThread( input_thread_t * p_input )
 
     p_input->pf_init( p_input );
 
+    if( p_input->b_error )
+    {
+        /* We barfed -- exit nicely */
+        p_input->pf_close( p_input );
+        module_Unneed( p_main->p_bank, p_input->p_input_module );
+        return( -1 );
+    }
+
     *p_input->pi_status = THREAD_READY;
 
     return( 0 );