* -dvd_udf to find files
*****************************************************************************
* Copyright (C) 1998-2001 VideoLAN
- * $Id: input_dvd.c,v 1.7 2001/02/12 07:52:40 sam Exp $
+ * $Id: input_dvd.c,v 1.16 2001/02/20 07:49:12 sam Exp $
*
* Author: Stéphane Borel <stef@via.ecp.fr>
*
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
*****************************************************************************/
+#define MODULE_NAME dvd
+#include "modules_inner.h"
+
/*****************************************************************************
* Preamble
*****************************************************************************/
#include "modules.h"
+/*****************************************************************************
+ * Local tables
+ *****************************************************************************/
+static struct
+{
+ char p_code[3];
+ char p_lang_long[20];
+} lang_tbl[] =
+ {
+
+ /* The ISO 639 language codes.
+ * Language names with * prefix are not spelled in their own language
+ */
+ {" ", "Not Specified"},
+ {"aa", "*Afar"},
+ {"ab", "*Abkhazian"},
+ {"af", "*Afrikaans"},
+ {"am", "*Amharic"},
+ {"ar", "*Arabic"},
+ {"as", "*Assamese"},
+ {"ay", "*Aymara"},
+ {"az", "*Azerbaijani"},
+ {"ba", "*Bashkir"},
+ {"be", "*Byelorussian"},
+ {"bg", "*Bulgarian"},
+ {"bh", "*Bihari"},
+ {"bi", "*Bislama"},
+ {"bn", "*Bengali; Bangla"},
+ {"bo", "*Tibetan"},
+ {"br", "*Breton"},
+ {"ca", "*Catalan"},
+ {"co", "*Corsican"},
+ {"cs", "*Czech(Ceske)"},
+ {"cy", "*Welsh"},
+ {"da", "Dansk"},
+ {"de", "Deutsch"},
+ {"dz", "*Bhutani"},
+ {"el", "*Greek"},
+ {"en", "English"},
+ {"eo", "*Esperanto"},
+ {"es", "Espanol"},
+ {"et", "*Estonian"},
+ {"eu", "*Basque"},
+ {"fa", "*Persian"},
+ {"fi", "Suomi"},
+ {"fj", "*Fiji"},
+ {"fo", "*Faroese"},
+ {"fr", "Francais"},
+ {"fy", "*Frisian"},
+ {"ga", "*Irish"},
+ {"gd", "*Scots Gaelic"},
+ {"gl", "*Galician"},
+ {"gn", "*Guarani"},
+ {"gu", "*Gujarati"},
+ {"ha", "*Hausa"},
+ {"he", "*Hebrew"}, // formerly iw
+ {"hi", "*Hindi"},
+ {"hr", "Hrvatski"}, // Croatian
+ {"hu", "Magyar"},
+ {"hy", "*Armenian"},
+ {"ia", "*Interlingua"},
+ {"id", "*Indonesian"}, // formerly in
+ {"ie", "*Interlingue"},
+ {"ik", "*Inupiak"},
+ {"in", "*Indonesian"}, // replaced by id
+ {"is", "Islenska"},
+ {"it", "Italiano"},
+ {"iu", "*Inuktitut"},
+ {"iw", "*Hebrew"}, // replaced by he
+ {"ja", "*Japanese"},
+ {"ji", "*Yiddish"}, // replaced by yi
+ {"jw", "*Javanese"},
+ {"ka", "*Georgian"},
+ {"kk", "*Kazakh"},
+ {"kl", "*Greenlandic"},
+ {"km", "*Cambodian"},
+ {"kn", "*Kannada"},
+ {"ko", "*Korean"},
+ {"ks", "*Kashmiri"},
+ {"ku", "*Kurdish"},
+ {"ky", "*Kirghiz"},
+ {"la", "*Latin"},
+ {"ln", "*Lingala"},
+ {"lo", "*Laothian"},
+ {"lt", "*Lithuanian"},
+ {"lv", "*Latvian, Lettish"},
+ {"mg", "*Malagasy"},
+ {"mi", "*Maori"},
+ {"mk", "*Macedonian"},
+ {"ml", "*Malayalam"},
+ {"mn", "*Mongolian"},
+ {"mo", "*Moldavian"},
+ {"mr", "*Marathi"},
+ {"ms", "*Malay"},
+ {"mt", "*Maltese"},
+ {"my", "*Burmese"},
+ {"na", "*Nauru"},
+ {"ne", "*Nepali"},
+ {"nl", "Nederlands"},
+ {"no", "Norsk"},
+ {"oc", "*Occitan"},
+ {"om", "*(Afan) Oromo"},
+ {"or", "*Oriya"},
+ {"pa", "*Punjabi"},
+ {"pl", "*Polish"},
+ {"ps", "*Pashto, Pushto"},
+ {"pt", "Portugues"},
+ {"qu", "*Quechua"},
+ {"rm", "*Rhaeto-Romance"},
+ {"rn", "*Kirundi"},
+ {"ro", "*Romanian"},
+ {"ru", "*Russian"},
+ {"rw", "*Kinyarwanda"},
+ {"sa", "*Sanskrit"},
+ {"sd", "*Sindhi"},
+ {"sg", "*Sangho"},
+ {"sh", "*Serbo-Croatian"},
+ {"si", "*Sinhalese"},
+ {"sk", "*Slovak"},
+ {"sl", "*Slovenian"},
+ {"sm", "*Samoan"},
+ {"sn", "*Shona"},
+ {"so", "*Somali"},
+ {"sq", "*Albanian"},
+ {"sr", "*Serbian"},
+ {"ss", "*Siswati"},
+ {"st", "*Sesotho"},
+ {"su", "*Sundanese"},
+ {"sv", "Svenska"},
+ {"sw", "*Swahili"},
+ {"ta", "*Tamil"},
+ {"te", "*Telugu"},
+ {"tg", "*Tajik"},
+ {"th", "*Thai"},
+ {"ti", "*Tigrinya"},
+ {"tk", "*Turkmen"},
+ {"tl", "*Tagalog"},
+ {"tn", "*Setswana"},
+ {"to", "*Tonga"},
+ {"tr", "*Turkish"},
+ {"ts", "*Tsonga"},
+ {"tt", "*Tatar"},
+ {"tw", "*Twi"},
+ {"ug", "*Uighur"},
+ {"uk", "*Ukrainian"},
+ {"ur", "*Urdu"},
+ {"uz", "*Uzbek"},
+ {"vi", "*Vietnamese"},
+ {"vo", "*Volapuk"},
+ {"wo", "*Wolof"},
+ {"xh", "*Xhosa"},
+ {"yi", "*Yiddish"}, // formerly ji
+ {"yo", "*Yoruba"},
+ {"za", "*Zhuang"},
+ {"zh", "*Chinese"},
+ {"zu", "*Zulu"},
+ {"\0", ""}
+ };
+
/*****************************************************************************
* Local prototypes
*****************************************************************************/
static int DVDCheckCSS ( struct input_thread_s * );
static int DVDRead ( struct input_thread_s *, data_packet_t ** );
static void DVDInit ( struct input_thread_s * );
-static void DVDOpen ( struct input_thread_s * );
-static void DVDClose ( 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 *, int, int, int, int );
static int DVDRewind ( struct input_thread_s * );
/*****************************************************************************
* Functions exported as capabilities. They are declared as static so that
* we don't pollute the namespace too much.
*****************************************************************************/
-void input_getfunctions( function_list_t * p_function_list )
+void _M( input_getfunctions )( function_list_t * p_function_list )
{
#define input p_function_list->functions.input
p_function_list->pf_probe = DVDProbe;
input.pf_init = DVDInit;
- input.pf_open = DVDOpen;
- input.pf_close = DVDClose;
+ input.pf_open = input_FileOpen;
+ input.pf_close = input_FileClose;
input.pf_end = DVDEnd;
input.pf_read = DVDRead;
+ input.pf_set_area = DVDSetArea;
input.pf_demux = input_DemuxPS;
input.pf_new_packet = input_NetlistNewPacket;
input.pf_new_pes = input_NetlistNewPES;
#undef input
}
+/*
+ * Local tools to decode some data in ifo
+ */
+
+/*****************************************************************************
+ * Language: gives the long language name from the two-letters ISO-639 code
+ *****************************************************************************/
+static char * Language( char * p_code )
+{
+ int i = 0;
+
+ while( !memcmp( lang_tbl[i].p_code, p_code, 2 ) && lang_tbl[i].p_lang_long )
+ {
+ i++;
+ }
+
+ return lang_tbl[i].p_lang_long;
+}
+
/*
* Data reading functions
*/
*****************************************************************************/
static int DVDProbe( probedata_t *p_data )
{
+ input_thread_t * p_input = (input_thread_t *)p_data;
+
+ char * psz_name = p_input->p_source;
+ int i_handle;
+ int i_score = 5;
+
if( TestMethod( INPUT_METHOD_VAR, "dvd" ) )
{
return( 999 );
}
- return 5;
+ if( ( strlen(psz_name) > 4 ) && !strncasecmp( psz_name, "dvd:", 4 ) )
+ {
+ /* If the user specified "dvd:" then it's probably a DVD */
+ i_score = 100;
+ psz_name += 4;
+ }
+
+ i_handle = open( psz_name, 0 );
+ if( i_handle == -1 )
+ {
+ return( 0 );
+ }
+ close( i_handle );
+
+ return( i_score );
}
/*****************************************************************************
*****************************************************************************/
static int DVDCheckCSS( input_thread_t * p_input )
{
-#if defined( HAVE_SYS_DVDIO_H ) || defined( LINUX_DVD )
+#if defined( HAVE_SYS_DVDIO_H ) || defined( LINUX_DVD ) || defined( SYS_BEOS )
return CSSTest( p_input->i_handle );
#else
/* DVD ioctls unavailable.
}
/*****************************************************************************
- * DVDInit: initializes DVD structures
+ * DVDSetArea: initialize input data for title x, chapter y.
+ * It should be called for each user navigation request, and to change
+ * audio or sub-picture streams.
+ * ---
+ * Take care that i_title and i_chapter start from 0.
*****************************************************************************/
-static void DVDInit( input_thread_t * p_input )
+static int DVDSetArea( input_thread_t * p_input,
+ int i_title, int i_chapter,
+ int i_audio, int i_spu )
{
thread_dvd_data_t * p_method;
+ es_descriptor_t * p_es;
off_t i_start;
+ off_t i_size;
+ pgc_t * p_pgc;
+ int i_start_cell;
+ int i_end_cell;
+ int i_index;
+ int i_cell;
+ int i_nb;
+ int i_id;
+ int i;
+
+ p_method = (thread_dvd_data_t*)p_input->p_plugin_data;
+
+ /* Ifo structures reading */
+ p_method->ifo.i_title = i_title;
+ IfoReadVTS( &(p_method->ifo) );
+ intf_WarnMsg( 2, "Ifo: VTS initialized" );
+
+#if defined( HAVE_SYS_DVDIO_H ) || defined( LINUX_DVD ) || defined( SYS_BEOS )
+ if( p_method->b_encrypted )
+ {
+ p_method->css.i_title = i_title;
+ p_method->css.i_title_pos =
+ p_method->ifo.vts.i_pos +
+ p_method->ifo.vts.mat.i_tt_vobs_ssector * DVD_LB_SIZE;
+ CSSGetKey( &(p_method->css) );
+ intf_WarnMsg( 2, "CSS: VTS key initialized" );
+ }
+#endif
- if( (p_method = malloc( sizeof(thread_dvd_data_t) )) == NULL )
+ /* Set selected title start and size */
+ p_pgc = &p_method->ifo.vts.pgci_ti.p_srp[0].pgc;
+
+ /* Find cell index in Program chain */
+ i_index = p_pgc->prg_map.pi_entry_cell[i_chapter] - 1;
+
+ /* Search for cell_index in cell adress_table */
+ i_cell = 0;
+ while( p_pgc->p_cell_pos_inf[i_index].i_vob_id >
+ p_method->ifo.vts.c_adt.p_cell_inf[i_cell].i_vob_id )
{
- intf_ErrMsg( "Out of memory" );
- p_input->b_error = 1;
- return;
+ i_cell++;
+ }
+ while( p_pgc->p_cell_pos_inf[i_index].i_cell_id >
+ p_method->ifo.vts.c_adt.p_cell_inf[i_cell].i_cell_id )
+ {
+ i_cell++;
}
+ i_start_cell = i_cell;
+ i_end_cell = i_start_cell + p_pgc->i_cell_nb - 1;
- p_input->p_plugin_data = (void *)p_method;
- p_input->p_method_data = NULL;
+ intf_WarnMsg( 3, "DVD: Start cell: %d End Cell: %d",
+ i_start_cell, i_end_cell );
- p_method->i_fd = p_input->i_handle;
- /* FIXME: read several packets once */
- p_method->i_read_once = 1;
- p_method->i_title = 0;
+ p_method->i_start_cell = i_start_cell;
+ p_method->i_end_cell = i_end_cell;
+ /* start is : beginning of vts + offset to vobs + offset to vob x */
+ i_start = p_method->ifo.vts.i_pos + DVD_LB_SIZE *
+ ( p_method->ifo.vts.mat.i_tt_vobs_ssector +
+ p_method->ifo.vts.c_adt.p_cell_inf[i_start_cell].i_ssector );
- lseek( p_input->i_handle, 0, SEEK_SET );
+ i_start = lseek( p_input->i_handle, i_start, SEEK_SET );
+ intf_WarnMsg( 2, "DVD: VOBstart at: %lld", i_start );
- /* Reading structures initialisation */
- input_NetlistInit( p_input, 4096, 4096, DVD_LB_SIZE,
- p_method->i_read_once );
+ i_size = (off_t)
+ ( p_method->ifo.vts.c_adt.p_cell_inf[i_end_cell].i_esector -
+ p_method->ifo.vts.c_adt.p_cell_inf[i_start_cell].i_ssector + 1 )
+ *DVD_LB_SIZE;
+ intf_WarnMsg( 2, "DVD: stream size: %lld", i_size );
- /* Ifo initialisation */
- p_method->ifo = IfoInit( p_input->i_handle );
- IfoRead( &(p_method->ifo) );
- intf_Msg( "Ifo: Initialized" );
+#if 0
+ p_es = NULL;
- /* CSS authentication and keys */
- if( ( p_method->b_encrypted = DVDCheckCSS( p_input ) ) )
- {
-#if defined( HAVE_SYS_DVDIO_H ) || defined( LINUX_DVD )
- int i;
+ vlc_mutex_lock( &p_input->stream.stream_lock );
- p_method->css = CSSInit( p_input->i_handle );
- p_method->css.i_title_nb = p_method->ifo.vmg.mat.i_tts_nb;
- if( (p_method->css.p_title_key =
- malloc( p_method->css.i_title_nb *sizeof(title_key_t) ) ) == NULL )
+ /* ES 0 -> video MPEG2 */
+ intf_WarnMsg( 1, "DVD: Video MPEG2 stream" );
+ p_es = input_AddES( p_input, p_input->stream.pp_programs[0], 0xe0, 0 );
+ p_es->i_stream_id = 0xe0;
+ p_es->i_type = MPEG2_VIDEO_ES;
+ input_SelectES( p_input, p_es );
+
+ /* Audio ES, in the order they appear in .ifo */
+ i_nb = p_method->ifo.vts.mat.i_audio_nb;
+ intf_WarnMsg( 1, "DVD: Audio streams %d", i_nb );
+ for( i = 0 ; i < i_nb ; i++ )
+ {
+ i_id = ( ( 0x80 + i ) << 8 ) | 0xbd;
+ p_es = input_AddES( p_input,
+ p_input->stream.pp_programs[0], i_id, 0 );
+ p_es->i_stream_id = 0xbd;
+ p_es->i_type = AC3_AUDIO_ES;
+ p_es->b_audio = 1;
+// p_es->psz_desc = p_method->ifo.vts.mat.pi_audio_attr[i];
+ if( i == 0 )
{
- intf_ErrMsg( "Out of memory" );
- p_input->b_error = 1;
- return;
+ input_SelectES( p_input, p_es );
}
- for( i=0 ; i<p_method->css.i_title_nb ; i++ )
+ }
+
+ /* Sub Picture ES */
+ i_nb = p_method->ifo.vts.mat.i_subpic_nb;
+ intf_WarnMsg( 1, "DVD: Subpic streams %d", i_nb );
+ for( i = 0 ; i < i_nb ; i++ )
+ {
+ i_id = ( ( 0x20 + i ) << 8 ) | 0xbd;
+ p_es = input_AddES( p_input,
+ p_input->stream.pp_programs[0], i_id, 0 );
+ p_es->i_stream_id = 0xbd;
+ p_es->i_type = DVD_SPU_ES;
+// p_es->psz_desc = p_method->ifo.vts.mat.pi_subpic_attr[i];
+ if( i == 0 )
{
- p_method->css.p_title_key[i].i =
- p_method->ifo.p_vts[i].i_pos +
- p_method->ifo.p_vts[i].mat.i_tt_vobs_ssector *DVD_LB_SIZE;
+ input_SelectES( p_input, p_es );
}
- CSSGetKeys( &(p_method->css) );
- intf_Msg( "CSS: Initialized" );
-#else
- intf_ErrMsg( "Unscrambling not supported" );
-#endif
+
}
- /* FIXME: Kludge beginning of vts_01_1.vob */
- i_start = p_method->ifo.p_vts[0].i_pos +
- p_method->ifo.p_vts[0].mat.i_tt_vobs_ssector *DVD_LB_SIZE;
+ /* area definition */
+ p_input->stream.pp_areas[0]->i_start = i_start;
+ p_input->stream.pp_areas[0]->i_size = i_size;
- i_start = lseek( p_input->i_handle, i_start, SEEK_SET );
- intf_Msg( "VOB start at : %lld", (long long)i_start );
+ /* No PSM to read in DVD mode */
+ p_input->stream.pp_programs[0]->b_is_ok = 1;
- /* Initialize ES structures */
- input_InitStream( p_input, sizeof( stream_ps_data_t ) );
- input_AddProgram( p_input, 0, sizeof( stream_ps_data_t ) );
+ vlc_mutex_unlock( &p_input->stream.stream_lock );
+
+#else
if( p_input->stream.b_seekable )
{
}
/* File too big. */
- if( p_input->stream.i_tell > INPUT_PREPARSE_LENGTH )
+ if( p_input->stream.pp_areas[0]->i_tell > INPUT_PREPARSE_LENGTH )
{
break;
}
}
lseek( p_input->i_handle, i_start, SEEK_SET );
vlc_mutex_lock( &p_input->stream.stream_lock );
- p_input->stream.i_tell = 0;
+
+ /* i_tell is an indicator from the beginning of the stream,
+ * not of the DVD */
+ p_input->stream.pp_areas[0]->i_tell = 0;
+
if( p_demux_data->b_has_PSM )
{
/* (The PSM decoder will care about spawning the decoders) */
#ifdef STATS
input_DumpStream( p_input );
#endif
+
+ /* FIXME : ugly kludge */
+ p_input->stream.pp_areas[0]->i_size = i_size;
+
vlc_mutex_unlock( &p_input->stream.stream_lock );
}
else
/* The programs will be added when we read them. */
vlc_mutex_lock( &p_input->stream.stream_lock );
p_input->stream.pp_programs[0]->b_is_ok = 0;
+
+ /* FIXME : ugly kludge */
+ p_input->stream.pp_areas[0]->i_size = i_size;
+
vlc_mutex_unlock( &p_input->stream.stream_lock );
}
+#endif
+ return 0;
}
/*****************************************************************************
- * DVDOpen : open the dvd device
+ * DVDInit: initializes DVD structures
*****************************************************************************/
-static void DVDOpen( input_thread_t * p_input )
+static void DVDInit( input_thread_t * p_input )
{
- intf_Msg( "input: opening DVD %s", p_input->p_source );
+ thread_dvd_data_t * p_method;
+ int i;
- p_input->i_handle = open( p_input->p_source, O_RDONLY | O_NONBLOCK );
+ if( (p_method = malloc( sizeof(thread_dvd_data_t) )) == NULL )
+ {
+ intf_ErrMsg( "Out of memory" );
+ p_input->b_error = 1;
+ return;
+ }
+
+ p_input->p_plugin_data = (void *)p_method;
+ p_input->p_method_data = NULL;
+
+ p_method->i_fd = p_input->i_handle;
+ /* FIXME: read several packets once */
+ p_method->i_read_once = 1;
+ p_method->b_encrypted = DVDCheckCSS( p_input );
+
+ lseek( p_input->i_handle, 0, SEEK_SET );
- if( p_input->i_handle == -1 )
+ /* Reading structures initialisation */
+ input_NetlistInit( p_input, 4096, 4096, DVD_LB_SIZE,
+ p_method->i_read_once );
+ intf_WarnMsg( 2, "DVD: Netlist initialized" );
+
+ /* Ifo initialisation */
+ p_method->ifo = IfoInit( p_input->i_handle );
+ intf_WarnMsg( 2, "Ifo: VMG initialized" );
+
+ /* CSS initialisation */
+ if( p_method->b_encrypted )
{
- intf_ErrMsg( "input error: cannot open device (%s)", strerror(errno) );
+
+#if defined( HAVE_SYS_DVDIO_H ) || defined( LINUX_DVD ) || defined( SYS_BEOS )
+ p_method->css = CSSInit( p_input->i_handle );
+
+ if( ( p_input->b_error = p_method->css.b_error ) )
+ {
+ intf_ErrMsg( "CSS fatal error" );
+ return;
+ }
+ intf_WarnMsg( 2, "CSS: initialized" );
+#else
+ intf_ErrMsg( "Unscrambling not supported" );
p_input->b_error = 1;
return;
+#endif
}
+ /* Initialize ES structures */
+ input_InitStream( p_input, sizeof( stream_ps_data_t ) );
+ input_AddProgram( p_input, 0, sizeof( stream_ps_data_t ) );
+
+ /* Set stream and area data */
vlc_mutex_lock( &p_input->stream.stream_lock );
- p_input->stream.b_pace_control = 1;
- p_input->stream.b_seekable = 1;
- p_input->stream.i_size = 0;
- p_input->stream.i_tell = 0;
+ /* FIXME: We consider here that one title is one title set
+ * it is not true !!! */
+
+#define area p_input->stream.pp_areas
+ /* We start from 1 here since area 0 is reserved for video_ts.vob */
+ for( i = 1 ; i < p_method->ifo.vmg.mat.i_tts_nb ; i++ )
+ {
+ input_AddArea( p_input );
+
+ /* Should not be so simple eventually :
+ * are title Program Chains, or still something else ? */
+ 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 chapter */
+ area[i]->i_part_nb = 0;
+ area[i]->i_part = 1;
+ /* Offset to vts_i_0.ifo */
+ area[i]->i_plugin_data = p_method->ifo.i_off +
+ ( p_method->ifo.vmg.ptt_srpt.p_tts[i-1].i_ssector * DVD_LB_SIZE );
+ }
+#undef area
vlc_mutex_unlock( &p_input->stream.stream_lock );
-}
-/*****************************************************************************
- * DVDClose : close a file descriptor
- *****************************************************************************/
-static void DVDClose( input_thread_t * p_input )
-{
- close( p_input->i_handle );
+ /* By default, set all parameters to 0 */
+ /* FIXME: wrong kludge to get first title number */
+ DVDSetArea( p_input, p_method->ifo.vmg.ptt_srpt.p_tts[0].i_tts_nb - 1,
+ 0, 0, 0 );
return;
}
p_netlist = ( netlist_t * ) p_input->p_method_data;
/* Get an iovec pointer */
- if( ( p_vec = input_NetlistGetiovec( p_netlist, &p_data ) ) == NULL )
+ if( ( p_vec = input_NetlistGetiovec( p_netlist ) ) == NULL )
{
intf_ErrMsg( "DVD: read error" );
return -1;
/* Reads from DVD */
readv( p_input->i_handle, p_vec, p_method->i_read_once );
-#if defined( HAVE_SYS_DVDIO_H ) || defined( LINUX_DVD )
+#if defined( HAVE_SYS_DVDIO_H ) || defined( LINUX_DVD ) || defined( SYS_BEOS )
if( p_method->b_encrypted )
{
for( i=0 ; i<p_method->i_read_once ; i++ )
{
- CSSDescrambleSector(
- p_method->css.p_title_key[p_method->i_title].key,
- p_vec[i].iov_base );
+ CSSDescrambleSector( p_method->css.pi_title_key,
+ p_vec[i].iov_base );
((u8*)(p_vec[i].iov_base))[0x14] &= 0x8F;
}
}
#endif
/* Update netlist indexes */
- input_NetlistMviovec( p_netlist, p_method->i_read_once );
+ input_NetlistMviovec( p_netlist, p_method->i_read_once, &p_data );
i_packet = 0;
/* Read headers to compute payload length */
pp_packets[i_packet] = NULL;
vlc_mutex_lock( &p_input->stream.stream_lock );
- p_input->stream.i_tell += p_method->i_read_once *DVD_LB_SIZE;
+ p_input->stream.pp_areas[0]->i_tell += p_method->i_read_once *DVD_LB_SIZE;
vlc_mutex_unlock( &p_input->stream.stream_lock );
return( 0 );
*****************************************************************************/
static void DVDSeek( input_thread_t * p_input, off_t i_off )
{
+ thread_dvd_data_t * p_method;
+ off_t i_pos;
+
+ p_method = ( thread_dvd_data_t * )p_input->p_plugin_data;
+
+ /* We have to take care of offset of beginning of title */
+ i_pos = i_off + p_input->stream.pp_areas[0]->i_start;
+
+ /* With DVD, we have to be on a sector boundary */
+ i_pos = i_pos & (~0x7ff);
+
+ i_pos = lseek( p_input->i_handle, i_pos, SEEK_SET );
+
+ p_input->stream.pp_areas[0]->i_tell = i_pos - p_input->stream.pp_areas[0]->i_start;
+
return;
}