Commit 1cd850a8 authored by Stéphane Borel's avatar Stéphane Borel

. Now use of 64 bits offsets to parse the whole DVD. So we have all the

available information
. Fixed a bug in parsing of VTS attributes
. Fixed a bug in input.c that made input plugin initialize even though
no stream is reachable (thanks Sam)

I hope I'll be able to get the position of the movie soon.

Meuuh : the seek function of the plugin now take off_t as argument which
could be a problem later. Maybe it should take off64_t or time argument.
parent f56c4db1
This diff is collapsed.
......@@ -302,14 +302,15 @@ typedef struct vts_atrt_s
u64 pi_vtsm_audio_atrt[8]; // i_vtsm_audio_nb * 8 bytes
// char ???
u8 i_vtsm_subpic_nb; // 1 byte
u64 pi_vtsm_subpic_atrt[32]; // i_vtsm_subpic_nb * 6 bytes
u64 pi_vtsm_subpic_atrt[28]; // i_vtsm_subpic_nb * 6 bytes
// char[2] ???
u16 i_vtstt_video_atrt; // 2 bytes
// char ???
u8 i_vtstt_audio_nb; // 1 byte
u64 pi_vtstt_audio_atrt[8]; // i_vtstt_audio_nb * 8 bytes
// char ???
// char[17] ???
u8 i_vtstt_subpic_nb; // 1 byte
u64 pi_vtstt_subpic_atrt[32]; // i_vtstt_subpic_nb * 6 bytes
u64 pi_vtstt_subpic_atrt[28]; // i_vtstt_subpic_nb * 6 bytes
} vts_atrt_t;
/* Main struct for vts attributes
......@@ -445,7 +446,7 @@ typedef struct vts_s
/* Video Title Set Menu PGCI Unit Table */
pgci_ut_t pgci_ut;
/* Video Title Set Program Chain Info Table */
pgci_inf_t pgci_ti;
pgci_inf_t pgci_ti;
/* Video Title Set Time Map Table */
vts_tmap_ti_t tmap_ti;
/* VTSM Cell Adress Table Information */
......@@ -466,9 +467,9 @@ typedef struct ifo_s
/* File descriptor for the device */
int i_fd;
/* Offset to video_ts.ifo on the device */
u32 i_off;
off64_t i_off;
/* Position of stream pointer */
u32 i_pos;
off64_t i_pos;
/* Error Management */
boolean_t b_error;
/* Structure described in video_ts */
......@@ -478,7 +479,12 @@ typedef struct ifo_s
} ifo_t;
/*****************************************************************************
* Prototypes in ifo.c
* Prototypes in dvd_ifo.c
*****************************************************************************/
ifo_t IfoInit( int );
void IfoRead( ifo_t* );
/*****************************************************************************
* Prototypes in input_dvd.c
*****************************************************************************/
off64_t Seek64( int, off64_t, int);
......@@ -4,7 +4,7 @@
* decoders.
*****************************************************************************
* Copyright (C) 1998, 1999, 2000 VideoLAN
* $Id: input.c,v 1.69 2001/01/15 06:18:23 sam Exp $
* $Id: input.c,v 1.70 2001/01/16 04:41:20 stef Exp $
*
* Authors:
*
......@@ -278,7 +278,10 @@ static void InitThread( input_thread_t * p_input )
free( p_input->p_config );
p_input->p_plugin->pf_init( p_input );
if( !p_input->b_error )
{
p_input->p_plugin->pf_init( p_input );
}
*p_input->pi_status = THREAD_READY;
}
......
......@@ -2,6 +2,7 @@
* input_dvd.c: DVD reading
*****************************************************************************
* Copyright (C) 1998-2001 VideoLAN
* $Id: input_dvd.c,v 1.3 2001/01/16 04:41:20 stef Exp $
*
* Author: Stphane Borel <stef@via.ecp.fr>
*
......@@ -57,13 +58,14 @@
/*****************************************************************************
* Local prototypes
*****************************************************************************/
static int DVDProbe ( struct input_thread_s * );
static int DVDRead ( struct input_thread_s *,
static int DVDProbe ( struct input_thread_s * );
static int DVDRead ( struct input_thread_s *,
data_packet_t * p_packets[INPUT_READ_ONCE] );
static void DVDInit ( struct input_thread_s * );
static void DVDEnd ( struct input_thread_s * );
static int DVDSeek ( struct input_thread_s *, off_t );
static int DVDRewind ( struct input_thread_s * );
static void DVDInit ( struct input_thread_s * );
static void DVDEnd ( struct input_thread_s * );
/* FIXME : DVDSeek should be on 64 bits ? Is it possible in input ? */
static int DVDSeek ( struct input_thread_s *, off_t );
static int DVDRewind ( struct input_thread_s * );
static struct data_packet_s * NewPacket ( void *, size_t );
static void DeletePacket( void *, struct data_packet_s * );
static void DeletePES ( void *, struct pes_packet_s * );
......@@ -88,7 +90,7 @@ static int DVDProbe( input_thread_t * p_input )
static void DVDInit( input_thread_t * p_input )
{
thread_dvd_data_t * p_method;
u32 i_start;
off64_t i_start;
if( (p_method = malloc( sizeof(thread_dvd_data_t) )) == NULL )
{
......@@ -98,8 +100,9 @@ static void DVDInit( input_thread_t * p_input )
}
p_input->p_plugin_data = (void *)p_method;
p_input->p_method_data = NULL;
lseek( p_input->i_handle, 0, SEEK_SET );
lseek64( p_input->i_handle, 0, SEEK_SET );
/* Ifo initialisation */
p_method->ifo = IfoInit( p_input->i_handle );
......@@ -107,8 +110,9 @@ static void DVDInit( input_thread_t * p_input )
i_start = p_method->ifo.p_vts[0].i_pos +
p_method->ifo.p_vts[0].mat.i_tt_vobs_ssector *DVD_LB_SIZE;
fprintf(stderr, "Begin at : %d\n", i_start );
lseek( p_input->i_handle, i_start, SEEK_SET );
i_start = lseek64( p_input->i_handle, i_start, SEEK_SET );
fprintf(stderr, "Begin at : %lld\n", (long long)i_start );
input_InitStream( p_input, sizeof( stream_ps_data_t ) );
input_AddProgram( p_input, 0, sizeof( stream_ps_data_t ) );
......@@ -156,7 +160,7 @@ static void DVDInit( input_thread_t * p_input )
break;
}
}
lseek( p_input->i_handle, i_start, SEEK_SET );
lseek64( p_input->i_handle, i_start, SEEK_SET );
vlc_mutex_lock( &p_input->stream.stream_lock );
p_input->stream.i_tell = 0;
if( p_demux_data->b_has_PSM )
......@@ -319,11 +323,9 @@ static int DVDRead( input_thread_t * p_input,
if( (i_nb = read( p_input->i_handle, &i_dummy, 1 )) != 0 )
{
i_startcode |= i_dummy;
fprintf(stderr, "tut :%d %d\n", i_dummy, i_nb );
}
else
{
fprintf(stderr, "poc\n" );
return( 1 );
}
}
......@@ -410,7 +412,9 @@ static int DVDRewind( input_thread_t * p_input )
}
/*****************************************************************************
* DVDSeek : Goes to a given position on the stream
* DVDSeek : Goes to a given position on the stream ; this one is used by the
* input and translate chronological position from input to logical postion
* on the device
*****************************************************************************/
static int DVDSeek( input_thread_t * p_input, off_t i_off )
{
......
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