Commit 26300bb9 authored by Stéphane Borel's avatar Stéphane Borel

-better handling of angles: you should be able to change on the fly now

-removed � bug added at my last commit in css code; cleaned CSSGetKey

-various changes and bugfixes in the gnome interface.
parent 224c0e0b
......@@ -2,7 +2,7 @@
* dvd_css.c: Functions for DVD authentification and unscrambling
*****************************************************************************
* Copyright (C) 1999-2001 VideoLAN
* $Id: dvd_css.c,v 1.25 2001/04/20 05:40:03 stef Exp $
* $Id: dvd_css.c,v 1.26 2001/04/22 00:08:25 stef Exp $
*
* Author: Stphane Borel <stef@via.ecp.fr>
*
......@@ -264,6 +264,12 @@ int CSSInit( int i_fd, css_t * p_css )
}
memcpy( p_css->disc.pi_key_check, p_buffer, 2048 );
/* initialize title key to know it empty */
for( i = 0 ; i < KEY_SIZE ; i++ )
{
p_css->pi_title_key[i] = 0;
}
/* Test authentication success */
switch( CSSGetASF( i_fd ) )
{
......@@ -302,33 +308,25 @@ int CSSGetKey( int i_fd, css_t * p_css )
*/
u8 pi_buf[0x800];
dvd_key_t pi_key;
title_key_t p_title_key[10];
off_t i_pos;
boolean_t b_encrypted;
boolean_t b_stop_scanning;
int i_title;
int i_bytes_read;
int i_best_plen;
int i_best_p;
int i_registered_keys;
int i_total_keys_found;
int i_highest;
int i,j,k;
int i,j;
for( i = 0 ; i < KEY_SIZE ; i++ )
{
pi_key[i] = 0;
}
memset( p_title_key, 0, 10 );
memset( &pi_key, 0, 10 );
b_encrypted = 0;
b_stop_scanning = 0;
i_registered_keys = 0 ;
i_total_keys_found = 0 ;
i_highest = 0;
/* Position of the title on the disc */
i_title = p_css->i_title;
i_pos = p_css->i_title_pos;
//fprintf( stderr, "CSS %d start pos: %lld\n", i_title, i_pos );
do {
i_pos = lseek( i_fd, i_pos, SEEK_SET );
i_bytes_read = read( i_fd, pi_buf, 0x800 );
......@@ -359,39 +357,7 @@ int CSSGetKey( int i_fd, css_t * p_css )
&pi_buf[0x80 - ( i_best_plen / i_best_p) *i_best_p],
(dvd_key_t*)&pi_buf[0x54],
&pi_key );
while( i>=0 )
{
k = 0;
for( j=0 ; j<i_registered_keys ; j++ )
{
if( memcmp( &(p_title_key[j].pi_key),
&pi_key, sizeof(dvd_key_t) ) == 0 )
{
p_title_key[j].i_occ++;
i_total_keys_found++;
k = 1;
}
}
if( k == 0 )
{
memcpy( &(p_title_key[i_registered_keys].pi_key),
&pi_key, sizeof(dvd_key_t) );
p_title_key[i_registered_keys++].i_occ = 1;
i_total_keys_found++;
}
i = CSSCracker( i, &pi_buf[0x80],
&pi_buf[0x80 - ( i_best_plen / i_best_p) *i_best_p],
(dvd_key_t*)&pi_buf[0x54], &pi_key);
}
/* Stop search if we find one occurence of the key
* I have never found a DVD for which it is not enough
* but we should take care of that */
if( i_registered_keys == 1 && p_title_key[0].i_occ >= 1 )
{
b_stop_scanning = 1;
}
b_stop_scanning = ( i >= 0 );
}
}
......@@ -400,8 +366,10 @@ int CSSGetKey( int i_fd, css_t * p_css )
if( b_stop_scanning)
{
intf_WarnMsg( 1,
"css info: found enough occurencies of the same key." );
memcpy( p_css->pi_title_key,
&pi_key, sizeof(dvd_key_t) );
intf_WarnMsg( 2, "css info: vts key initialized" );
return 0;
}
if( !b_encrypted )
......@@ -410,68 +378,7 @@ int CSSGetKey( int i_fd, css_t * p_css )
return 0;
}
if( b_encrypted && i_registered_keys == 0 )
{
intf_ErrMsg( "css error: unable to determine keys from file" );
return -1;
}
for( i = 0 ; i < i_registered_keys - 1 ; i++ )
{
for( j = i + 1 ; j < i_registered_keys ; j++ )
{
if( p_title_key[j].i_occ > p_title_key[i].i_occ )
{
memcpy( &pi_key, &(p_title_key[j].pi_key), sizeof(dvd_key_t) );
k = p_title_key[j].i_occ;
memcpy( &(p_title_key[j].pi_key),
&(p_title_key[i].pi_key), sizeof(dvd_key_t) );
p_title_key[j].i_occ = p_title_key[i].i_occ;
memcpy( &(p_title_key[i].pi_key),&pi_key, sizeof(dvd_key_t) );
p_title_key[i].i_occ = k;
}
}
}
#ifdef STATS
intf_WarnMsg( 1, "css info: key(s) & key probability" );
intf_WarnMsg( 1, "----------------------------------" );
#endif
for( i=0 ; i<i_registered_keys ; i++ )
{
#ifdef STATS
intf_WarnMsg( 1, "%d) %02X %02X %02X %02X %02X - %3.2f%%", i,
p_title_key[i].pi_key[0], p_title_key[i].pi_key[1],
p_title_key[i].pi_key[2], p_title_key[i].pi_key[3],
p_title_key[i].pi_key[4],
p_title_key[i].i_occ * 100.0 / i_total_keys_found );
#endif
if( p_title_key[i_highest].i_occ * 100.0 / i_total_keys_found
<= p_title_key[i].i_occ*100.0 / i_total_keys_found )
{
i_highest = i;
}
}
/* The "find the key with the highest probability" code
* is untested, as I haven't been able to find a VOB that
* produces multiple keys (RT)
*/
intf_WarnMsg( 3, "css info: title %d, key %02X %02X %02X %02X %02X",
i_title, p_title_key[i_highest].pi_key[0],
p_title_key[i_highest].pi_key[1],
p_title_key[i_highest].pi_key[2],
p_title_key[i_highest].pi_key[3],
p_title_key[i_highest].pi_key[4] );
memcpy( p_css->pi_title_key,
p_title_key[i_highest].pi_key, KEY_SIZE );
intf_WarnMsg( 2, "css info: vts key initialized" );
return 0;
return -1;
#else /* HAVE_CSS */
intf_ErrMsg( "css error: css decryption unavailable" );
......@@ -520,9 +427,6 @@ int CSSDescrambleSector( dvd_key_t pi_key, u8* pi_sec )
pi_sec++;
i_t5 >>= 8;
}
pi_sec[0x14] &= 0x8F;
}
return 0;
......
......@@ -2,7 +2,7 @@
* dvd_ifo.c: Functions for ifo parsing
*****************************************************************************
* Copyright (C) 1999-2001 VideoLAN
* $Id: dvd_ifo.c,v 1.23 2001/04/20 05:40:03 stef Exp $
* $Id: dvd_ifo.c,v 1.24 2001/04/22 00:08:25 stef Exp $
*
* Author: Stphane Borel <stef@via.ecp.fr>
*
......@@ -663,9 +663,9 @@ DumpBits( p_ifo, pi_buffer, &p_current, 2 );
p_current = FillBuffer( p_ifo, pi_buffer, i_start +
title_inf.pi_start_byte[i] );
title_inf.p_title_start[i].i_program_chain_num =
title_inf.p_title_start[i].i_title_id =
ReadWord( p_ifo, pi_buffer, &p_current );
title_inf.p_title_start[i].i_program_num = ReadWord( p_ifo, pi_buffer, &p_current );
title_inf.p_title_start[i].i_chapter = ReadWord( p_ifo, pi_buffer, &p_current );
//fprintf( stderr, "VTS %d title_inf Pgc: %d Prg: %d\n", i,title_inf.p_title_start[i].i_program_chain_num, title_inf.p_title_start[i].i_program_num );
}
}
......
......@@ -2,7 +2,7 @@
* dvd_ifo.h: Structures for ifo parsing
*****************************************************************************
* Copyright (C) 1999-2001 VideoLAN
* $Id: dvd_ifo.h,v 1.13 2001/04/20 05:40:03 stef Exp $
* $Id: dvd_ifo.h,v 1.14 2001/04/22 00:08:25 stef Exp $
*
* Author: Stphane Borel <stef@via.ecp.fr>
*
......@@ -459,8 +459,8 @@ typedef struct vts_manager_s
* we have a pointer to this structure for each tts */
typedef struct title_start_s
{
u16 i_program_chain_num; // 2 bytes; Chapters/PGs
u16 i_program_num; // 2 bytes
u16 i_title_id; // 2 bytes; Chapters/PGs
u16 i_chapter; // 2 bytes
} title_start_t;
/* Main struct for tts
......
......@@ -10,7 +10,7 @@
* -dvd_udf to find files
*****************************************************************************
* Copyright (C) 1998-2001 VideoLAN
* $Id: input_dvd.c,v 1.48 2001/04/20 05:40:03 stef Exp $
* $Id: input_dvd.c,v 1.49 2001/04/22 00:08:25 stef Exp $
*
* Author: Stphane Borel <stef@via.ecp.fr>
*
......@@ -242,14 +242,22 @@ lang_tbl[] =
/*****************************************************************************
* Local prototypes
*****************************************************************************/
/* called from outside */
static int DVDProbe ( probedata_t *p_data );
static int DVDRead ( struct input_thread_s *, data_packet_t ** );
static void DVDInit ( struct input_thread_s * );
static void DVDEnd ( struct input_thread_s * );
static void DVDSeek ( struct input_thread_s *, off_t );
static int DVDSetArea ( struct input_thread_s *, struct input_area_s * );
static int DVDRead ( struct input_thread_s *, data_packet_t ** );
static void DVDSeek ( struct input_thread_s *, off_t );
static int DVDRewind ( struct input_thread_s * );
/* called only inside */
static char * Language( u16 );
static int DVDChooseAngle( thread_dvd_data_t * );
static int DVDFindCell( thread_dvd_data_t * );
static int DVDFindSector( thread_dvd_data_t * );
static int DVDChapterSelect( thread_dvd_data_t *, int );
/*****************************************************************************
* Functions exported as capabilities. They are declared as static so that
* we don't pollute the namespace too much.
......@@ -340,138 +348,187 @@ static int DVDProbe( probedata_t *p_data )
}
/*****************************************************************************
* DVDFindCell: adjust the title cell index with the program cell
* DVDInit: initializes DVD structures
*****************************************************************************/
static int DVDFindCell( thread_dvd_data_t * p_dvd )
static void DVDInit( input_thread_t * p_input )
{
int i_cell;
int i_index;
thread_dvd_data_t * p_dvd;
input_area_t * p_area;
int i_title;
int i_chapter;
int i;
#define title \
p_dvd->p_ifo->vts.title_unit.p_title[p_dvd->i_program_chain-1].title
#define cell p_dvd->p_ifo->vts.cell_inf
i_cell = p_dvd->i_cell;
i_index = p_dvd->i_prg_cell;
/* I don't want DVDs to start playing immediately */
// p_input->stream.i_new_status = PAUSE_S;
if( i_cell >= cell.i_cell_nb )
p_dvd = malloc( sizeof(thread_dvd_data_t) );
if( p_dvd == NULL )
{
return -1;
intf_ErrMsg( "dvd error: out of memory" );
p_input->b_error = 1;
return;
}
p_input->p_plugin_data = (void *)p_dvd;
p_input->p_method_data = NULL;
p_dvd->i_fd = p_input->i_handle;
while( ( ( title.p_cell_pos[i_index].i_vob_id !=
cell.p_cell_map[i_cell].i_vob_id ) ||
( title.p_cell_pos[i_index].i_cell_id !=
cell.p_cell_map[i_cell].i_cell_id ) ) &&
( i_cell < cell.i_cell_nb - 1 ) )
/* reading several block once seems to cause lock-up
* when using input_ToggleES
* who wrote thez damn buggy piece of shit ??? --stef */
p_dvd->i_block_once = 1;//32;
p_input->i_read_once = 8;//128;
i = CSSTest( p_input->i_handle );
if( i < 0 )
{
i_cell++;
free( p_dvd );
p_input->b_error = 1;
return;
}
intf_WarnMsg( 1, "FindCell: i_cell %d i_index %d found %d nb %d",
p_dvd->i_cell,
p_dvd->i_prg_cell,
i_cell,
cell.i_cell_nb );
p_dvd->b_encrypted = i;
p_dvd->i_cell = i_cell;
return 0;
#undef title
#undef cell
}
lseek( p_input->i_handle, 0, SEEK_SET );
/*****************************************************************************
* DVDFindSector: find cell index in adress map from index in
* information table program map and give corresponding sectors.
*****************************************************************************/
static int DVDFindSector( thread_dvd_data_t * p_dvd )
{
#define title \
p_dvd->p_ifo->vts.title_unit.p_title[p_dvd->i_program_chain-1].title
/* Reading structures initialisation */
p_input->p_method_data =
DVDNetlistInit( 2048, 8192, 2048, DVD_LB_SIZE, p_dvd->i_block_once );
intf_WarnMsg( 2, "dvd info: netlist initialized" );
if( p_dvd->i_sector > title.p_cell_play[p_dvd->i_prg_cell].i_end_sector )
/* Ifo allocation & initialisation */
if( IfoCreate( p_dvd ) < 0 )
{
p_dvd->i_prg_cell++;
intf_ErrMsg( "dvd error: allcation error in ifo" );
p_input->b_error = 1;
return;
}
/* basic handling of angles */
switch( ( ( title.p_cell_play[p_dvd->i_prg_cell].i_category & 0xf000 )
>> 12 ) )
if( IfoInit( p_dvd->p_ifo ) < 0 )
{
intf_ErrMsg( "dvd error: fatal failure in ifo" );
free( p_dvd );
p_input->b_error = 1;
return;
}
/* CSS initialisation */
if( p_dvd->b_encrypted )
{
p_dvd->p_css = malloc( sizeof(css_t) );
if( p_dvd->p_css == NULL )
{
case 0x5:
p_dvd->i_prg_cell += p_dvd->i_angle - 1;
intf_WarnMsg( 1, "dvd info: choosing angle %d", p_dvd->i_angle );
break;
case 0x9:
case 0xd:
p_dvd->i_prg_cell += p_dvd->i_angle_nb - p_dvd->i_angle;
break;
intf_ErrMsg( "dvd error: couldn't create css structure" );
free( p_dvd );
p_input->b_error = 1;
return;
}
p_dvd->p_css->i_agid = 0;
if( CSSInit( p_input->i_handle, p_dvd->p_css ) < 0 )
{
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, "dvd info: css initialized" );
}
if( DVDFindCell( p_dvd ) < 0 )
/* Set stream and area data */
vlc_mutex_lock( &p_input->stream.stream_lock );
/* Initialize ES structures */
input_InitStream( p_input, sizeof( stream_ps_data_t ) );
/* disc input method */
p_input->stream.i_method = INPUT_METHOD_DVD;
#define title_inf p_dvd->p_ifo->vmg.title_inf
intf_WarnMsg( 2, "dvd info: number of titles: %d", title_inf.i_title_nb );
#define area p_input->stream.pp_areas
/* We start from 1 here since the default area 0
* is reserved for video_ts.vob */
for( i = 1 ; i <= title_inf.i_title_nb ; i++ )
{
intf_ErrMsg( "dvd error: can't find sector" );
return -1;
input_AddArea( p_input );
/* Titles are Program Chains */
area[i]->i_id = i;
/* Absolute start offset and size
* We can only set that with vts ifo, so we do it during the
* first call to DVDSetArea */
area[i]->i_start = 0;
area[i]->i_size = 0;
/* Number of chapters */
area[i]->i_part_nb = title_inf.p_attr[i-1].i_chapter_nb;
area[i]->i_part = 1;
/* Number of angles */
area[i]->i_angle_nb = 0;
area[i]->i_angle = 1;
/* Offset to vts_i_0.ifo */
area[i]->i_plugin_data = p_dvd->p_ifo->i_off +
( title_inf.p_attr[i-1].i_start_sector * DVD_LB_SIZE );
}
#undef area
/* Get requested title - if none try the first title */
i_title = main_GetIntVariable( INPUT_TITLE_VAR, 1 );
if( i_title <= 0 || i_title > title_inf.i_title_nb )
{
i_title = 1;
}
/* Find start and end sectors of new cell */
p_dvd->i_sector = MAX(
p_dvd->p_ifo->vts.cell_inf.p_cell_map[p_dvd->i_cell].i_start_sector,
title.p_cell_play[p_dvd->i_prg_cell].i_start_sector );
p_dvd->i_end_sector = MIN(
p_dvd->p_ifo->vts.cell_inf.p_cell_map[p_dvd->i_cell].i_end_sector,
title.p_cell_play[p_dvd->i_prg_cell].i_end_sector );
#undef title_inf
intf_WarnMsg( 1, "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,
p_dvd->p_ifo->vts.cell_inf.p_cell_map[p_dvd->i_cell].i_start_sector,
p_dvd->p_ifo->vts.cell_inf.p_cell_map[p_dvd->i_cell].i_end_sector,
p_dvd->i_prg_cell,
title.p_cell_play[p_dvd->i_prg_cell].i_start_sector,
title.p_cell_play[p_dvd->i_prg_cell].i_end_sector,
title.p_cell_play[p_dvd->i_prg_cell].i_category,
title.p_cell_play[p_dvd->i_prg_cell].i_first_ilvu_vobu_esector,
title.p_cell_play[p_dvd->i_prg_cell].i_last_vobu_start_sector );
/* Get requested chapter - if none defaults to first one */
i_chapter = main_GetIntVariable( INPUT_CHAPTER_VAR, 1 );
if( i_chapter <= 0 )
{
i_chapter = 1;
}
#undef title
p_input->stream.pp_areas[i_title]->i_part = i_chapter;
return 0;
p_area = p_input->stream.pp_areas[i_title];
vlc_mutex_unlock( &p_input->stream.stream_lock );
/* set title, chapter, audio and subpic */
DVDSetArea( p_input, p_area );
return;
}
/*****************************************************************************
* DVDChapterSelect: find the cell corresponding to requested chapter
* DVDEnd: frees unused data
*****************************************************************************/
static int DVDChapterSelect( thread_dvd_data_t * p_dvd, int i_chapter )
static void DVDEnd( input_thread_t * p_input )
{
#define title \
p_dvd->p_ifo->vts.title_unit.p_title[p_dvd->i_program_chain-1].title
thread_dvd_data_t * p_dvd;
dvd_netlist_t * p_netlist;
/* Find cell index in Program chain for current chapter */
p_dvd->i_prg_cell = title.chapter_map.pi_start_cell[i_chapter-1] - 1;
p_dvd->i_cell = 0;
p_dvd->i_sector = 0;
p_dvd = (thread_dvd_data_t*)p_input->p_plugin_data;
p_netlist = (dvd_netlist_t *)p_input->p_method_data;
/* Search for cell_index in cell adress_table and initialize start sector */
if( DVDFindSector( p_dvd ) < 0 )
if( p_dvd->b_encrypted )
{
intf_ErrMsg( "dvd error: can't select chapter" );
return -1;
free( p_dvd->p_css );
}
/* start is : beginning of vts vobs + offset to vob x */
p_dvd->i_start = p_dvd->i_title_start +
DVD_LB_SIZE * (off_t)( p_dvd->i_sector );
/* Position the fd pointer on the right address */
p_dvd->i_start = lseek( p_dvd->i_fd, p_dvd->i_start, SEEK_SET );
p_dvd->i_chapter = i_chapter;
#undef title
return 0;
IfoDestroy( p_dvd->p_ifo );
free( p_dvd );
DVDNetlistEnd( p_netlist );
}
/*****************************************************************************
......@@ -536,13 +593,13 @@ static int DVDSetArea( input_thread_t * p_input, input_area_t * p_area )
/* title position inside the selected vts */
p_dvd->i_vts_title =
vmg.title_inf.p_attr[p_dvd->i_title-1].i_title_num;
p_dvd->i_program_chain =
vts.title_inf.p_title_start[p_dvd->i_vts_title-1].i_program_chain_num;
p_dvd->i_title_id =
vts.title_inf.p_title_start[p_dvd->i_vts_title-1].i_title_id;
intf_WarnMsg( 1, "dvd: title %d vts_title %d pgc %d",
p_dvd->i_title,
p_dvd->i_vts_title,
p_dvd->i_program_chain );
p_dvd->i_title_id );
/* css title key for current vts */
if( p_dvd->b_encrypted )
......@@ -592,7 +649,7 @@ static int DVDSetArea( input_thread_t * p_input, input_area_t * p_area )
/* last video cell */
p_dvd->i_cell = 0;
p_dvd->i_prg_cell = -1 +
vts.title_unit.p_title[p_dvd->i_program_chain-1].title.i_cell_nb;
vts.title_unit.p_title[p_dvd->i_title_id-1].title.i_cell_nb;
if( DVDFindCell( p_dvd ) < 0 )
{
......@@ -685,7 +742,7 @@ static int DVDSetArea( input_thread_t * p_input, input_area_t * p_area )
for( i = 1 ; i <= vts.manager_inf.i_audio_nb ; i++ )
{
//#ifdef DEBUG
#ifdef DEBUG
intf_WarnMsg( 1, "Audio %d: %x %x %x %x %x %x %x %x %x %x %x %x", i,
vts.manager_inf.p_audio_attr[i-1].i_num_channels,
vts.manager_inf.p_audio_attr[i-1].i_coding_mode,
......@@ -699,7 +756,7 @@ static int DVDSetArea( input_thread_t * p_input, input_area_t * p_area )
vts.manager_inf.p_audio_attr[i-1].i_sample_freq,
vts.manager_inf.p_audio_attr[i-1].i_lang_code,
vts.manager_inf.p_audio_attr[i-1].i_caption );
//#endif
#endif
switch( vts.manager_inf.p_audio_attr[i-1].i_coding_mode )
{
......@@ -813,219 +870,69 @@ static int DVDSetArea( input_thread_t * p_input, input_area_t * p_area )
{
p_area = p_input->stream.p_selected_area;
}
#undef vts
#undef vmg
/*
* Chapter selection
*/
if( ( p_area->i_part > 0 ) &&
( p_area->i_part <= p_area->i_part_nb ) )
if( p_area->i_part != p_dvd->i_chapter )
{
if( DVDChapterSelect( p_dvd, p_area->i_part ) < 0 )
if( ( p_area->i_part > 0 ) &&
( p_area->i_part <= p_area->i_part_nb ))
{
intf_ErrMsg( "dvd error: can't set chapter in area" );
p_input->b_error = 1;
return -1;
if( DVDChapterSelect( p_dvd, p_area->i_part ) < 0 )
{
intf_ErrMsg( "dvd error: can't set chapter in area" );
p_input->b_error = 1;
return -1;
}
p_input->stream.p_selected_area->i_tell = p_dvd->i_start -
p_area->i_start;
p_input->stream.p_selected_area->i_part = p_dvd->i_chapter;
intf_WarnMsg( 2, "dvd info: chapter %d start at: %lld",
p_area->i_part, p_area->i_tell );
}
else
{
p_area->i_part = 1;
p_dvd->i_chapter = 1;
}
p_input->stream.p_selected_area->i_tell = p_dvd->i_start -
p_area->i_start;
p_input->stream.p_selected_area->i_part = p_dvd->i_chapter;
intf_WarnMsg( 2, "dvd info: chapter %d start at: %lld",
p_area->i_part, p_area->i_tell );
}
vlc_mutex_unlock( &p_input->stream.stream_lock );
#undef vts
#undef vmg
return 0;
}
/*****************************************************************************
* DVDInit: initializes DVD structures
*****************************************************************************/
static void DVDInit( input_thread_t * p_input )
{
thread_dvd_data_t * p_dvd;
input_area_t * p_area;
int i_title;
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( "dvd error: out of memory" );
p_input->b_error = 1;
return;
}
p_input->p_plugin_data = (void *)p_dvd;
p_input->p_method_data = NULL;
p_dvd->i_fd = p_input->i_handle;
/* reading several block once seems to cause lock-up
* when using input_ToggleES
* who wrote thez damn buggy piece of shit ??? --stef */
p_dvd->i_block_once = 1;//32;
p_input->i_read_once = 8;//128;
i = CSSTest( p_input->i_handle );
if( i < 0 )
{
free( p_dvd );
p_input->b_error = 1;
return;
}
p_dvd->b_encrypted = i;
lseek( p_input->i_handle, 0, SEEK_SET );
/* Reading structures initialisation */
p_input->p_method_data =
DVDNetlistInit( 2048, 8192, 2048, DVD_LB_SIZE, p_dvd->i_block_once );
intf_WarnMsg( 2, "dvd info: netlist initialized" );
/* Ifo allocation & initialisation */
if( IfoCreate( p_dvd ) < 0 )
{
intf_ErrMsg( "dvd error: allcation error in ifo" );
p_input->b_error = 1;
return;
}
if( IfoInit( p_dvd->p_ifo ) < 0 )
{
intf_ErrMsg( "dvd error: fatal failure in ifo" );
free( p_dvd );
p_input->b_error = 1;
return;
}
#define title \
p_dvd->p_ifo->vts.title_unit.p_title[p_dvd->i_title_id-1].title
/* CSS initialisation */
if( p_dvd->b_encrypted )
if( p_area->i_angle != p_dvd->i_angle )
{
p_dvd->p_css = malloc( sizeof(css_t) );
if( p_dvd->p_css == NULL )
if( title.p_cell_play[p_dvd->i_prg_cell].i_category & 0xf000 )
{
intf_ErrMsg( "dvd error: couldn't create css structure" );
free( p_dvd );
p_input->b_error = 1;
return;