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 ...@@ -302,14 +302,15 @@ typedef struct vts_atrt_s
u64 pi_vtsm_audio_atrt[8]; // i_vtsm_audio_nb * 8 bytes u64 pi_vtsm_audio_atrt[8]; // i_vtsm_audio_nb * 8 bytes
// char ??? // char ???
u8 i_vtsm_subpic_nb; // 1 byte 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 u16 i_vtstt_video_atrt; // 2 bytes
// char ??? // char ???
u8 i_vtstt_audio_nb; // 1 byte u8 i_vtstt_audio_nb; // 1 byte
u64 pi_vtstt_audio_atrt[8]; // i_vtstt_audio_nb * 8 bytes u64 pi_vtstt_audio_atrt[8]; // i_vtstt_audio_nb * 8 bytes
// char ??? // char[17] ???
u8 i_vtstt_subpic_nb; // 1 byte 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; } vts_atrt_t;
/* Main struct for vts attributes /* Main struct for vts attributes
...@@ -466,9 +467,9 @@ typedef struct ifo_s ...@@ -466,9 +467,9 @@ typedef struct ifo_s
/* File descriptor for the device */ /* File descriptor for the device */
int i_fd; int i_fd;
/* Offset to video_ts.ifo on the device */ /* Offset to video_ts.ifo on the device */
u32 i_off; off64_t i_off;
/* Position of stream pointer */ /* Position of stream pointer */
u32 i_pos; off64_t i_pos;
/* Error Management */ /* Error Management */
boolean_t b_error; boolean_t b_error;
/* Structure described in video_ts */ /* Structure described in video_ts */
...@@ -478,7 +479,12 @@ typedef struct ifo_s ...@@ -478,7 +479,12 @@ typedef struct ifo_s
} ifo_t; } ifo_t;
/***************************************************************************** /*****************************************************************************
* Prototypes in ifo.c * Prototypes in dvd_ifo.c
*****************************************************************************/ *****************************************************************************/
ifo_t IfoInit( int ); ifo_t IfoInit( int );
void IfoRead( ifo_t* ); void IfoRead( ifo_t* );
/*****************************************************************************
* Prototypes in input_dvd.c
*****************************************************************************/
off64_t Seek64( int, off64_t, int);
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
* decoders. * decoders.
***************************************************************************** *****************************************************************************
* Copyright (C) 1998, 1999, 2000 VideoLAN * 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: * Authors:
* *
...@@ -278,7 +278,10 @@ static void InitThread( input_thread_t * p_input ) ...@@ -278,7 +278,10 @@ static void InitThread( input_thread_t * p_input )
free( p_input->p_config ); free( p_input->p_config );
if( !p_input->b_error )
{
p_input->p_plugin->pf_init( p_input ); p_input->p_plugin->pf_init( p_input );
}
*p_input->pi_status = THREAD_READY; *p_input->pi_status = THREAD_READY;
} }
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
* input_dvd.c: DVD reading * input_dvd.c: DVD reading
***************************************************************************** *****************************************************************************
* Copyright (C) 1998-2001 VideoLAN * 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> * Author: Stphane Borel <stef@via.ecp.fr>
* *
...@@ -62,6 +63,7 @@ static int DVDRead ( struct input_thread_s *, ...@@ -62,6 +63,7 @@ static int DVDRead ( struct input_thread_s *,
data_packet_t * p_packets[INPUT_READ_ONCE] ); data_packet_t * p_packets[INPUT_READ_ONCE] );
static void DVDInit ( struct input_thread_s * ); static void DVDInit ( struct input_thread_s * );
static void DVDEnd ( 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 DVDSeek ( struct input_thread_s *, off_t );
static int DVDRewind ( struct input_thread_s * ); static int DVDRewind ( struct input_thread_s * );
static struct data_packet_s * NewPacket ( void *, size_t ); static struct data_packet_s * NewPacket ( void *, size_t );
...@@ -88,7 +90,7 @@ static int DVDProbe( input_thread_t * p_input ) ...@@ -88,7 +90,7 @@ static int DVDProbe( input_thread_t * p_input )
static void DVDInit( input_thread_t * p_input ) static void DVDInit( input_thread_t * p_input )
{ {
thread_dvd_data_t * p_method; thread_dvd_data_t * p_method;
u32 i_start; off64_t i_start;
if( (p_method = malloc( sizeof(thread_dvd_data_t) )) == NULL ) if( (p_method = malloc( sizeof(thread_dvd_data_t) )) == NULL )
{ {
...@@ -98,8 +100,9 @@ static void DVDInit( input_thread_t * p_input ) ...@@ -98,8 +100,9 @@ static void DVDInit( input_thread_t * p_input )
} }
p_input->p_plugin_data = (void *)p_method; 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 */ /* Ifo initialisation */
p_method->ifo = IfoInit( p_input->i_handle ); p_method->ifo = IfoInit( p_input->i_handle );
...@@ -107,8 +110,9 @@ static void DVDInit( input_thread_t * p_input ) ...@@ -107,8 +110,9 @@ static void DVDInit( input_thread_t * p_input )
i_start = p_method->ifo.p_vts[0].i_pos + i_start = p_method->ifo.p_vts[0].i_pos +
p_method->ifo.p_vts[0].mat.i_tt_vobs_ssector *DVD_LB_SIZE; 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_InitStream( p_input, sizeof( stream_ps_data_t ) );
input_AddProgram( p_input, 0, 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 ) ...@@ -156,7 +160,7 @@ static void DVDInit( input_thread_t * p_input )
break; 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 ); vlc_mutex_lock( &p_input->stream.stream_lock );
p_input->stream.i_tell = 0; p_input->stream.i_tell = 0;
if( p_demux_data->b_has_PSM ) if( p_demux_data->b_has_PSM )
...@@ -319,11 +323,9 @@ static int DVDRead( input_thread_t * p_input, ...@@ -319,11 +323,9 @@ static int DVDRead( input_thread_t * p_input,
if( (i_nb = read( p_input->i_handle, &i_dummy, 1 )) != 0 ) if( (i_nb = read( p_input->i_handle, &i_dummy, 1 )) != 0 )
{ {
i_startcode |= i_dummy; i_startcode |= i_dummy;
fprintf(stderr, "tut :%d %d\n", i_dummy, i_nb );
} }
else else
{ {
fprintf(stderr, "poc\n" );
return( 1 ); return( 1 );
} }
} }
...@@ -410,7 +412,9 @@ static int DVDRewind( input_thread_t * p_input ) ...@@ -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 ) 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