* css.c: Functions for DVD authentification and unscrambling
*****************************************************************************
* Copyright (C) 1999-2001 VideoLAN
- * $Id: css.c,v 1.2 2001/06/14 02:47:44 sam Exp $
+ * $Id: css.c,v 1.3 2001/06/29 11:34:28 stef Exp $
*
* Author: Stéphane Borel <stef@via.ecp.fr>
*
return -1;
}
+fprintf( stderr, "DISK KEY: %02x %02x %02x %02x %02x\n", p_buffer[0], p_buffer[1], p_buffer[2], p_buffer[3], p_buffer[4] );
+
/* Unencrypt disc key using bus key */
for( i = 0 ; i < 2048 ; i++ )
{
for( i = 2 ; i < 0x30 ; i++ )
{
- for( j = i ; ( j < 0x80 ) &&
+ for( j = i+1 ; ( j < 0x80 ) &&
( pi_buf[0x7F - (j%i)] == pi_buf[0x7F-j] ) ; j++ );
{
- if( ( j > i_best_plen ) && ( j > i ) )
+ if( j > i_best_plen )
{
i_best_plen = j;
i_best_p = i;
* -dvd_udf to find files
*****************************************************************************
* Copyright (C) 1998-2001 VideoLAN
- * $Id: input_dvd.c,v 1.77 2001/06/27 09:53:56 massiot Exp $
+ * $Id: input_dvd.c,v 1.78 2001/06/29 11:34:28 stef Exp $
*
* Author: Stéphane Borel <stef@via.ecp.fr>
*
* Chapter selection
*/
-
if( p_area->i_part != p_dvd->i_chapter )
{
if( ( p_area->i_part > 0 ) &&
p_input->stream.b_seekable = 1;
p_input->stream.b_changed = 1;
-
return 0;
}
int i_sector;
boolean_t b_eof;
boolean_t b_eot;
+ boolean_t b_eoc;
p_dvd = (thread_dvd_data_t *)p_input->p_plugin_data;
p_netlist = (dvd_netlist_t *)p_input->p_method_data;
+ b_eoc = 0;
i_sector = p_dvd->i_title_start + p_dvd->i_sector;
i_block_once = p_dvd->i_end_sector - p_dvd->i_sector + 1;
( p_dvd->i_prg_cell - i_angle + 1 ) )
{
p_dvd->i_chapter++;
+ b_eoc = 1;
}
}
{
i_block_once = p_dvd->i_block_once;
}
-//intf_WarnMsg( 2, "Sector: 0x%x Read: %d Chapter: %d", p_dvd->i_sector, i_block_once, p_dvd->i_chapter );
-
+/*
+intf_WarnMsg( 2, "Sector: 0x%x Read: %d Chapter: %d", p_dvd->i_sector, i_block_once, p_dvd->i_chapter );
+*/
p_netlist->i_read_once = i_block_once;
/* Get an iovec pointer */
}
else
{
- /* Pack header. */
- if( ( pi_cur[4] & 0xC0 ) == 0x40 )
- {
- /* MPEG-2 */
- i_packet_size = 8;
- }
- else if( ( pi_cur[4] & 0xF0 ) == 0x20 )
- {
- /* MPEG-1 */
- i_packet_size = 6;
- }
- else
- {
- intf_ErrMsg( "Unable to determine stream type" );
- return( -1 );
- }
-
+ /* MPEG-2 Pack header. */
+ i_packet_size = 8;
pp_packets[i_packet] = pp_data[i_iovec];
}
p_input->stream.p_selected_area->i_tell =
LB2OFF( i_sector + i_read_blocks ) -
p_input->stream.p_selected_area->i_start;
- p_input->stream.p_selected_area->i_part = p_dvd->i_chapter;
+ if( b_eoc )
+ {
+ /* We modify i_part only at end of chapter not to erase
+ * some modification from the interface */
+ p_input->stream.p_selected_area->i_part = p_dvd->i_chapter;
+ }
b_eot = !( p_input->stream.p_selected_area->i_tell
< p_input->stream.p_selected_area->i_size );
LB2OFF ( dvdcss_seek( p_dvd->dvdhandle, p_dvd->i_title_start
+ p_dvd->i_sector ) )
- p_input->stream.p_selected_area->i_start;
-/*
- intf_WarnMsg( 3, "Program Cell: %d Cell: %d Chapter: %d",
+
+ intf_WarnMsg( 7, "Program Cell: %d Cell: %d Chapter: %d",
p_dvd->i_prg_cell, p_dvd->i_cell, p_dvd->i_chapter );
-*/
+
return;
}
}
/*
-intf_WarnMsg( 3, "FindCell: i_cell %d i_index %d found %d nb %d",
+intf_WarnMsg( 7, "FindCell: i_cell %d i_index %d found %d nb %d",
p_dvd->i_cell,
p_dvd->i_prg_cell,
i_cell,
#endif
/*
- intf_WarnMsg( 3, "cell: %d sector1: 0x%x end1: 0x%x\n"
+ intf_WarnMsg( 7, "cell: %d sector1: 0x%x end1: 0x%x\n"
"index: %d sector2: 0x%x end2: 0x%x\n"
"category: 0x%x ilvu end: 0x%x vobu start 0x%x",
p_dvd->i_cell,
* gtk_menu.c : functions to handle menu items.
*****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN
- * $Id: gtk_menu.c,v 1.10 2001/06/14 01:49:44 sam Exp $
+ * $Id: gtk_menu.c,v 1.11 2001/06/29 11:34:28 stef Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
* Stéphane Borel <stef@via.ecp.fr>
p_menubar_menu = GTK_WIDGET( gtk_object_get_data( GTK_OBJECT(
p_intf->p_sys->p_window ), "menubar_chapter" ) );
+
GtkRadioMenu( p_intf, p_menubar_menu, NULL, "Chapter",
p_intf->p_input->stream.p_selected_area->i_part_nb,
p_intf->p_input->stream.p_selected_area->i_part,