]> git.sesse.net Git - vlc/commitdiff
* Fixed a Win32 bug in libdvdcss. This bug was appearing on title change.
authorGildas Bazin <gbazin@videolan.org>
Mon, 30 Jul 2001 18:56:36 +0000 (18:56 +0000)
committerGildas Bazin <gbazin@videolan.org>
Mon, 30 Jul 2001 18:56:36 +0000 (18:56 +0000)
* Modified input_dvd so you can now go directly to the selected chapter
  when you change the title.
* Implemented the Probe function in the Xvideo plugin. Xvideo is now the
  default video output plugin when it is supported.

extras/libdvdcss/libdvdcss.c
plugins/directx/aout_directx.c
plugins/dvd/input_dvd.c
plugins/x11/vout_xvideo.c

index ade73a0ca823b1c41cd3683fef291536365e5a9a..30b037f43ae8b41fb2bb9428a7eedde76b0f36bf 100644 (file)
@@ -2,7 +2,7 @@
  * libdvdcss.c: DVD reading library.
  *****************************************************************************
  * Copyright (C) 1998-2001 VideoLAN
- * $Id: libdvdcss.c,v 1.12 2001/07/30 00:53:04 sam Exp $
+ * $Id: libdvdcss.c,v 1.13 2001/07/30 18:56:35 gbazin Exp $
  *
  * Authors: Stéphane Borel <stef@via.ecp.fr>
  *          Samuel Hocevar <sam@zoy.org>
@@ -460,6 +460,8 @@ static int _dvdcss_close ( dvdcss_handle dvdcss )
 static int _dvdcss_seek ( dvdcss_handle dvdcss, int i_blocks )
 {
 #if defined( WIN32 )
+    dvdcss->i_seekpos = i_blocks;
+
     if( WIN2K )
     {
         LARGE_INTEGER li_read;
index 61f4728a3bb7f08126d7d79212720a3df9dddd5d..2b2892ff143b4399d129350bb9ad76119231cf4b 100644 (file)
@@ -2,7 +2,7 @@
  * aout_directx.c: Windows DirectX audio output method
  *****************************************************************************
  * Copyright (C) 1999, 2000 VideoLAN
- * $Id: aout_directx.c,v 1.7 2001/07/30 00:53:04 sam Exp $
+ * $Id: aout_directx.c,v 1.8 2001/07/30 18:56:36 gbazin Exp $
  *
  * Authors: Gildas Bazin <gbazin@netcourrier.com>
  *
 #include <fcntl.h>                                       /* open(), O_WRONLY */
 #include <string.h>                                            /* strerror() */
 
-#ifdef HAVE_UNISTD_H
-#   include <unistd.h>                                   /* write(), close() */
-#endif
-
 #include <stdio.h>                                           /* "intf_msg.h" */
 #include <stdlib.h>                            /* calloc(), malloc(), free() */
 
@@ -56,7 +52,7 @@
 #if defined( _MSC_VER )
 #   include <dsound.h>
 #else
-#   include "directx.h"
+#   include <directx.h>
 #endif
 
 #include "audio_output.h"                                   /* aout_thread_t */
index 5a3b68f092a1d373049d90c8f47a57acd6539d42..26ff4cf115683cbc69e35aecfb4c2d54580d5994 100644 (file)
@@ -10,7 +10,7 @@
  *  -dvd_udf to find files
  *****************************************************************************
  * Copyright (C) 1998-2001 VideoLAN
- * $Id: input_dvd.c,v 1.82 2001/07/30 00:53:05 sam Exp $
+ * $Id: input_dvd.c,v 1.83 2001/07/30 18:56:35 gbazin Exp $
  *
  * Author: Stéphane Borel <stef@via.ecp.fr>
  *
@@ -389,6 +389,8 @@ static int DVDSetArea( input_thread_t * p_input, input_area_t * p_area )
 
     if( p_area != p_input->stream.p_selected_area )
     {
+        /* Reset the Chapter position of the old title */
+        p_input->stream.p_selected_area->i_part = 0;
 
         /*
          *  We have to load all title information
@@ -486,11 +488,13 @@ static int DVDSetArea( input_thread_t * p_input, input_area_t * p_area )
         p_input->stream.p_selected_area->i_angle_nb = p_dvd->i_angle_nb;
         p_input->stream.p_selected_area->i_angle = p_dvd->i_angle;
 
+#if 0
         /* start at the beginning of the title */
         /* FIXME: create a conf option to select whether to restart
          * title or not */
         p_input->stream.p_selected_area->i_tell = 0;
         p_input->stream.p_selected_area->i_part = 1;
+#endif
 
         /*
          * Destroy obsolete ES by reinitializing program 0
index b7daae1a4af8488f72400a0a35438a8aa378a682..38b7cde503b52635ea30087ac6c5ef027a177c13 100644 (file)
@@ -2,7 +2,7 @@
  * vout_xvideo.c: Xvideo video output display method
  *****************************************************************************
  * Copyright (C) 1998, 1999, 2000, 2001 VideoLAN
- * $Id: vout_xvideo.c,v 1.22 2001/07/10 06:07:53 gbazin Exp $
+ * $Id: vout_xvideo.c,v 1.23 2001/07/30 18:56:36 gbazin Exp $
  *
  * Authors: Shane Harper <shanegh@optusnet.com.au>
  *          Vincent Seguin <seguin@via.ecp.fr>
@@ -204,12 +204,42 @@ void _M( vout_getfunctions )( function_list_t * p_function_list )
  *****************************************************************************/
 static int vout_Probe( probedata_t *p_data )
 {
+    Display *p_display;                                   /* display pointer */
+    char    *psz_display;
+
+    /* Open display, unsing 'vlc_display' or DISPLAY environment variable */
+    psz_display = XDisplayName( main_GetPszVariable(VOUT_DISPLAY_VAR, NULL) );
+    p_display = XOpenDisplay( psz_display );
+    if( p_display == NULL )                                         /* error */
+    {
+        intf_WarnMsg( 3, "vout: Xvideo cannot open display %s", psz_display );
+        intf_WarnMsg( 3, "vout: Xvideo not supported" );
+        return( 0 );
+    }
+    
+    if( !XVideoCheckForXv( p_display ) )
+    {
+        intf_WarnMsg( 3, "vout: Xvideo not supported" );
+        XCloseDisplay( p_display );
+        return( 0 );
+    }
+
+    if( XVideoGetPort( p_display ) < 0 )
+    {
+        intf_WarnMsg( 3, "vout: Xvideo not supported" );
+        XCloseDisplay( p_display );
+        return( 0 );
+    }
+
+    /* Clean-up everyting */
+    XCloseDisplay( p_display );
+
     if( TestMethod( VOUT_METHOD_VAR, "xvideo" ) )
     {
         return( 999 );
     }
 
-    return( 60 );
+    return( 150 );
 }
 
 /*****************************************************************************
@@ -266,6 +296,7 @@ static int vout_Create( vout_thread_t *p_vout )
 
     if( (p_vout->p_sys->xv_port = XVideoGetPort( p_vout->p_sys->p_display ))<0 )
     {
+        intf_ErrMsg( "vout error: cannot get XVideo port" );
         XVideoDestroyWindow( p_vout );
         XCloseDisplay( p_vout->p_sys->p_display );
         free( p_vout->p_sys );
@@ -696,15 +727,15 @@ static int XVideoCheckForXv( Display *dpy )
             return( 1 );
 
         case XvBadExtension:
-            intf_ErrMsg( "vout error: XvBadExtension" );
+            intf_WarnMsg( 3, "vout error: XvBadExtension" );
             return( 0 );
 
         case XvBadAlloc:
-            intf_ErrMsg( "vout error: XvBadAlloc" );
+            intf_WarnMsg( 3, "vout error: XvBadAlloc" );
             return( 0 );
 
         default:
-            intf_ErrMsg( "vout error: XvQueryExtension failed" );
+            intf_WarnMsg( 3, "vout error: XvQueryExtension failed" );
             return( 0 );
     }
 }
@@ -1136,15 +1167,15 @@ static int XVideoGetPort( Display *dpy )
             break;
 
         case XvBadExtension:
-            intf_ErrMsg( "vout error: XvBadExtension for XvQueryAdaptors" );
+            intf_WarnMsg( 3, "vout error: XvBadExtension for XvQueryAdaptors" );
             return( -1 );
 
         case XvBadAlloc:
-            intf_ErrMsg( "vout error: XvBadAlloc for XvQueryAdaptors" );
+            intf_WarnMsg( 3, "vout error: XvBadAlloc for XvQueryAdaptors" );
             return( -1 );
 
         default:
-            intf_ErrMsg( "vout error: XvQueryAdaptors failed" );
+            intf_WarnMsg( 3, "vout error: XvQueryAdaptors failed" );
             return( -1 );
     }
 
@@ -1190,7 +1221,7 @@ static int XVideoGetPort( Display *dpy )
 
     if( xv_port == -1 )
     {
-        intf_ErrMsg( "vout error: no suitable Xvideo image input port" );
+        intf_WarnMsg( 3, "vout: no suitable Xvideo image input port" );
     }
 
     return( xv_port );