should have prevented the Win9x dvd input from working.
- Moved the "if(Win2k)" out of the loop in _win32_dvdcss_readv.
- Put a readv() function in input_iovec.h, the input_es now compiles.
- Modified input_ts to use this function.
- Fixed an initialisation bug in vout_directx.c
- Right clicking on the mouse now displays the navigation menu.
PS: If someone is willing to test the DVD input on Win95/98/Me I will
upload an up to date binary package.
* libdvdcss.c: DVD reading library.
*****************************************************************************
* Copyright (C) 1998-2001 VideoLAN
- * $Id: libdvdcss.c,v 1.5 2001/07/11 02:01:03 sam Exp $
+ * $Id: libdvdcss.c,v 1.6 2001/07/12 23:06:54 gbazin Exp $
*
* Authors: Stéphane Borel <stef@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org>
int i_num_buffers )
{
int i_index, i_len, i_total = 0;
- char *p_base;
+ unsigned char *p_base;
int i_blocks;
- for( i_index = i_num_buffers; i_index; i_index-- )
+ if( WIN2K )
{
+ for( i_index = i_num_buffers; i_index; i_index-- )
+ {
+ i_len = p_iovec->iov_len;
+ p_base = p_iovec->iov_base;
- i_len = p_iovec->iov_len;
- p_base = p_iovec->iov_base;
-
- if( i_len > 0 )
- {
- if( WIN2K )
- {
+ if( i_len > 0 )
+ {
unsigned long int i_bytes;
if( !ReadFile( (HANDLE) i_fd, p_base, i_len, &i_bytes, NULL ) )
{
unspecified after a failure */
}
i_blocks = i_bytes / DVDCSS_BLOCK_SIZE;
- }
- else /* Win9x */
- {
+
+ i_total += i_blocks;
+
+ if( i_blocks != (i_len / DVDCSS_BLOCK_SIZE) )
+ {
+ /* we reached the end of the file */
+ return i_total;
+ }
+
+ }
+
+ p_iovec++;
+ }
+ }
+ else /* Win9x */
+ {
+ for( i_index = i_num_buffers; i_index; i_index-- )
+ {
+ i_len = p_iovec->iov_len / DVDCSS_BLOCK_SIZE;
+ p_base = p_iovec->iov_base;
+
+ if( i_len > 0 )
+ {
i_blocks = _win32_dvdcss_aread( i_fd, p_base, i_len );
if( i_blocks < 0 )
{
return -1; /* idem */
}
- }
- if( i_blocks != (i_len / DVDCSS_BLOCK_SIZE) )
- {
- /* we reached the end of the file */
- return i_total;
- }
+ i_total += i_blocks;
- i_total += i_blocks;
- }
+ if( i_blocks != i_len )
+ {
+ /* we reached the end of the file or a signal interrupted
+ the read */
+ return i_total;
+ }
+ }
- p_iovec++;
+ p_iovec++;
+ }
}
return i_total;
size_t iov_len; /* Length of data. */
};
+/*****************************************************************************
+ * readv_*: readv() replacements for iovec-impaired C libraries
+ *****************************************************************************/
+#if defined( WIN32 )
+static __inline__ int readv( int i_fd, struct iovec *p_iovec, int i_count )
+{
+ int i_index, i_len, i_total = 0;
+ unsigned char *p_base;
+ int i_bytes;
+
+ for( i_index = i_count; i_index; i_index-- )
+ {
+
+ i_len = p_iovec->iov_len;
+ p_base = p_iovec->iov_base;
+
+ /* Loop is unrolled one time to spare the (i_bytes <= 0) test */
+
+ if( i_len > 0 )
+ {
+ i_bytes = read( i_fd, p_base, i_len );
+
+ if( i_bytes < 0 )
+ {
+ /* One of the reads failed, too bad.
+ We won't even bother returning the reads that went ok,
+ and as in the posix spec the file postition is left
+ unspecified after a failure */
+ return -1;
+ }
+
+ i_total += i_bytes;
+
+ if( i_bytes != i_len )
+ {
+ /* we reached the end of the file or a signal interrupted
+ the read */
+ return i_total;
+ }
+ }
+
+ p_iovec++;
+ }
+
+ return i_total;
+}
+#endif /* WIN32 */
* vout_directx.c: Windows DirectX video output display method
*****************************************************************************
* Copyright (C) 1998, 1999, 2000 VideoLAN
- * $Id: vout_directx.c,v 1.7 2001/07/11 14:26:19 gbazin Exp $
+ * $Id: vout_directx.c,v 1.8 2001/07/12 23:06:54 gbazin Exp $
*
* Authors: Gildas Bazin <gbazin@netcourrier.com>
*
p_vout->p_sys->hbrush = NULL;
p_vout->p_sys->hwnd = NULL;
p_vout->p_sys->i_changes = 0;
+ p_vout->p_sys->b_event_thread_die = 0;
p_vout->p_sys->b_display_enabled = 0;
p_vout->p_sys->b_cursor = 1; /* TODO should be done with a main_GetInt.. */
* vout_events.c: Windows DirectX video output events handler
*****************************************************************************
* Copyright (C) 1998, 1999, 2000 VideoLAN
- * $Id: vout_events.c,v 1.1 2001/07/11 14:26:19 gbazin Exp $
+ * $Id: vout_events.c,v 1.2 2001/07/12 23:06:54 gbazin Exp $
*
* Authors: Gildas Bazin <gbazin@netcourrier.com>
*
}
break;
+ case WM_RBUTTONUP:
+ intf_WarnMsg( 4, "vout: vout_Manage WM_RBUTTONUP" );
+ /* FIXME: need locking ! */
+ p_main->p_intf->b_menu_change = 1;
+ break;
+
case WM_KEYDOWN:
/* the key events are first processed here. The next
* message processed by this main message loop will be the
* input_ts.c: TS demux and netlist management
*****************************************************************************
* Copyright (C) 1998, 1999, 2000 VideoLAN
- * $Id: input_ts.c,v 1.28 2001/06/27 09:53:57 massiot Exp $
+ * $Id: input_ts.c,v 1.29 2001/07/12 23:06:54 gbazin Exp $
*
* Authors: Henri Fallon <henri@videolan.org>
*
#if defined( WIN32 )
if( p_input->stream.b_pace_control )
{
- i_read = readv_file( p_input->i_handle, p_iovec, INPUT_READ_ONCE );
+ i_read = readv( p_input->i_handle, p_iovec, INPUT_READ_ONCE );
}
else
{
* input_ts.h: structures of the input not exported to other modules
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
- * $Id: input_ts.h,v 1.9 2001/06/21 07:22:03 sam Exp $
+ * $Id: input_ts.h,v 1.10 2001/07/12 23:06:54 gbazin Exp $
*
* Authors: Henri Fallon <henri@via.ecp.fr>
* Boris Dorès <babal@via.ecp.fr>
} thread_ts_data_t;
/*****************************************************************************
- * readv_*: readv() replacements for iovec-impaired C libraries
+ * network readv() replacement for iovec-impaired C libraries
*****************************************************************************/
-
-#if defined( WIN32 )
-static __inline__ int readv_file( int i_fd, struct iovec *p_iovec, int i_count )
-{
- int i_index, i_len, i_total = 0;
- u8 *p_base;
-
- for( i_index = i_count; i_index; i_index-- )
- {
- register signed int i_bytes;
-
- i_len = p_iovec->iov_len;
- p_base = p_iovec->iov_base;
-
- /* Loop is unrolled one time to spare the (i_bytes <= 0) test */
-
- if( i_len > 0 )
- {
- i_bytes = read( i_fd, p_base, i_len );
-
- if( ( i_total == 0 ) && ( i_bytes < 0 ) )
- {
- return -1;
- }
-
- if( i_bytes <= 0 )
- {
- return i_total;
- }
-
- i_len -= i_bytes; i_total += i_bytes; p_base += i_bytes;
-
- while( i_len > 0 )
- {
- i_bytes = read( i_fd, p_base, i_len );
-
- if( i_bytes <= 0 )
- {
- return i_total;
- }
-
- i_len -= i_bytes; i_total += i_bytes; p_base += i_bytes;
- }
- }
-
- p_iovec++;
- }
-
- return i_total;
-}
-
+#if defined(WIN32)
static __inline__ int read_network( int i_fd, char * p_base,
thread_ts_data_t *p_sys, int i_len )
{