Commit be685831 authored by Sam Hocevar's avatar Sam Hocevar

* ./plugins/dvd/*: fixed a few inconsistences.

  * ./plugins/dvd/*: renamed i_start/i_end couples when they actually
    meant i_first/i_last.
parent 1ac32f37
......@@ -2,7 +2,7 @@
* dvd.h: thread structure of the DVD plugin
*****************************************************************************
* Copyright (C) 1999-2001 VideoLAN
* $Id: dvd.h,v 1.3 2002/03/09 16:48:33 stef Exp $
* $Id: dvd.h,v 1.4 2002/05/20 22:45:03 sam Exp $
*
* Author: Stéphane Borel <stef@via.ecp.fr>
*
......@@ -56,7 +56,7 @@ typedef struct thread_dvd_data_s
int i_vts_start; /* offset to beginning of vts */
int i_vts_lb; /* sector in vts */
int i_end_lb; /* last sector of current cell */
int i_last_lb; /* last sector of current cell */
/* Structure that contains all information of the DVD */
struct ifo_s * p_ifo;
......
......@@ -8,7 +8,7 @@
* -dvd_udf to find files
*****************************************************************************
* Copyright (C) 1998-2001 VideoLAN
* $Id: dvd_access.c,v 1.15 2002/04/25 21:52:42 sam Exp $
* $Id: dvd_access.c,v 1.16 2002/05/20 22:45:03 sam Exp $
*
* Author: Stphane Borel <stef@via.ecp.fr>
*
......@@ -102,7 +102,6 @@ void _M( access_getfunctions)( function_list_t * p_function_list )
* Data access functions
*/
#define DVDLB p_dvd->i_vts_start + p_dvd->i_vts_lb
#define DVDTell LB2OFF( p_dvd->i_vts_start + p_dvd->i_vts_lb ) \
- p_input->stream.p_selected_area->i_start
......@@ -295,8 +294,8 @@ static int DVDSetProgram( input_thread_t * p_input,
p_dvd->i_prg_cell += ( p_program->i_number - p_dvd->i_angle );
p_dvd->i_map_cell = CellPrg2Map( p_dvd );
p_dvd->i_map_cell += p_dvd->i_angle_cell;
p_dvd->i_vts_lb = CellStartSector( p_dvd );
p_dvd->i_end_lb = CellEndSector( p_dvd );
p_dvd->i_vts_lb = CellFirstSector( p_dvd );
p_dvd->i_last_lb = CellLastSector( p_dvd );
p_dvd->i_angle = p_program->i_number;
}
else
......@@ -379,8 +378,8 @@ static int DVDSetArea( input_thread_t * p_input, input_area_t * p_area )
if( p_area != p_input->stream.p_selected_area )
{
int i_vts_title;
u32 i_start;
u32 i_size;
u32 i_first;
u32 i_last;
/* Reset the Chapter position of the old title */
p_input->stream.p_selected_area->i_part = 1;
......@@ -418,31 +417,32 @@ static int DVDSetArea( input_thread_t * p_input, input_area_t * p_area )
vts.title_unit.p_title[p_dvd->i_title_id-1].title.i_cell_nb;
p_dvd->i_map_cell = 0;
p_dvd->i_map_cell = CellPrg2Map( p_dvd );
i_size = CellEndSector( p_dvd );
i_last = CellLastSector( p_dvd );
/* first cell */
p_dvd->i_prg_cell = 0;
p_dvd->i_map_cell = 0;
p_dvd->i_angle_cell = 0;
p_dvd->i_map_cell = CellPrg2Map ( p_dvd );
p_dvd->i_vts_lb = CellStartSector( p_dvd );
p_dvd->i_end_lb = CellEndSector ( p_dvd );
p_dvd->i_vts_lb = CellFirstSector( p_dvd );
p_dvd->i_last_lb = CellLastSector ( p_dvd );
/* Force libdvdcss to check its title key.
* It is only useful for title cracking method. Methods using the
* decrypted disc key are fast enough to check the key at each seek */
if( ( i_start = dvdcss_seek( p_dvd->dvdhandle, DVDLB,
DVDCSS_SEEK_KEY ) ) < 0 )
i_first = dvdcss_seek( p_dvd->dvdhandle,
p_dvd->i_vts_start + p_dvd->i_vts_lb,
DVDCSS_SEEK_KEY );
if( i_first < 0 )
{
intf_ErrMsg( "dvd error: %s", dvdcss_error( p_dvd->dvdhandle ) );
return -1;
}
i_size -= p_dvd->i_vts_lb + 1;
/* Area definition */
p_input->stream.p_selected_area->i_start = LB2OFF( i_start );
p_input->stream.p_selected_area->i_size = LB2OFF( i_size );
p_input->stream.p_selected_area->i_start = LB2OFF( i_first );
p_input->stream.p_selected_area->i_size =
LB2OFF( i_last - p_dvd->i_vts_lb + 1 );
/* Destroy obsolete ES by reinitializing programs */
DVDFlushStream( p_input );
......@@ -457,8 +457,8 @@ static int DVDSetArea( input_thread_t * p_input, input_area_t * p_area )
DVDSetProgram( p_input,
p_input->stream.pp_programs[p_dvd->i_angle-1] );
intf_WarnMsg( 3, "dvd info: title start: %d size: %d",
i_start, i_size );
intf_WarnMsg( 3, "dvd info: title first %i, last %i, size %i",
i_first, i_last, i_last - p_dvd->i_vts_lb + 1 );
IfoPrintTitle( p_dvd );
/* No PSM to read in DVD mode, we already have all information */
......@@ -595,13 +595,13 @@ static void DVDSeek( input_thread_t * p_input, off_t i_off )
/* if we're inside a multi-angle zone, we have to choose i_sector
* in the current angle ; we can't do it all the time since cells
* can be very wide out of such zones */
p_dvd->i_vts_lb = CellStartSector( p_dvd );
p_dvd->i_vts_lb = CellFirstSector( p_dvd );
}
p_dvd->i_end_lb = CellEndSector ( p_dvd );
p_dvd->i_last_lb = CellLastSector( p_dvd );
p_dvd->i_chapter = CellPrg2Chapter( p_dvd );
if( dvdcss_seek( p_dvd->dvdhandle, DVDLB,
if( dvdcss_seek( p_dvd->dvdhandle, p_dvd->i_vts_start + p_dvd->i_vts_lb,
DVDCSS_SEEK_MPEG ) < 0 )
{
intf_ErrMsg( "dvd error: %s", dvdcss_error( p_dvd->dvdhandle ) );
......
......@@ -2,7 +2,7 @@
* dvd_ifo.c: Functions for ifo parsing
*****************************************************************************
* Copyright (C) 1999-2001 VideoLAN
* $Id: dvd_ifo.c,v 1.46 2002/04/03 06:23:08 sam Exp $
* $Id: dvd_ifo.c,v 1.47 2002/05/20 22:45:03 sam Exp $
*
* Authors: Stphane Borel <stef@via.ecp.fr>
* German Tischler <tanis@gaspode.franken.de>
......@@ -197,7 +197,7 @@ int IfoInit( ifo_t * p_ifo )
TITINF.i_title_nb = ReadWord( p_ifo, p_buf, &p_tmp );
//fprintf( stderr, "title_inf: TTU nb %d\n", TITINF.i_title_nb );
DumpBytes( p_ifo, p_buf, &p_tmp, 2 );
TITINF.i_end_byte = ReadDouble( p_ifo, p_buf, &p_tmp );
TITINF.i_last_byte = ReadDouble( p_ifo, p_buf, &p_tmp );
/* parsing of title attributes */
TITINF.p_attr = malloc( TITINF.i_title_nb *sizeof(title_attr_t) );
......@@ -251,7 +251,7 @@ int IfoInit( ifo_t * p_ifo )
PARINF.i_country_nb = ReadWord( p_ifo, p_buf, &p_tmp );
PARINF.i_vts_nb = ReadWord( p_ifo, p_buf, &p_tmp );
PARINF.i_end_byte = ReadDouble( p_ifo, p_buf, &p_tmp );
PARINF.i_last_byte = ReadDouble( p_ifo, p_buf, &p_tmp );
PARINF.p_parental_desc = malloc( PARINF.i_country_nb
* sizeof(parental_desc_t) );
......@@ -323,7 +323,7 @@ int IfoInit( ifo_t * p_ifo )
VTSINF.i_vts_nb = ReadWord( p_ifo, p_buf, &p_tmp );;
//fprintf( stderr, "VTS ATTR Nb: %d\n", VTSINF.i_vts_nb );
DumpBytes( p_ifo, p_buf, &p_tmp, 2 );
VTSINF.i_end_byte = ReadDouble( p_ifo, p_buf, &p_tmp );
VTSINF.i_last_byte = ReadDouble( p_ifo, p_buf, &p_tmp );
VTSINF.pi_vts_attr_start_byte =
malloc( VTSINF.i_vts_nb * sizeof(u32) );
if( VTSINF.pi_vts_attr_start_byte == NULL )
......@@ -351,7 +351,7 @@ int IfoInit( ifo_t * p_ifo )
OFF2LB( VTSINF.pi_vts_attr_start_byte[i] ) )
+ ( VTSINF.pi_vts_attr_start_byte[i] & 0x7ff );
VTSINF.p_vts_attr[i].i_end_byte =
VTSINF.p_vts_attr[i].i_last_byte =
ReadDouble( p_ifo, p_buf, &p_tmp );
VTSINF.p_vts_attr[i].i_cat_app_type =
ReadDouble( p_ifo, p_buf, &p_tmp );
......@@ -471,9 +471,9 @@ int IfoTitleSet( ifo_t * p_ifo, int i_title )
ReadBytes( p_ifo, p_buf, &p_tmp, MGINF.psz_id , 12 );
MGINF.psz_id[12] = '\0';
MGINF.i_end_sector = ReadDouble( p_ifo, p_buf, &p_tmp );
MGINF.i_last_sector = ReadDouble( p_ifo, p_buf, &p_tmp );
DumpBytes( p_ifo, p_buf, &p_tmp, 12 );
MGINF.i_inf_end_sector = ReadDouble( p_ifo, p_buf, &p_tmp );
MGINF.i_inf_last_sector = ReadDouble( p_ifo, p_buf, &p_tmp );
DumpBytes( p_ifo, p_buf, &p_tmp, 1 );
MGINF.i_spec_ver = ReadByte( p_ifo, p_buf, &p_tmp );
MGINF.i_cat = ReadDouble( p_ifo, p_buf, &p_tmp );
......@@ -599,7 +599,7 @@ int IfoTitleSet( ifo_t * p_ifo, int i_title )
TITINF.i_title_nb = ReadWord( p_ifo, p_buf, &p_tmp );
//fprintf( stderr, "VTS title_inf nb: %d\n", TITINF.i_title_nb );
DumpBytes( p_ifo, p_buf, &p_tmp, 2 );
TITINF.i_end_byte = ReadDouble( p_ifo, p_buf, &p_tmp );
TITINF.i_last_byte = ReadDouble( p_ifo, p_buf, &p_tmp );
TITINF.pi_start_byte = malloc( TITINF.i_title_nb * sizeof(u32) );
if( TITINF.pi_start_byte == NULL )
......@@ -675,7 +675,7 @@ int IfoTitleSet( ifo_t * p_ifo, int i_title )
TIMINF.i_nb = ReadWord( p_ifo, p_buf, &p_tmp );;
DumpBytes( p_ifo, p_buf, &p_tmp, 2 );
TIMINF.i_end_byte = ReadDouble( p_ifo, p_buf, &p_tmp );
TIMINF.i_last_byte = ReadDouble( p_ifo, p_buf, &p_tmp );
TIMINF.pi_start_byte = malloc( TIMINF.i_nb * sizeof(u32) );
if( TIMINF.pi_start_byte == NULL )
......@@ -702,6 +702,8 @@ int IfoTitleSet( ifo_t * p_ifo, int i_title )
DumpBytes( p_ifo, p_buf, &p_tmp, 1 );
TIMINF.p_time_map[i].i_entry_nb = ReadWord( p_ifo, p_buf, &p_tmp );
if( TIMINF.p_time_map[i].i_entry_nb )
{
TIMINF.p_time_map[i].pi_sector =
malloc( TIMINF.p_time_map[i].i_entry_nb * sizeof(u32) );
if( TIMINF.p_time_map[i].pi_sector == NULL )
......@@ -717,6 +719,7 @@ int IfoTitleSet( ifo_t * p_ifo, int i_title )
}
}
}
}
#undef TIMINF
if( MGINF.i_menu_cell_inf_start_sector
......@@ -786,9 +789,12 @@ static int FreeTitleSet( vts_t * p_vts )
if( p_vts->manager_inf.i_time_inf_start_sector )
{
for( i = 0 ; i < p_vts->time_inf.i_nb ; i++ )
{
if( p_vts->time_inf.p_time_map[i].i_entry_nb )
{
free( p_vts->time_inf.p_time_map[i].pi_sector );
}
}
free( p_vts->time_inf.p_time_map );
free( p_vts->time_inf.pi_start_byte );
......@@ -1079,10 +1085,10 @@ static int ReadTitle( ifo_t * p_ifo, title_t * p_title, int i_block, int i_bytes
PLAY.i_still_time = ReadByte( p_ifo, p_buf, &p_tmp );
PLAY.i_command_nb = ReadByte( p_ifo, p_buf, &p_tmp );
PLAY.i_play_time = ReadDouble( p_ifo, p_buf, &p_tmp );
PLAY.i_start_sector = ReadDouble( p_ifo, p_buf, &p_tmp );
PLAY.i_first_sector = ReadDouble( p_ifo, p_buf, &p_tmp );
PLAY.i_first_ilvu_vobu_esector = ReadDouble( p_ifo, p_buf, &p_tmp );
PLAY.i_last_vobu_start_sector = ReadDouble( p_ifo, p_buf, &p_tmp );
PLAY.i_end_sector = ReadDouble( p_ifo, p_buf, &p_tmp );
PLAY.i_last_sector = ReadDouble( p_ifo, p_buf, &p_tmp );
#undef PLAY
}
}
......@@ -1174,7 +1180,7 @@ static int ReadUnitInf( ifo_t * p_ifo, unit_inf_t * p_unit_inf,
p_unit_inf->i_title_nb = ReadWord( p_ifo, p_buf, &p_tmp );
//fprintf( stderr, "Unit nb: %d\n", p_unit_inf->i_title_nb );
DumpBytes( p_ifo, p_buf, &p_tmp, 2 );
p_unit_inf->i_end_byte = ReadDouble( p_ifo, p_buf, &p_tmp );
p_unit_inf->i_last_byte = ReadDouble( p_ifo, p_buf, &p_tmp );
p_unit_inf->p_title =
malloc( p_unit_inf->i_title_nb * sizeof(unit_title_t) );
......@@ -1244,9 +1250,9 @@ static int ReadTitleUnit( ifo_t * p_ifo, title_unit_t * p_title_unit,
p_title_unit->i_unit_nb = ReadWord( p_ifo, p_buf, &p_tmp );
DumpBytes( p_ifo, p_buf, &p_tmp, 2 );
p_title_unit->i_end_byte = ReadDouble( p_ifo, p_buf, &p_tmp );
p_title_unit->i_last_byte = ReadDouble( p_ifo, p_buf, &p_tmp );
//fprintf(stderr, "Unit: nb %d end %d\n", p_title_unit->i_unit_nb, p_title_unit->i_end_byte );
//fprintf(stderr, "Unit: nb %d last %d\n", p_title_unit->i_unit_nb, p_title_unit->i_last_byte );
p_title_unit->p_unit = malloc( p_title_unit->i_unit_nb * sizeof(unit_t) );
if( p_title_unit->p_unit == NULL )
......@@ -1321,11 +1327,11 @@ static int ReadCellInf( ifo_t * p_ifo, cell_inf_t * p_cell_inf, int i_block )
p_cell_inf->i_vob_nb = ReadWord( p_ifo, p_buf, &p_tmp );
DumpBytes( p_ifo, p_buf, &p_tmp, 2 );
p_cell_inf->i_end_byte = ReadDouble( p_ifo, p_buf, &p_tmp );
p_cell_inf->i_last_byte = ReadDouble( p_ifo, p_buf, &p_tmp );
p_cell_inf->i_cell_nb = (p_cell_inf->i_end_byte/* - 7*/) / sizeof(cell_map_t);
p_cell_inf->i_cell_nb = (p_cell_inf->i_last_byte + 1/* - 7*/) / sizeof(cell_map_t);
/* fprintf( stderr, "Cell inf: vob %d end %d cell %d\n", p_cell_inf->i_vob_nb, p_cell_inf->i_end_byte, p_cell_inf->i_cell_nb );
/* fprintf( stderr, "Cell inf: vob %d, %d cells, last byte %d\n", p_cell_inf->i_vob_nb, p_cell_inf->i_cell_nb, p_cell_inf->i_last_byte );
*/
p_cell_inf->p_cell_map =
malloc( p_cell_inf->i_cell_nb *sizeof(cell_map_t) );
......@@ -1341,9 +1347,9 @@ static int ReadCellInf( ifo_t * p_ifo, cell_inf_t * p_cell_inf, int i_block )
MAP.i_vob_id = ReadWord( p_ifo, p_buf, &p_tmp );
MAP.i_cell_id = ReadByte( p_ifo, p_buf, &p_tmp );
DumpBytes( p_ifo, p_buf, &p_tmp, 1 );
MAP.i_start_sector = ReadDouble( p_ifo, p_buf, &p_tmp );
MAP.i_first_sector = ReadDouble( p_ifo, p_buf, &p_tmp );
/* fprintf(stderr, "sector[%d] %d (%d)\n", i,ntohl(*(u32*)(p_tmp)), p_ifo->i_pos);*/
MAP.i_end_sector = ReadDouble( p_ifo, p_buf, &p_tmp );
MAP.i_last_sector = ReadDouble( p_ifo, p_buf, &p_tmp );
#undef MAP
}
......@@ -1374,8 +1380,8 @@ static int ReadVobuMap( ifo_t * p_ifo, vobu_map_t * p_vobu_map, int i_block )
i_start = p_ifo->i_pos;
//fprintf( stderr, "VOBU ADMAP\n" );
p_vobu_map->i_end_byte = ReadDouble( p_ifo, p_buf, &p_tmp );
i_max = ( i_start + p_vobu_map->i_end_byte + 1 - p_ifo->i_pos )
p_vobu_map->i_last_byte = ReadDouble( p_ifo, p_buf, &p_tmp );
i_max = ( i_start + p_vobu_map->i_last_byte + 1 - p_ifo->i_pos )
/ sizeof(u32);
p_vobu_map->pi_vobu_start_sector = malloc( i_max * sizeof(u32) );
......
......@@ -2,7 +2,7 @@
* dvd_ifo.h: Structures for ifo parsing
*****************************************************************************
* Copyright (C) 1999-2001 VideoLAN
* $Id: dvd_ifo.h,v 1.18 2002/03/08 22:58:12 stef Exp $
* $Id: dvd_ifo.h,v 1.19 2002/05/20 22:45:03 sam Exp $
*
* Author: Stphane Borel <stef@via.ecp.fr>
*
......@@ -142,10 +142,10 @@ typedef struct cell_play_s
u8 i_still_time; // 1 byte; in seconds; ff=inf
u8 i_command_nb; // 1 byte; 0 = no com
u32 i_play_time; // 4 bytes
u32 i_start_sector; // 4 bytes
u32 i_first_sector; // 4 bytes
u32 i_first_ilvu_vobu_esector; // 4 bytes; ???
u32 i_last_vobu_start_sector; // 4 bytes
u32 i_end_sector; // 4 bytes
u32 i_last_sector; // 4 bytes
} cell_play_t;
/* Cell Position Information Table
......@@ -220,7 +220,7 @@ typedef struct unit_inf_s
{
u16 i_title_nb; // 2 bytes
// char[2] ???
u32 i_end_byte; // 4 bytes
u32 i_last_byte; // 4 bytes
unit_title_t * p_title; // i_srp_nb * 8 bytes
} unit_inf_t;
......@@ -230,7 +230,7 @@ typedef struct title_unit_s
{
u16 i_unit_nb; // 2 bytes; ???
// char[2] ???
u32 i_end_byte; // 4 bytes
u32 i_last_byte; // 4 bytes
unit_t* p_unit; // i_lu_nb * 8 bytes
unit_inf_t* p_unit_inf; // i_lu_nb * 8 bytes
} title_unit_t;
......@@ -243,15 +243,15 @@ typedef struct cell_map_s
u16 i_vob_id; // 2 bytes
u8 i_cell_id; // 1 byte
// char ???
u32 i_start_sector; // 4 bytes
u32 i_end_sector; // 4 bytes
u32 i_first_sector; // 4 bytes
u32 i_last_sector; // 4 bytes
} cell_map_t;
typedef struct cell_inf_s
{
u16 i_vob_nb; // 2 bytes
// char[2] ???
u32 i_end_byte; // 4 bytes
u32 i_last_byte; // 4 bytes
u16 i_cell_nb; // not in ifo; computed
// with e_byte
cell_map_t* p_cell_map;
......@@ -263,7 +263,7 @@ typedef struct cell_inf_s
*/
typedef struct vobu_map_s
{
u32 i_end_byte; // 4 bytes
u32 i_last_byte; // 4 bytes
u32* pi_vobu_start_sector; // (nb of vobu) * 4 bytes
} vobu_map_t;
......@@ -336,7 +336,7 @@ typedef struct title_inf_s
{
u16 i_title_nb; // 2 bytes
// char[2] ???
u32 i_end_byte; // 4 bytes
u32 i_last_byte; // 4 bytes
title_attr_t * p_attr; // i_ttu_nb * 12 bytes
} title_inf_t;
......@@ -362,7 +362,7 @@ typedef struct parental_inf_s
{
u16 i_country_nb; // 2 bytes
u16 i_vts_nb; // 2 bytes
u32 i_end_byte; // 4 bytes
u32 i_last_byte; // 4 bytes
parental_desc_t* p_parental_desc; // i_country_nb * 8 bytes
parental_mask_t* p_parental_mask; // i_country_nb * sizeof(vmg_ptl_mask_t)
} parental_inf_t;
......@@ -375,7 +375,7 @@ typedef struct parental_inf_s
* - start at pi_atrt_sbyte */
typedef struct vts_attr_s
{
u32 i_end_byte; // 4 bytes
u32 i_last_byte; // 4 bytes
u32 i_cat_app_type; // 4 bytes
ifo_video_t vts_menu_video_attr; // 2 bytes
// char ???
......@@ -400,7 +400,7 @@ typedef struct vts_inf_s
{
u16 i_vts_nb; // 2 bytes
// char[2] ???
u32 i_end_byte; // 4 bytes
u32 i_last_byte; // 4 bytes
u32* pi_vts_attr_start_byte; // i_vts_nb * 4 bytes
vts_attr_t* p_vts_attr;
} vts_inf_t;
......@@ -430,9 +430,9 @@ typedef struct vmg_s
typedef struct vts_manager_s
{
char psz_id[13]; // 12 bytes (DVDVIDEO-VTS)
u32 i_end_sector; // 4 bytes
u32 i_last_sector; // 4 bytes
// char[12] ???
u32 i_inf_end_sector; // 4 bytes
u32 i_inf_last_sector; // 4 bytes
// char ???
u8 i_spec_ver; // 1 byte
u32 i_cat; // 4 bytes
......@@ -486,7 +486,7 @@ typedef struct vts_title_s
{
u16 i_title_nb; // 2 bytes
// char[2] ???
u32 i_end_byte; // 4 bytes
u32 i_last_byte; // 4 bytes
u32* pi_start_byte;
title_start_t * p_title_start; // i_ttu_nb * 4 bytes
} vts_title_t;
......@@ -510,7 +510,7 @@ typedef struct time_inf_s
{
u16 i_nb; // 2 bytes
// char[2] ???
u32 i_end_byte; // 4 bytes
u32 i_last_byte; // 4 bytes
u32* pi_start_byte; // i_tmap_nb * 4 bytes
time_map_t* p_time_map;
} time_inf_t;
......
/* dvd_seek.c: functions to navigate through DVD.
*****************************************************************************
* Copyright (C) 1998-2001 VideoLAN
* $Id: dvd_seek.c,v 1.6 2002/05/16 16:51:50 gbazin Exp $
* $Id: dvd_seek.c,v 1.7 2002/05/20 22:45:03 sam Exp $
*
* Author: Stphane Borel <stef@via.ecp.fr>
*
......@@ -71,7 +71,7 @@ int CellPrg2Map( thread_dvd_data_t * p_dvd )
{
int i_cell;
i_cell = p_dvd->i_map_cell;
i_cell = 0;
if( i_cell >= cell.i_cell_nb )
{
......@@ -125,23 +125,23 @@ int CellAngleOffset( thread_dvd_data_t * p_dvd, int i_prg_cell )
return i_cell_off;
}
int CellStartSector( thread_dvd_data_t * p_dvd )
int CellFirstSector( thread_dvd_data_t * p_dvd )
{
return __MAX( cell.p_cell_map[p_dvd->i_map_cell].i_start_sector,
title.p_cell_play[p_dvd->i_prg_cell].i_start_sector );
return __MAX( cell.p_cell_map[p_dvd->i_map_cell].i_first_sector,
title.p_cell_play[p_dvd->i_prg_cell].i_first_sector );
}
int CellEndSector( thread_dvd_data_t * p_dvd )
int CellLastSector( thread_dvd_data_t * p_dvd )
{
return __MIN( cell.p_cell_map[p_dvd->i_map_cell].i_end_sector,
title.p_cell_play[p_dvd->i_prg_cell].i_end_sector );
return __MIN( cell.p_cell_map[p_dvd->i_map_cell].i_last_sector,
title.p_cell_play[p_dvd->i_prg_cell].i_last_sector );
}
int NextCellPrg( thread_dvd_data_t * p_dvd )
{
int i_cell = p_dvd->i_prg_cell;
if( p_dvd->i_vts_lb > title.p_cell_play[i_cell].i_end_sector )
if( p_dvd->i_vts_lb > title.p_cell_play[i_cell].i_last_sector )
{
i_cell ++;
i_cell += CellAngleOffset( p_dvd, i_cell );
......@@ -159,7 +159,7 @@ int Lb2CellPrg( thread_dvd_data_t * p_dvd )
{
int i_cell = 0;
while( p_dvd->i_vts_lb > title.p_cell_play[i_cell].i_end_sector )
while( p_dvd->i_vts_lb > title.p_cell_play[i_cell].i_last_sector )
{
i_cell ++;
i_cell += CellAngleOffset( p_dvd, i_cell );
......@@ -177,7 +177,7 @@ int Lb2CellMap( thread_dvd_data_t * p_dvd )
{
int i_cell = 0;
while( p_dvd->i_vts_lb > cell.p_cell_map[i_cell].i_end_sector )
while( p_dvd->i_vts_lb > cell.p_cell_map[i_cell].i_last_sector )
{
i_cell ++;
......@@ -192,7 +192,7 @@ int Lb2CellMap( thread_dvd_data_t * p_dvd )
int LbMaxOnce( thread_dvd_data_t * p_dvd )
{
int i_block_once = p_dvd->i_end_lb - p_dvd->i_vts_lb + 1;
int i_block_once = p_dvd->i_last_lb - p_dvd->i_vts_lb + 1;
/* Get the position of the next cell if we're at cell end */
if( i_block_once <= 0 )
......@@ -211,8 +211,8 @@ int LbMaxOnce( thread_dvd_data_t * p_dvd )
return 0;
}
p_dvd->i_vts_lb = CellStartSector( p_dvd );
p_dvd->i_end_lb = CellEndSector( p_dvd );
p_dvd->i_vts_lb = CellFirstSector( p_dvd );
p_dvd->i_last_lb = CellLastSector( p_dvd );
if( ( p_dvd->i_chapter = NextChapter( p_dvd ) ) < 0)
{
......@@ -229,7 +229,7 @@ int LbMaxOnce( thread_dvd_data_t * p_dvd )
return 0;
}
i_block_once = p_dvd->i_end_lb - p_dvd->i_vts_lb + 1;
i_block_once = p_dvd->i_last_lb - p_dvd->i_vts_lb + 1;
}
return i_block_once;
......@@ -275,6 +275,7 @@ int NextChapter( thread_dvd_data_t * p_dvd )
return -1;
}
p_dvd->b_new_chapter = 1;
return p_dvd->i_chapter;
}
......@@ -300,8 +301,8 @@ int DVDSetChapter( thread_dvd_data_t * p_dvd, int i_chapter )
p_dvd->i_map_cell = 0;
}
p_dvd->i_map_cell = CellPrg2Map( p_dvd );
p_dvd->i_vts_lb = CellStartSector( p_dvd );
p_dvd->i_end_lb = CellEndSector( p_dvd );
p_dvd->i_vts_lb = CellFirstSector( p_dvd );
p_dvd->i_last_lb = CellLastSector( p_dvd );
/* Position the fd pointer on the right address */
if( dvdcss_seek( p_dvd->dvdhandle,
......
/* dvd_seek.h: DVD access plugin.
*****************************************************************************
* Copyright (C) 1998-2001 VideoLAN
* $Id: dvd_seek.h,v 1.3 2002/03/09 16:48:33 stef Exp $
* $Id: dvd_seek.h,v 1.4 2002/05/20 22:45:03 sam Exp $
*
* Author: Stphane Borel <stef@via.ecp.fr>
*
......@@ -23,8 +23,8 @@
int CellIsInterleaved( thread_dvd_data_t * );
int CellAngleOffset ( thread_dvd_data_t *, int );
int CellPrg2Map ( thread_dvd_data_t * );
int CellStartSector ( thread_dvd_data_t * );
int CellEndSector ( thread_dvd_data_t * );
int CellFirstSector ( thread_dvd_data_t * );
int CellLastSector ( thread_dvd_data_t * );
int NextCellPrg ( thread_dvd_data_t * );
int Lb2CellPrg ( thread_dvd_data_t * );
......
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