Commit ae09661b authored by Gildas Bazin's avatar Gildas Bazin

* Fixed crashes on exit in the directx plugin
* vout_PlacePicture is now accepting picture width=height=0

* Win32 (NT/2000/XP) fix for libdvdcss: first attempt to open the DVD
  device in read/write mode so we can use ioctls. If this fails
  (insufficent privileges) we at least open in read-only mode so the
  libdvdcss title decryption method can be used.
parent 641382a2
......@@ -2,7 +2,7 @@
* css.c: Functions for DVD authentification and unscrambling
*****************************************************************************
* Copyright (C) 1999-2001 VideoLAN
* $Id: css.c,v 1.20 2002/01/14 22:06:57 stef Exp $
* $Id: css.c,v 1.21 2002/01/21 07:00:21 gbazin Exp $
*
* Author: Stphane Borel <stef@via.ecp.fr>
* Hkan Hjort <d95hjort@dtek.chalmers.se>
......@@ -77,7 +77,13 @@ int CSSTest( dvdcss_handle dvdcss )
/* Since it's the first ioctl we try to issue, we add a notice */
_dvdcss_error( dvdcss, "css error: ioctl_ReadCopyright failed, "
"make sure there is a DVD in the drive, and that "
"DVD ioctls were compiled in this libdvdcss version" );
"DVD ioctls were compiled in this libdvdcss version."
#if defined( WIN32 )
"\nAlso note that if you are using Windows NT/2000/XP "
"you need to have administrator priviledges to be able "
"to use ioctls."
#endif
);
return i_ret;
}
......
......@@ -2,7 +2,7 @@
* libdvdcss.c: DVD reading library.
*****************************************************************************
* Copyright (C) 1998-2001 VideoLAN
* $Id: libdvdcss.c,v 1.28 2002/01/15 05:22:21 stef Exp $
* $Id: libdvdcss.c,v 1.29 2002/01/21 07:00:21 gbazin Exp $
*
* Authors: Stphane Borel <stef@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org>
......@@ -158,11 +158,16 @@ extern dvdcss_handle dvdcss_open ( char *psz_target )
return NULL;
}
#if defined( WIN32 )
/* it's not possible to stat a drive letter. Fake a block device */
fileinfo.st_mode = S_IFBLK;
#else
if( stat( psz_target, &fileinfo ) < 0 )
{
_dvdcss_error( dvdcss, "dvdcss: can't stat target" );
}
#endif
if( S_ISBLK( fileinfo.st_mode ) ||
S_ISCHR( fileinfo.st_mode ) )
{
......@@ -479,10 +484,25 @@ static int _dvdcss_open ( dvdcss_handle dvdcss, char *psz_target )
{
char psz_dvd[7];
_snprintf( psz_dvd, 7, "\\\\.\\%c:", psz_target[0] );
/* To have access to ioctls, we need read and write access to the
* device. This is only allowed if you have administrator priviledges
* so we allow for a fallback method where ioctls are not available but
* we at least have read access to the device.
* (See Microsoft Q241374: Read and Write Access Required for SCSI
* Pass Through Requests) */
(HANDLE) dvdcss->i_fd =
CreateFile( psz_dvd, GENERIC_READ | GENERIC_WRITE,
FILE_SHARE_READ | FILE_SHARE_WRITE,
NULL, OPEN_EXISTING, 0, NULL );
NULL, OPEN_EXISTING,
FILE_FLAG_RANDOM_ACCESS, NULL );
if( (HANDLE) dvdcss->i_fd == INVALID_HANDLE_VALUE )
(HANDLE) dvdcss->i_fd =
CreateFile( psz_dvd, GENERIC_READ, FILE_SHARE_READ,
NULL, OPEN_EXISTING,
FILE_FLAG_RANDOM_ACCESS, NULL );
if( (HANDLE) dvdcss->i_fd == INVALID_HANDLE_VALUE )
{
_dvdcss_error( dvdcss, "failed opening device" );
......
......@@ -2,7 +2,7 @@
* vout_events.c: Windows DirectX video output events handler
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* $Id: vout_events.c,v 1.8 2002/01/17 23:02:45 gbazin Exp $
* $Id: vout_events.c,v 1.9 2002/01/21 07:00:21 gbazin Exp $
*
* Authors: Gildas Bazin <gbazin@netcourrier.com>
*
......@@ -142,7 +142,8 @@ void DirectXEventThread( vout_thread_t *p_vout )
{
case VK_ESCAPE:
case VK_F12:
PostQuitMessage( 0 );
/* exit application */
p_main->p_intf->b_die = 1;
break;
}
TranslateMessage(&msg);
......@@ -154,7 +155,8 @@ void DirectXEventThread( vout_thread_t *p_vout )
{
case 'q':
case 'Q':
PostQuitMessage( 0 );
/* exit application */
p_main->p_intf->b_die = 1;
break;
case 'f': /* switch to fullscreen */
......@@ -385,7 +387,7 @@ static void DirectXCloseWindow( vout_thread_t *p_vout )
hInstance ); /* handle to application instance */
/* free window background brush */
if( p_vout->p_sys->hwnd != NULL )
if( p_vout->p_sys->hbrush != NULL )
{
DeleteObject( p_vout->p_sys->hbrush );
p_vout->p_sys->hbrush = NULL;
......@@ -538,7 +540,10 @@ static long FAR PASCAL DirectXEventProc( HWND hwnd, UINT message,
/* the window has been closed so shut down everything now */
case WM_DESTROY:
intf_WarnMsg( 4, "vout: WinProc WM_DESTROY" );
/* exit application */
p_main->p_intf->b_die = 1;
PostQuitMessage( 0 );
return 0;
break;
case WM_SYSCOMMAND:
......
......@@ -2,7 +2,7 @@
* vout_pictures.c : picture management functions
*****************************************************************************
* Copyright (C) 2000 VideoLAN
* $Id: vout_pictures.c,v 1.11 2002/01/17 23:02:45 gbazin Exp $
* $Id: vout_pictures.c,v 1.12 2002/01/21 07:00:21 gbazin Exp $
*
* Authors: Vincent Seguin <seguin@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org>
......@@ -395,7 +395,11 @@ void vout_PlacePicture( vout_thread_t *p_vout, int i_width, int i_height,
int *pi_x, int *pi_y, int *pi_width, int *pi_height )
{
if( (i_width <= 0) || (i_height <=0) )
{
*pi_width = *pi_height = *pi_x = *pi_y = 0;
return;
}
if( p_vout->b_scale )
{
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment