Commit 3838e880 authored by Sam Hocevar's avatar Sam Hocevar

* ./modules/access/dvdread/input.c: the dvdread plugin issues a warning

    instead of an error when it can't stat() the device (Closes: #77).
parent 77081ffb
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* dvdread.c : DvdRead input module for vlc * dvdread.c : DvdRead input module for vlc
***************************************************************************** *****************************************************************************
* Copyright (C) 2001 VideoLAN * Copyright (C) 2001 VideoLAN
* $Id: dvdread.c,v 1.2 2002/08/07 00:29:36 sam Exp $ * $Id: dvdread.c,v 1.3 2003/01/23 09:58:02 sam Exp $
* *
* Authors: Samuel Hocevar <sam@zoy.org> * Authors: Samuel Hocevar <sam@zoy.org>
* *
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
...@@ -46,9 +46,9 @@ vlc_module_begin(); ...@@ -46,9 +46,9 @@ vlc_module_begin();
set_description( _("DVDRead input module") ); set_description( _("DVDRead input module") );
add_submodule(); add_submodule();
set_capability( "access", 110 ); set_capability( "access", 110 );
set_callbacks( E_(OpenDVD), E_(CloseDVD) ); set_callbacks( E_(OpenDVD), E_(CloseDVD) );
add_submodule(); add_submodule();
set_capability( "demux", 0 ); set_capability( "demux", 0 );
set_callbacks( E_(InitDVD), E_(EndDVD) ); set_callbacks( E_(InitDVD), E_(EndDVD) );
vlc_module_end(); vlc_module_end();
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
* It depends on: libdvdread for ifo files and block reading. * It depends on: libdvdread for ifo files and block reading.
***************************************************************************** *****************************************************************************
* Copyright (C) 2001 VideoLAN * Copyright (C) 2001 VideoLAN
* $Id: input.c,v 1.11 2002/12/31 01:54:35 massiot Exp $ * $Id: input.c,v 1.12 2003/01/23 09:58:02 sam Exp $
* *
* Author: Stphane Borel <stef@via.ecp.fr> * Author: Stphane Borel <stef@via.ecp.fr>
* *
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
...@@ -94,7 +94,7 @@ static void DvdReadSeek ( input_thread_t *, off_t ); ...@@ -94,7 +94,7 @@ static void DvdReadSeek ( input_thread_t *, off_t );
/* called only from here */ /* called only from here */
static void DvdReadLauchDecoders( input_thread_t * p_input ); static void DvdReadLauchDecoders( input_thread_t * p_input );
static void DvdReadHandleDSI( thread_dvd_data_t * p_dvd, u8 * p_data ); static void DvdReadHandleDSI( thread_dvd_data_t * p_dvd, uint8_t * p_data );
static void DvdReadFindCell ( thread_dvd_data_t * p_dvd ); static void DvdReadFindCell ( thread_dvd_data_t * p_dvd );
/* /*
...@@ -111,13 +111,13 @@ int E_(InitDVD) ( vlc_object_t *p_this ) ...@@ -111,13 +111,13 @@ int E_(InitDVD) ( vlc_object_t *p_this )
if( p_input->stream.i_method != INPUT_METHOD_DVD ) if( p_input->stream.i_method != INPUT_METHOD_DVD )
{ {
return -1; return VLC_EGENERIC;
} }
p_demux = p_input->p_demux_data = malloc( sizeof(demux_sys_t ) ); p_demux = p_input->p_demux_data = malloc( sizeof(demux_sys_t ) );
if( p_demux == NULL ) if( p_demux == NULL )
{ {
return -1; return VLC_ENOMEM;
} }
p_input->p_private = (void*)&p_demux->mpeg; p_input->p_private = (void*)&p_demux->mpeg;
...@@ -125,19 +125,19 @@ int E_(InitDVD) ( vlc_object_t *p_this ) ...@@ -125,19 +125,19 @@ int E_(InitDVD) ( vlc_object_t *p_this )
if( p_demux->p_module == NULL ) if( p_demux->p_module == NULL )
{ {
free( p_input->p_demux_data ); free( p_input->p_demux_data );
return -1; return VLC_EMODULE;
} }
p_input->pf_demux = DvdReadDemux; p_input->pf_demux = DvdReadDemux;
p_input->pf_rewind = NULL; p_input->pf_rewind = NULL;
vlc_mutex_lock( &p_input->stream.stream_lock ); vlc_mutex_lock( &p_input->stream.stream_lock );
DvdReadLauchDecoders( p_input ); DvdReadLauchDecoders( p_input );
vlc_mutex_unlock( &p_input->stream.stream_lock ); vlc_mutex_unlock( &p_input->stream.stream_lock );
return 0; return VLC_SUCCESS;
} }
/***************************************************************************** /*****************************************************************************
...@@ -158,12 +158,12 @@ void E_(EndDVD) ( vlc_object_t *p_this ) ...@@ -158,12 +158,12 @@ void E_(EndDVD) ( vlc_object_t *p_this )
i_result = input_Peek( p_input, &p_peek, SIZE ); \ i_result = input_Peek( p_input, &p_peek, SIZE ); \
if( i_result == -1 ) \ if( i_result == -1 ) \
{ \ { \
return( -1 ); \ return -1; \
} \ } \
else if( i_result < SIZE ) \ else if( i_result < SIZE ) \
{ \ { \
/* EOF */ \ /* EOF */ \
return( 0 ); \ return 0; \
} }
static int DvdReadDemux( input_thread_t * p_input ) static int DvdReadDemux( input_thread_t * p_input )
...@@ -181,8 +181,8 @@ static int DvdReadDemux( input_thread_t * p_input ) ...@@ -181,8 +181,8 @@ static int DvdReadDemux( input_thread_t * p_input )
/* Read what we believe to be a packet header. */ /* Read what we believe to be a packet header. */
PEEK( 4 ); PEEK( 4 );
/* Default header */ /* Default header */
if( U32_AT( p_peek ) != 0x1BA ) if( U32_AT( p_peek ) != 0x1BA )
{ {
/* That's the case for all packets, except pack header. */ /* That's the case for all packets, except pack header. */
...@@ -212,7 +212,7 @@ static int DvdReadDemux( input_thread_t * p_input ) ...@@ -212,7 +212,7 @@ static int DvdReadDemux( input_thread_t * p_input )
} }
p_input->p_demux_data->mpeg.pf_demux_ps( p_input, p_data ); p_input->p_demux_data->mpeg.pf_demux_ps( p_input, p_data );
} }
return i; return i;
...@@ -223,7 +223,7 @@ static int DvdReadDemux( input_thread_t * p_input ) ...@@ -223,7 +223,7 @@ static int DvdReadDemux( input_thread_t * p_input )
*****************************************************************************/ *****************************************************************************/
static int DvdReadRewind( input_thread_t * p_input ) static int DvdReadRewind( input_thread_t * p_input )
{ {
return( -1 ); return -1;
} }
/* /*
...@@ -251,7 +251,7 @@ int E_(OpenDVD) ( vlc_object_t *p_this ) ...@@ -251,7 +251,7 @@ int E_(OpenDVD) ( vlc_object_t *p_this )
psz_parser = psz_source = strdup( p_input->psz_name ); psz_parser = psz_source = strdup( p_input->psz_name );
if( !psz_source ) if( !psz_source )
{ {
return( -1 ); return VLC_ENOMEM;
} }
p_input->pf_read = DvdReadRead; p_input->pf_read = DvdReadRead;
...@@ -291,18 +291,18 @@ int E_(OpenDVD) ( vlc_object_t *p_this ) ...@@ -291,18 +291,18 @@ int E_(OpenDVD) ( vlc_object_t *p_this )
free( psz_source ); free( psz_source );
if( !p_input->psz_access ) if( !p_input->psz_access )
{ {
return -1; return VLC_EGENERIC;
} }
psz_source = config_GetPsz( p_input, "dvd" ); psz_source = config_GetPsz( p_input, "dvd" );
if( !psz_source ) return -1; if( !psz_source ) return VLC_EGENERIC;
} }
if( stat( psz_source, &stat_info ) == -1 ) if( stat( psz_source, &stat_info ) == -1 )
{ {
msg_Err( p_input, "cannot stat() source `%s' (%s)", msg_Warn( p_input, "cannot stat() source `%s' (%s)",
psz_source, strerror(errno)); psz_source, strerror(errno) );
free( psz_source ); free( psz_source );
return( -1 ); return VLC_EGENERIC;
} }
if( !S_ISBLK(stat_info.st_mode) && if( !S_ISBLK(stat_info.st_mode) &&
!S_ISCHR(stat_info.st_mode) && !S_ISCHR(stat_info.st_mode) &&
...@@ -310,12 +310,12 @@ int E_(OpenDVD) ( vlc_object_t *p_this ) ...@@ -310,12 +310,12 @@ int E_(OpenDVD) ( vlc_object_t *p_this )
{ {
msg_Warn( p_input, "dvdread module discarded (not a valid source)" ); msg_Warn( p_input, "dvdread module discarded (not a valid source)" );
free( psz_source ); free( psz_source );
return -1; return VLC_EGENERIC;
} }
msg_Dbg( p_input, "dvdroot=%s title=%d chapter=%d angle=%d", msg_Dbg( p_input, "dvdroot=%s title=%d chapter=%d angle=%d",
psz_source, i_title, i_chapter, i_angle ); psz_source, i_title, i_chapter, i_angle );
p_dvdread = DVDOpen( psz_source ); p_dvdread = DVDOpen( psz_source );
...@@ -325,7 +325,7 @@ int E_(OpenDVD) ( vlc_object_t *p_this ) ...@@ -325,7 +325,7 @@ int E_(OpenDVD) ( vlc_object_t *p_this )
if( ! p_dvdread ) if( ! p_dvdread )
{ {
msg_Err( p_input, "libdvdcss cannot open source" ); msg_Err( p_input, "libdvdcss cannot open source" );
return -1; return VLC_EGENERIC;
} }
/* set up input */ /* set up input */
...@@ -335,7 +335,7 @@ int E_(OpenDVD) ( vlc_object_t *p_this ) ...@@ -335,7 +335,7 @@ int E_(OpenDVD) ( vlc_object_t *p_this )
if( p_dvd == NULL ) if( p_dvd == NULL )
{ {
msg_Err( p_input, "out of memory" ); msg_Err( p_input, "out of memory" );
return -1; return VLC_ENOMEM;
} }
p_dvd->p_dvdread = p_dvdread; p_dvd->p_dvdread = p_dvdread;
...@@ -350,7 +350,7 @@ int E_(OpenDVD) ( vlc_object_t *p_this ) ...@@ -350,7 +350,7 @@ int E_(OpenDVD) ( vlc_object_t *p_this )
{ {
msg_Err( p_input, "cannot open VMG info" ); msg_Err( p_input, "cannot open VMG info" );
free( p_dvd ); free( p_dvd );
return -1; return VLC_EGENERIC;
} }
msg_Dbg( p_input, "VMG opened" ); msg_Dbg( p_input, "VMG opened" );
...@@ -360,10 +360,10 @@ int E_(OpenDVD) ( vlc_object_t *p_this ) ...@@ -360,10 +360,10 @@ int E_(OpenDVD) ( vlc_object_t *p_this )
p_input->stream.i_method = INPUT_METHOD_DVD; p_input->stream.i_method = INPUT_METHOD_DVD;
/* If we are here we can control the pace... */ /* If we are here we can control the pace... */
p_input->stream.b_pace_control = 1; p_input->stream.b_pace_control = VLC_TRUE;
p_input->stream.b_seekable = 1; p_input->stream.b_seekable = VLC_TRUE;
p_input->stream.b_connected = 1; p_input->stream.b_connected = VLC_TRUE;
p_input->stream.p_selected_area->i_size = 0; p_input->stream.p_selected_area->i_size = 0;
p_input->stream.p_selected_area->i_tell = 0; p_input->stream.p_selected_area->i_tell = 0;
...@@ -408,14 +408,14 @@ int E_(OpenDVD) ( vlc_object_t *p_this ) ...@@ -408,14 +408,14 @@ int E_(OpenDVD) ( vlc_object_t *p_this )
p_dvd->i_chapter = i_chapter < p_area->i_part_nb ? i_chapter : 1; p_dvd->i_chapter = i_chapter < p_area->i_part_nb ? i_chapter : 1;
p_area->i_part = p_dvd->i_chapter; p_area->i_part = p_dvd->i_chapter;
p_dvd->i_angle = i_angle; p_dvd->i_angle = i_angle;
/* set title, chapter, audio and subpic */ /* set title, chapter, audio and subpic */
if( DvdReadSetArea( p_input, p_area ) ) if( DvdReadSetArea( p_input, p_area ) )
{ {
vlc_mutex_unlock( &p_input->stream.stream_lock ); vlc_mutex_unlock( &p_input->stream.stream_lock );
return -1; return VLC_EGENERIC;
} }
vlc_mutex_unlock( &p_input->stream.stream_lock ); vlc_mutex_unlock( &p_input->stream.stream_lock );
...@@ -425,7 +425,7 @@ int E_(OpenDVD) ( vlc_object_t *p_this ) ...@@ -425,7 +425,7 @@ int E_(OpenDVD) ( vlc_object_t *p_this )
p_input->psz_demux = "dvdread"; p_input->psz_demux = "dvdread";
} }
return 0; return VLC_SUCCESS;
} }
/***************************************************************************** /*****************************************************************************
...@@ -463,7 +463,7 @@ static int DvdReadSetProgram( input_thread_t * p_input, ...@@ -463,7 +463,7 @@ static int DvdReadSetProgram( input_thread_t * p_input,
if( p_input->stream.p_selected_program != p_program ) if( p_input->stream.p_selected_program != p_program )
{ {
thread_dvd_data_t * p_dvd; thread_dvd_data_t * p_dvd;
p_dvd = (thread_dvd_data_t*)(p_input->p_access_data); p_dvd = (thread_dvd_data_t*)(p_input->p_access_data);
p_dvd->i_angle = p_program->i_number; p_dvd->i_angle = p_program->i_number;
...@@ -475,7 +475,7 @@ static int DvdReadSetProgram( input_thread_t * p_input, ...@@ -475,7 +475,7 @@ static int DvdReadSetProgram( input_thread_t * p_input,
msg_Dbg( p_input, "angle %d selected", p_dvd->i_angle ); msg_Dbg( p_input, "angle %d selected", p_dvd->i_angle );
} }
return 0; return VLC_SUCCESS;
} }
#define p_pgc p_dvd->p_cur_pgc #define p_pgc p_dvd->p_cur_pgc
...@@ -496,7 +496,7 @@ static int DvdReadSetArea( input_thread_t * p_input, input_area_t * p_area ) ...@@ -496,7 +496,7 @@ static int DvdReadSetArea( input_thread_t * p_input, input_area_t * p_area )
p_dvd = (thread_dvd_data_t*)p_input->p_access_data; p_dvd = (thread_dvd_data_t*)p_input->p_access_data;
/* we can't use the interface slider until initilization is complete */ /* we can't use the interface slider until initilization is complete */
p_input->stream.b_seekable = 0; p_input->stream.b_seekable = VLC_FALSE;
if( p_area != p_input->stream.p_selected_area ) if( p_area != p_input->stream.p_selected_area )
{ {
...@@ -538,7 +538,7 @@ static int DvdReadSetArea( input_thread_t * p_input, input_area_t * p_area ) ...@@ -538,7 +538,7 @@ static int DvdReadSetArea( input_thread_t * p_input, input_area_t * p_area )
msg_Err( p_input, "fatal error in vts ifo" ); msg_Err( p_input, "fatal error in vts ifo" );
ifoClose( p_vmg ); ifoClose( p_vmg );
DVDClose( p_dvd->p_dvdread ); DVDClose( p_dvd->p_dvdread );
return -1; return VLC_EGENERIC;
} }
/* title position inside the selected vts */ /* title position inside the selected vts */
...@@ -574,7 +574,7 @@ static int DvdReadSetArea( input_thread_t * p_input, input_area_t * p_area ) ...@@ -574,7 +574,7 @@ static int DvdReadSetArea( input_thread_t * p_input, input_area_t * p_area )
*/ */
/* Remeber current chapter */ /* Remeber current chapter */
p_dvd->i_chapter = p_area->i_part; p_dvd->i_chapter = p_area->i_part;
p_dvd->b_eoc = 0; p_dvd->b_eoc = VLC_FALSE;
pgc_id = p_vts->vts_ptt_srpt->title[ pgc_id = p_vts->vts_ptt_srpt->title[
p_dvd->i_ttn-1].ptt[p_area->i_part-1].pgcn; p_dvd->i_ttn-1].ptt[p_area->i_part-1].pgcn;
...@@ -611,7 +611,7 @@ static int DvdReadSetArea( input_thread_t * p_input, input_area_t * p_area ) ...@@ -611,7 +611,7 @@ static int DvdReadSetArea( input_thread_t * p_input, input_area_t * p_area )
ifoClose( p_vts ); ifoClose( p_vts );
ifoClose( p_vmg ); ifoClose( p_vmg );
DVDClose( p_dvd->p_dvdread ); DVDClose( p_dvd->p_dvdread );
return -1; return VLC_EGENERIC;
} }
// IfoPrintTitle( p_dvd ); // IfoPrintTitle( p_dvd );
...@@ -650,12 +650,12 @@ static int DvdReadSetArea( input_thread_t * p_input, input_area_t * p_area ) ...@@ -650,12 +650,12 @@ static int DvdReadSetArea( input_thread_t * p_input, input_area_t * p_area )
{ {
input_AddProgram( p_input, i+1, 0 ); input_AddProgram( p_input, i+1, 0 );
} }
DvdReadSetProgram( p_input, DvdReadSetProgram( p_input,
p_input->stream.pp_programs[p_dvd->i_angle-1] ); p_input->stream.pp_programs[p_dvd->i_angle-1] );
/* No PSM to read in DVD mode, we already have all information */ /* No PSM to read in DVD mode, we already have all information */
p_input->stream.p_selected_program->b_is_ok = 1; p_input->stream.p_selected_program->b_is_ok = VLC_TRUE;
p_es = NULL; p_es = NULL;
...@@ -673,7 +673,7 @@ static int DvdReadSetArea( input_thread_t * p_input, input_area_t * p_area ) ...@@ -673,7 +673,7 @@ static int DvdReadSetArea( input_thread_t * p_input, input_area_t * p_area )
for( i = 1 ; i <= p_vts->vtsi_mat->nr_of_vts_audio_streams ; i++ ) for( i = 1 ; i <= p_vts->vtsi_mat->nr_of_vts_audio_streams ; i++ )
{ {
int i_position = 0; int i_position = 0;
u16 i_id; uint16_t i_id;
// IfoPrintAudio( p_dvd, i ); // IfoPrintAudio( p_dvd, i );
...@@ -693,7 +693,7 @@ static int DvdReadSetArea( input_thread_t * p_input, input_area_t * p_area ) ...@@ -693,7 +693,7 @@ static int DvdReadSetArea( input_thread_t * p_input, input_area_t * p_area )
p_es->i_fourcc = VLC_FOURCC('a','5','2','b'); p_es->i_fourcc = VLC_FOURCC('a','5','2','b');
p_es->i_cat = AUDIO_ES; p_es->i_cat = AUDIO_ES;
strcpy( p_es->psz_desc, DecodeLanguage( strcpy( p_es->psz_desc, DecodeLanguage(
p_vts->vtsi_mat->vts_audio_attr[i-1].lang_code ) ); p_vts->vtsi_mat->vts_audio_attr[i-1].lang_code ) );
strcat( p_es->psz_desc, " (A52)" ); strcat( p_es->psz_desc, " (A52)" );
break; break;
...@@ -705,7 +705,7 @@ static int DvdReadSetArea( input_thread_t * p_input, input_area_t * p_area ) ...@@ -705,7 +705,7 @@ static int DvdReadSetArea( input_thread_t * p_input, input_area_t * p_area )
p_es->i_fourcc = VLC_FOURCC('m','p','g','a'); p_es->i_fourcc = VLC_FOURCC('m','p','g','a');
p_es->i_cat = AUDIO_ES; p_es->i_cat = AUDIO_ES;
strcpy( p_es->psz_desc, DecodeLanguage( strcpy( p_es->psz_desc, DecodeLanguage(
p_vts->vtsi_mat->vts_audio_attr[i-1].lang_code ) ); p_vts->vtsi_mat->vts_audio_attr[i-1].lang_code ) );
strcat( p_es->psz_desc, " (mpeg)" ); strcat( p_es->psz_desc, " (mpeg)" );
break; break;
...@@ -717,7 +717,7 @@ static int DvdReadSetArea( input_thread_t * p_input, input_area_t * p_area ) ...@@ -717,7 +717,7 @@ static int DvdReadSetArea( input_thread_t * p_input, input_area_t * p_area )
p_es->i_fourcc = VLC_FOURCC('l','p','c','b'); p_es->i_fourcc = VLC_FOURCC('l','p','c','b');
p_es->i_cat = AUDIO_ES; p_es->i_cat = AUDIO_ES;
strcpy( p_es->psz_desc, DecodeLanguage( strcpy( p_es->psz_desc, DecodeLanguage(
p_vts->vtsi_mat->vts_audio_attr[i-1].lang_code ) ); p_vts->vtsi_mat->vts_audio_attr[i-1].lang_code ) );
strcat( p_es->psz_desc, " (lpcm)" ); strcat( p_es->psz_desc, " (lpcm)" );
break; break;
...@@ -742,7 +742,7 @@ static int DvdReadSetArea( input_thread_t * p_input, input_area_t * p_area ) ...@@ -742,7 +742,7 @@ static int DvdReadSetArea( input_thread_t * p_input, input_area_t * p_area )
for( i = 1 ; i <= p_vts->vtsi_mat->nr_of_vts_subp_streams; i++ ) for( i = 1 ; i <= p_vts->vtsi_mat->nr_of_vts_subp_streams; i++ )
{ {
int i_position = 0; int i_position = 0;
u16 i_id; uint16_t i_id;
// IfoPrintSpu( p_dvd, i ); // IfoPrintSpu( p_dvd, i );
msg_Dbg( p_input, "spu %d 0x%02x", i, spu_control ); msg_Dbg( p_input, "spu %d 0x%02x", i, spu_control );
...@@ -780,7 +780,7 @@ static int DvdReadSetArea( input_thread_t * p_input, input_area_t * p_area ) ...@@ -780,7 +780,7 @@ static int DvdReadSetArea( input_thread_t * p_input, input_area_t * p_area )
p_es->i_fourcc = VLC_FOURCC('s','p','u','b'); p_es->i_fourcc = VLC_FOURCC('s','p','u','b');
p_es->i_cat = SPU_ES; p_es->i_cat = SPU_ES;
strcpy( p_es->psz_desc, DecodeLanguage( strcpy( p_es->psz_desc, DecodeLanguage(
p_vts->vtsi_mat->vts_subp_attr[i-1].lang_code ) ); p_vts->vtsi_mat->vts_subp_attr[i-1].lang_code ) );
} }
} }
#undef spu_control #undef spu_control
...@@ -791,7 +791,7 @@ static int DvdReadSetArea( input_thread_t * p_input, input_area_t * p_area ) ...@@ -791,7 +791,7 @@ static int DvdReadSetArea( input_thread_t * p_input, input_area_t * p_area )
{ {
DvdReadLauchDecoders( p_input ); DvdReadLauchDecoders( p_input );
} }
} /* i_title >= 0 */ } /* i_title >= 0 */
else else
{ {
...@@ -833,10 +833,10 @@ static int DvdReadSetArea( input_thread_t * p_input, input_area_t * p_area ) ...@@ -833,10 +833,10 @@ static int DvdReadSetArea( input_thread_t * p_input, input_area_t * p_area )
/* warn interface that something has changed */ /* warn interface that something has changed */
p_area->i_tell = LB2OFF( p_dvd->i_next_vobu ) - p_area->i_start; p_area->i_tell = LB2OFF( p_dvd->i_next_vobu ) - p_area->i_start;
p_input->stream.b_seekable = 1; p_input->stream.b_seekable = VLC_TRUE;
p_input->stream.b_changed = 1; p_input->stream.b_changed = VLC_TRUE;
return 0; return VLC_SUCCESS;
} }
...@@ -855,7 +855,7 @@ static int DvdReadRead( input_thread_t * p_input, ...@@ -855,7 +855,7 @@ static int DvdReadRead( input_thread_t * p_input,
int i_blocks; int i_blocks;
int i_read; int i_read;
int i_read_total; int i_read_total;
vlc_bool_t b_eot = 0; vlc_bool_t b_eot = VLC_FALSE;
p_dvd = (thread_dvd_data_t *)p_input->p_access_data; p_dvd = (thread_dvd_data_t *)p_input->p_access_data;
p_buf = p_buffer; p_buf = p_buffer;
...@@ -869,7 +869,7 @@ static int DvdReadRead( input_thread_t * p_input, ...@@ -869,7 +869,7 @@ static int DvdReadRead( input_thread_t * p_input,
while( i_blocks ) while( i_blocks )
{ {
/* /*
* End of pack, we select the following one * End of pack, we select the following one
*/ */
if( ! p_dvd->i_pack_len ) if( ! p_dvd->i_pack_len )
...@@ -888,7 +888,7 @@ static int DvdReadRead( input_thread_t * p_input, ...@@ -888,7 +888,7 @@ static int DvdReadRead( input_thread_t * p_input,
/* basic check to be sure we don't have a empty title /* basic check to be sure we don't have a empty title
* go to next title if so */ * go to next title if so */
//assert( p_buffer[41] == 0xbf && p_buffer[1027] == 0xbf ); //assert( p_buffer[41] == 0xbf && p_buffer[1027] == 0xbf );
/* /*
* Parse the contained dsi packet. * Parse the contained dsi packet.
*/ */
...@@ -946,14 +946,14 @@ static int DvdReadRead( input_thread_t * p_input, ...@@ -946,14 +946,14 @@ static int DvdReadRead( input_thread_t * p_input,
/* We modify i_part only at end of chapter not to erase /* We modify i_part only at end of chapter not to erase
* some modification from the interface */ * some modification from the interface */
p_input->stream.p_selected_area->i_part = p_dvd->i_chapter; p_input->stream.p_selected_area->i_part = p_dvd->i_chapter;
p_dvd->b_eoc = 0; p_dvd->b_eoc = VLC_FALSE;
} }
if( ( LB2OFF( p_dvd->i_cur_block ) if( ( LB2OFF( p_dvd->i_cur_block )
- p_input->stream.p_selected_area->i_start ) - p_input->stream.p_selected_area->i_start )
>= p_input->stream.p_selected_area->i_size || b_eot ) >= p_input->stream.p_selected_area->i_size || b_eot )
{ {
if( ( p_input->stream.p_selected_area->i_id + 1 ) >= if( ( p_input->stream.p_selected_area->i_id + 1 ) >=
p_input->stream.i_area_nb ) p_input->stream.i_area_nb )
{ {
/* EOF */ /* EOF */
...@@ -995,7 +995,7 @@ static void DvdReadSeek( input_thread_t * p_input, off_t i_off ) ...@@ -995,7 +995,7 @@ static void DvdReadSeek( input_thread_t * p_input, off_t i_off )
vlc_mutex_lock( &p_input->stream.stream_lock ); vlc_mutex_lock( &p_input->stream.stream_lock );
i_off += p_input->stream.p_selected_area->i_start; i_off += p_input->stream.p_selected_area->i_start;
vlc_mutex_unlock( &p_input->stream.stream_lock ); vlc_mutex_unlock( &p_input->stream.stream_lock );
i_lb = OFF2LB( i_off ); i_lb = OFF2LB( i_off );
p_dvd = ( thread_dvd_data_t * )p_input->p_access_data; p_dvd = ( thread_dvd_data_t * )p_input->p_access_data;
...@@ -1064,7 +1064,7 @@ static void DvdReadSeek( input_thread_t * p_input, off_t i_off ) ...@@ -1064,7 +1064,7 @@ static void DvdReadSeek( input_thread_t * p_input, off_t i_off )
/***************************************************************************** /*****************************************************************************
* DvdReadHandleDSI * DvdReadHandleDSI
*****************************************************************************/ *****************************************************************************/
static void DvdReadHandleDSI( thread_dvd_data_t * p_dvd, u8 * p_data ) static void DvdReadHandleDSI( thread_dvd_data_t * p_dvd, uint8_t * p_data )
{ {
navRead_DSI( &(p_dvd->dsi_pack), &(p_data[ DSI_START_BYTE ]) ); navRead_DSI( &(p_dvd->dsi_pack), &(p_data[ DSI_START_BYTE ]) );
...@@ -1149,7 +1149,7 @@ static void DvdReadHandleDSI( thread_dvd_data_t * p_dvd, u8 * p_data ) ...@@ -1149,7 +1149,7 @@ static void DvdReadHandleDSI( thread_dvd_data_t * p_dvd, u8 * p_data )
p_dvd->dsi_pack.dsi_gi.vobu_vob_idn, p_dvd->dsi_pack.dsi_gi.vobu_vob_idn,
p_dvd->dsi_pack.dsi_gi.vobu_c_idn ); p_dvd->dsi_pack.dsi_gi.vobu_c_idn );
msg_Dbg( p_input, 12, "cat 0x%02x ilvu_ea %d ilvu_sa %d size %d", msg_Dbg( p_input, 12, "cat 0x%02x ilvu_ea %d ilvu_sa %d size %d",
p_dvd->dsi_pack.sml_pbi.category, p_dvd->dsi_pack.sml_pbi.category,
p_dvd->dsi_pack.sml_pbi.ilvu_ea, p_dvd->dsi_pack.sml_pbi.ilvu_ea,
p_dvd->dsi_pack.sml_pbi.ilvu_sa, p_dvd->dsi_pack.sml_pbi.ilvu_sa,
...@@ -1200,7 +1200,7 @@ static void DvdReadFindCell( thread_dvd_data_t * p_dvd ) ...@@ -1200,7 +1200,7 @@ static void DvdReadFindCell( thread_dvd_data_t * p_dvd )
if( p_pgc->program_map[pgn-1] <= p_dvd->i_cur_cell ) if( p_pgc->program_map[pgn-1] <= p_dvd->i_cur_cell )
{ {
p_dvd->i_chapter++; p_dvd->i_chapter++;
p_dvd->b_eoc = 1; p_dvd->b_eoc = VLC_TRUE;
} }
} }
......
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