Commit ade615bf authored by Sam Hocevar's avatar Sam Hocevar

* ./configure.ac.in: removed -W in favour of -Wtraditional.

  * ALL: a bunch of additional warning fixes.
parent 94cc398e
...@@ -460,16 +460,16 @@ fi ...@@ -460,16 +460,16 @@ fi
# fi # fi
#done #done
AC_CACHE_CHECK([if \$CC accepts -W],
[ac_cv_c_W],
[CFLAGS="-W ${CFLAGS_save}"
AC_TRY_COMPILE([],,ac_cv_c_W=yes, ac_cv_c_W=no)])
AC_CACHE_CHECK([if \$CC accepts -Wall], AC_CACHE_CHECK([if \$CC accepts -Wall],
[ac_cv_c_Wall], [ac_cv_c_Wall],
[CFLAGS="-Wall ${CFLAGS_save}" [CFLAGS="-Wall ${CFLAGS_save}"
AC_TRY_COMPILE([],,ac_cv_c_Wall=yes, ac_cv_c_Wall=no)]) AC_TRY_COMPILE([],,ac_cv_c_Wall=yes, ac_cv_c_Wall=no)])
AC_CACHE_CHECK([if \$CC accepts -Wtraditional],
[ac_cv_c_Wtraditional],
[CFLAGS="-Wtraditional ${CFLAGS_save}"
AC_TRY_COMPILE([],,ac_cv_c_Wtraditional=yes, ac_cv_c_Wtraditional=no)])
AC_CACHE_CHECK([if \$CC accepts -Wconversion], AC_CACHE_CHECK([if \$CC accepts -Wconversion],
[ac_cv_c_Wconversion], [ac_cv_c_Wconversion],
[CFLAGS="-Wconversion ${CFLAGS_save}" [CFLAGS="-Wconversion ${CFLAGS_save}"
...@@ -495,17 +495,18 @@ AC_CACHE_CHECK([if \$CC accepts -Winline], ...@@ -495,17 +495,18 @@ AC_CACHE_CHECK([if \$CC accepts -Winline],
[CFLAGS="-Winline ${CFLAGS_save}" [CFLAGS="-Winline ${CFLAGS_save}"
AC_TRY_COMPILE([],,ac_cv_c_Winline=yes, ac_cv_c_Winline=no)]) AC_TRY_COMPILE([],,ac_cv_c_Winline=yes, ac_cv_c_Winline=no)])
if test "x${ac_cv_c_W}" != "xno"; then
CFLAGS_save="-W ${CFLAGS_save}"; CFLAGS="${CFLAGS_save}"
CXXFLAGS_save="-W ${CFLAGS_save}"; CXXFLAGS="${CXXFLAGS_save}"
OBJCFLAGS_save="-W ${OBJCFLAGS_save}"; OBJCFLAGS="${OBJCFLAGS_save}"
fi
if test "x${ac_cv_c_Wall}" != "xno"; then if test "x${ac_cv_c_Wall}" != "xno"; then
CFLAGS_save="-Wall ${CFLAGS_save}"; CFLAGS="${CFLAGS_save}" CFLAGS_save="-Wall ${CFLAGS_save}"; CFLAGS="${CFLAGS_save}"
CXXFLAGS_save="-Wall ${CFLAGS_save}"; CXXFLAGS="${CXXFLAGS_save}" CXXFLAGS_save="-Wall ${CFLAGS_save}"; CXXFLAGS="${CXXFLAGS_save}"
OBJCFLAGS_save="-Wall ${OBJCFLAGS_save}"; OBJCFLAGS="${OBJCFLAGS_save}" OBJCFLAGS_save="-Wall ${OBJCFLAGS_save}"; OBJCFLAGS="${OBJCFLAGS_save}"
fi fi
if test "x${ac_cv_c_Wtraditional}" != "xno"; then
CFLAGS_save="-Wtraditional ${CFLAGS_save}"; CFLAGS="${CFLAGS_save}"
CXXFLAGS_save="-Wtraditional ${CFLAGS_save}"; CXXFLAGS="${CXXFLAGS_save}"
OBJCFLAGS_save="-Wtraditional ${OBJCFLAGS_save}"; OBJCFLAGS="${OBJCFLAGS_save}"
fi
if test "x${ac_cv_c_Wunreachable_code}" != "xno"; then if test "x${ac_cv_c_Wunreachable_code}" != "xno"; then
CFLAGS_save="-Wunreachable-code ${CFLAGS_save}"; CFLAGS="${CFLAGS_save}" CFLAGS_save="-Wunreachable-code ${CFLAGS_save}"; CFLAGS="${CFLAGS_save}"
CXXFLAGS_save="-Wunreachable-code ${CFLAGS_save}"; CXXFLAGS="${CXXFLAGS_save}" CXXFLAGS_save="-Wunreachable-code ${CFLAGS_save}"; CXXFLAGS="${CXXFLAGS_save}"
......
/***************************************************************************** /*****************************************************************************
* input_ext-intf.h: structures of the input exported to the interface * input_ext-intf.h: structures of the input exported to the interface
* This header provides structures to read the stream descriptors and * This header provides structures to read the stream descriptors and
* control the pace of reading. * control the pace of reading.
***************************************************************************** *****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN * Copyright (C) 1999, 2000 VideoLAN
* $Id: input_ext-intf.h,v 1.79 2002/12/06 10:10:40 sam Exp $ * $Id: input_ext-intf.h,v 1.80 2002/12/06 16:34:03 sam Exp $
* *
* Authors: Christophe Massiot <massiot@via.ecp.fr> * Authors: Christophe Massiot <massiot@via.ecp.fr>
* *
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,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
...@@ -61,7 +61,7 @@ struct es_descriptor_t ...@@ -61,7 +61,7 @@ struct es_descriptor_t
/* PES parser information */ /* PES parser information */
pes_packet_t * p_pes; /* Current PES */ pes_packet_t * p_pes; /* Current PES */
int i_pes_real_size; /* as indicated by the header */ unsigned int i_pes_real_size; /* as indicated by the header */
/* Decoder information */ /* Decoder information */
decoder_fifo_t * p_decoder_fifo; decoder_fifo_t * p_decoder_fifo;
...@@ -75,7 +75,7 @@ struct es_descriptor_t ...@@ -75,7 +75,7 @@ struct es_descriptor_t
#define PROGRAM_ASSOCIATION_TABLE_PID 0x0000 #define PROGRAM_ASSOCIATION_TABLE_PID 0x0000
#define CONDITIONNAL_ACCESS_TABLE_PID 0x0001 /* not used */ #define CONDITIONNAL_ACCESS_TABLE_PID 0x0001 /* not used */
#define EMPTY_ID 0xffff /* empty record in a table */ #define EMPTY_ID 0xffff /* empty record in a table */
/* ES Categories to be used by interface plugins */ /* ES Categories to be used by interface plugins */
#define UNKNOWN_ES 0x00 #define UNKNOWN_ES 0x00
...@@ -114,7 +114,7 @@ struct pgrm_descriptor_t ...@@ -114,7 +114,7 @@ struct pgrm_descriptor_t
/* Demultiplexer data */ /* Demultiplexer data */
pgrm_sys_t * p_demux_data; pgrm_sys_t * p_demux_data;
int i_es_number; /* size of the following array */ unsigned int i_es_number; /* size of the following array */
es_descriptor_t ** pp_es; /* array of pointers to ES */ es_descriptor_t ** pp_es; /* array of pointers to ES */
}; };
...@@ -131,7 +131,7 @@ struct pgrm_descriptor_t ...@@ -131,7 +131,7 @@ struct pgrm_descriptor_t
struct input_area_t struct input_area_t
{ {
/* selected area attributes */ /* selected area attributes */
int i_id; /* identificator for area */ unsigned int i_id; /* identificator for area */
off_t i_start; /* start offset of area */ off_t i_start; /* start offset of area */
off_t i_size; /* total size of the area off_t i_size; /* total size of the area
* (in arbitrary units) */ * (in arbitrary units) */
...@@ -143,8 +143,8 @@ struct input_area_t ...@@ -143,8 +143,8 @@ struct input_area_t
* (changed by the interface thread */ * (changed by the interface thread */
/* area subdivision */ /* area subdivision */
int i_part_nb; /* number of parts (chapter for DVD)*/ unsigned int i_part_nb; /* number of parts (chapter for DVD)*/
int i_part; /* currently selected part */ unsigned int i_part; /* currently selected part */
/* offset to plugin related data */ /* offset to plugin related data */
...@@ -168,7 +168,7 @@ struct input_info_t { ...@@ -168,7 +168,7 @@ struct input_info_t {
* Value of this item * Value of this item
*/ */
char * psz_value; char * psz_value;
/** /**
* Pointer to next item in list, or NULL it at end of list * Pointer to next item in list, or NULL it at end of list
*/ */
...@@ -188,12 +188,12 @@ struct input_info_category_t { ...@@ -188,12 +188,12 @@ struct input_info_category_t {
* The name of this category * The name of this category
*/ */
char * psz_name; char * psz_name;
/** /**
* first element of a linked list containing info items * first element of a linked list containing info items
*/ */
input_info_t * p_info; input_info_t * p_info;
/** /**
* Pointer to next element in this list, or NULL if at end of list * Pointer to next element in this list, or NULL if at end of list
*/ */
...@@ -215,13 +215,13 @@ struct stream_descriptor_t ...@@ -215,13 +215,13 @@ struct stream_descriptor_t
* or modify stream, pgrm or es */ * or modify stream, pgrm or es */
/* Input method data */ /* Input method data */
int i_method; /* input method for stream: file, unsigned int i_method; /* input method for stream: file,
disc or network */ disc or network */
vlc_bool_t b_pace_control; /* can we read when we want ? */ vlc_bool_t b_pace_control; /* can we read when we want ? */
vlc_bool_t b_seekable; /* can we do lseek() ? */ vlc_bool_t b_seekable; /* can we do lseek() ? */
/* if (b_seekable) : */ /* if (b_seekable) : */
int i_area_nb; unsigned int i_area_nb;
input_area_t ** pp_areas; /* list of areas in stream == offset input_area_t ** pp_areas; /* list of areas in stream == offset
* interval with own properties */ * interval with own properties */
input_area_t * p_selected_area; input_area_t * p_selected_area;
...@@ -232,7 +232,7 @@ struct stream_descriptor_t ...@@ -232,7 +232,7 @@ struct stream_descriptor_t
* units of 50 bytes/s) ; 0 if undef */ * units of 50 bytes/s) ; 0 if undef */
/* New status and rate requested by the interface */ /* New status and rate requested by the interface */
int i_new_status, i_new_rate; unsigned int i_new_status, i_new_rate;
int b_new_mute; /* int because it can be -1 */ int b_new_mute; /* int because it can be -1 */
vlc_cond_t stream_wait; /* interface -> input in case of a vlc_cond_t stream_wait; /* interface -> input in case of a
* status change request */ * status change request */
...@@ -241,20 +241,20 @@ struct stream_descriptor_t ...@@ -241,20 +241,20 @@ struct stream_descriptor_t
stream_sys_t * p_demux_data; stream_sys_t * p_demux_data;
/* Programs descriptions */ /* Programs descriptions */
int i_pgrm_number; /* size of the following array */ unsigned int i_pgrm_number; /* size of the following array */
pgrm_descriptor_t ** pp_programs; /* array of pointers to pgrm */ pgrm_descriptor_t ** pp_programs; /* array of pointers to pgrm */
pgrm_descriptor_t * p_selected_program; /* currently pgrm_descriptor_t * p_selected_program; /* currently
selected program */ selected program */
pgrm_descriptor_t * p_new_program; /* Newly selected program */ pgrm_descriptor_t * p_new_program; /* Newly selected program */
/* ES descriptions */ /* ES descriptions */
int i_es_number; unsigned int i_es_number;
es_descriptor_t ** pp_es; /* carried elementary streams */ es_descriptor_t ** pp_es; /* carried elementary streams */
int i_selected_es_number; unsigned int i_selected_es_number;
es_descriptor_t ** pp_selected_es; /* ES with a decoder */ es_descriptor_t ** pp_selected_es; /* ES with a decoder */
es_descriptor_t * p_newly_selected_es; /* ES selected from es_descriptor_t * p_newly_selected_es; /* ES selected from
* the interface */ * the interface */
es_descriptor_t * p_removed_es; /* ES removed from the interface */ es_descriptor_t * p_removed_es; /* ES removed from the interface */
/* Stream control */ /* Stream control */
stream_ctrl_t control; stream_ctrl_t control;
...@@ -263,7 +263,7 @@ struct stream_descriptor_t ...@@ -263,7 +263,7 @@ struct stream_descriptor_t
/* Input info */ /* Input info */
input_info_category_t * p_info; input_info_category_t * p_info;
/* Statistics */ /* Statistics */
count_t c_packets_read; /* packets read */ count_t c_packets_read; /* packets read */
count_t c_packets_trashed; /* trashed packets */ count_t c_packets_trashed; /* trashed packets */
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* -udf.* to find files * -udf.* to find files
***************************************************************************** *****************************************************************************
* Copyright (C) 1998-2001 VideoLAN * Copyright (C) 1998-2001 VideoLAN
* $Id: access.c,v 1.5 2002/11/13 20:23:21 fenrir Exp $ * $Id: access.c,v 1.6 2002/12/06 16:34:04 sam Exp $
* *
* Author: Stphane Borel <stef@via.ecp.fr> * Author: Stphane Borel <stef@via.ecp.fr>
* *
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,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
...@@ -104,7 +104,7 @@ int E_(DVDOpen) ( vlc_object_t *p_this ) ...@@ -104,7 +104,7 @@ int E_(DVDOpen) ( vlc_object_t *p_this )
return -1; return -1;
} }
p_input->p_access_data = (void *)p_dvd; p_input->p_access_data = (void *)p_dvd;
p_input->pf_read = DVDRead; p_input->pf_read = DVDRead;
p_input->pf_seek = DVDSeek; p_input->pf_seek = DVDSeek;
p_input->pf_set_area = DVDSetArea; p_input->pf_set_area = DVDSetArea;
...@@ -116,10 +116,10 @@ int E_(DVDOpen) ( vlc_object_t *p_this ) ...@@ -116,10 +116,10 @@ int E_(DVDOpen) ( vlc_object_t *p_this )
free( p_dvd ); free( p_dvd );
return -1; return -1;
} }
/* /*
* set up input * set up input
*/ */
p_input->i_mtu = 0; p_input->i_mtu = 0;
/* override environment variable DVDCSS_METHOD with config option /* override environment variable DVDCSS_METHOD with config option
...@@ -146,9 +146,9 @@ int E_(DVDOpen) ( vlc_object_t *p_this ) ...@@ -146,9 +146,9 @@ int E_(DVDOpen) ( vlc_object_t *p_this )
/* /*
* get plugin ready * get plugin ready
*/ */
p_dvd->dvdhandle = dvdcss_open( psz_device ); p_dvd->dvdhandle = dvdcss_open( psz_device );
/* free allocated string */ /* free allocated string */
free( psz_device ); free( psz_device );
...@@ -210,7 +210,7 @@ int E_(DVDOpen) ( vlc_object_t *p_this ) ...@@ -210,7 +210,7 @@ int E_(DVDOpen) ( vlc_object_t *p_this )
/* Titles are Program Chains */ /* Titles are Program Chains */
area[i]->i_id = i; area[i]->i_id = i;
/* Absolute start offset and size /* Absolute start offset and size
* We can only set that with vts ifo, so we do it during the * We can only set that with vts ifo, so we do it during the
* first call to DVDSetArea */ * first call to DVDSetArea */
area[i]->i_start = 0; area[i]->i_start = 0;
...@@ -223,23 +223,23 @@ int E_(DVDOpen) ( vlc_object_t *p_this ) ...@@ -223,23 +223,23 @@ int E_(DVDOpen) ( vlc_object_t *p_this )
/* Offset to vts_i_0.ifo */ /* Offset to vts_i_0.ifo */
area[i]->i_plugin_data = p_dvd->p_ifo->i_start + area[i]->i_plugin_data = p_dvd->p_ifo->i_start +
title_inf.p_attr[i-1].i_start_sector; title_inf.p_attr[i-1].i_start_sector;
} }
#undef area #undef area
p_dvd->i_title = p_dvd->i_title <= title_inf.i_title_nb ? p_dvd->i_title = p_dvd->i_title <= title_inf.i_title_nb ?
p_dvd->i_title : 1; p_dvd->i_title : 1;
#undef title_inf #undef title_inf
p_area = p_input->stream.pp_areas[p_dvd->i_title]; p_area = p_input->stream.pp_areas[p_dvd->i_title];
p_area->i_part = p_dvd->i_chapter <= p_area->i_part_nb ? p_area->i_part = p_dvd->i_chapter <= p_area->i_part_nb ?
p_dvd->i_chapter : 1; p_dvd->i_chapter : 1;
p_dvd->i_chapter = 1; p_dvd->i_chapter = 1;
p_dvd->b_new_chapter = 0; p_dvd->b_new_chapter = 0;
p_dvd->i_audio_nb = 0; p_dvd->i_audio_nb = 0;
p_dvd->i_spu_nb = 0; p_dvd->i_spu_nb = 0;
/* set title, chapter, audio and subpic */ /* set title, chapter, audio and subpic */
if( DVDSetArea( p_input, p_area ) < 0 ) if( DVDSetArea( p_input, p_area ) < 0 )
{ {
...@@ -277,13 +277,13 @@ void E_(DVDClose) ( vlc_object_t *p_this ) ...@@ -277,13 +277,13 @@ void E_(DVDClose) ( vlc_object_t *p_this )
* DVDSetProgram: used to change angle * DVDSetProgram: used to change angle
*****************************************************************************/ *****************************************************************************/
static int DVDSetProgram( input_thread_t * p_input, static int DVDSetProgram( input_thread_t * p_input,
pgrm_descriptor_t * p_program ) pgrm_descriptor_t * p_program )
{ {
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;
int i_angle; int i_angle;
p_dvd = (thread_dvd_data_t*)(p_input->p_access_data); p_dvd = (thread_dvd_data_t*)(p_input->p_access_data);
i_angle = p_program->i_number; i_angle = p_program->i_number;
...@@ -342,7 +342,7 @@ static void DVDFlushStream( input_thread_t * p_input ) ...@@ -342,7 +342,7 @@ static void DVDFlushStream( input_thread_t * p_input )
{ {
input_DelES( p_input, p_input->stream.pp_es[0] ); input_DelES( p_input, p_input->stream.pp_es[0] );
} }
while( p_input->stream.i_pgrm_number ) while( p_input->stream.i_pgrm_number )
{ {
input_DelProgram( p_input, p_input->stream.pp_programs[0] ); input_DelProgram( p_input, p_input->stream.pp_programs[0] );
...@@ -367,7 +367,7 @@ static int DVDReadAngle( input_thread_t * p_input ) ...@@ -367,7 +367,7 @@ static int DVDReadAngle( input_thread_t * p_input )
p_dvd = (thread_dvd_data_t*)(p_input->p_access_data); p_dvd = (thread_dvd_data_t*)(p_input->p_access_data);
i_angle_nb = vmg.title_inf.p_attr[p_dvd->i_title-1].i_angle_nb; i_angle_nb = vmg.title_inf.p_attr[p_dvd->i_title-1].i_angle_nb;
input_AddProgram( p_input, 1, sizeof( stream_ps_data_t ) ); input_AddProgram( p_input, 1, sizeof( stream_ps_data_t ) );
p_input->stream.p_selected_program = p_input->stream.pp_programs[0]; p_input->stream.p_selected_program = p_input->stream.pp_programs[0];
...@@ -459,16 +459,16 @@ static int DVDSetArea( input_thread_t * p_input, input_area_t * p_area ) ...@@ -459,16 +459,16 @@ static int DVDSetArea( input_thread_t * p_input, input_area_t * p_area )
/* Destroy obsolete ES by reinitializing programs */ /* Destroy obsolete ES by reinitializing programs */
DVDFlushStream( p_input ); DVDFlushStream( p_input );
/* Angle management: angles are handled through programs */ /* Angle management: angles are handled through programs */
p_dvd->i_angle_nb = DVDReadAngle( p_input ); p_dvd->i_angle_nb = DVDReadAngle( p_input );
if( ( p_dvd->i_angle <= 0 ) || p_dvd->i_angle > p_dvd->i_angle_nb ) if( ( p_dvd->i_angle <= 0 ) || p_dvd->i_angle > p_dvd->i_angle_nb )
{ {
p_dvd->i_angle = 1; p_dvd->i_angle = 1;
} }
DVDSetProgram( p_input, DVDSetProgram( p_input,
p_input->stream.pp_programs[p_dvd->i_angle-1] ); p_input->stream.pp_programs[p_dvd->i_angle-1] );
msg_Dbg( p_input, "title first %i, last %i, size %i", msg_Dbg( p_input, "title first %i, last %i, size %i",
i_first, i_last, i_last + 1 - p_dvd->i_vts_lb ); i_first, i_last, i_last + 1 - p_dvd->i_vts_lb );
...@@ -481,7 +481,7 @@ static int DVDSetArea( input_thread_t * p_input, input_area_t * p_area ) ...@@ -481,7 +481,7 @@ static int DVDSetArea( input_thread_t * p_input, input_area_t * p_area )
DVDReadVideo( p_input ); DVDReadVideo( p_input );
DVDReadAudio( p_input ); DVDReadAudio( p_input );
DVDReadSPU ( p_input ); DVDReadSPU ( p_input );
if( p_input->p_demux ) if( p_input->p_demux )
{ {
DVDLaunchDecoders( p_input ); DVDLaunchDecoders( p_input );
...@@ -495,7 +495,7 @@ static int DVDSetArea( input_thread_t * p_input, input_area_t * p_area ) ...@@ -495,7 +495,7 @@ static int DVDSetArea( input_thread_t * p_input, input_area_t * p_area )
/* Chapter selection */ /* Chapter selection */
p_dvd->i_chapter = DVDSetChapter( p_dvd, p_area->i_part ); p_dvd->i_chapter = DVDSetChapter( p_dvd, p_area->i_part );
p_input->stream.p_selected_area->i_tell = DVDTell; p_input->stream.p_selected_area->i_tell = DVDTell;
/* warn interface that something has changed */ /* warn interface that something has changed */
...@@ -509,7 +509,7 @@ static int DVDSetArea( input_thread_t * p_input, input_area_t * p_area ) ...@@ -509,7 +509,7 @@ static int DVDSetArea( input_thread_t * p_input, input_area_t * p_area )
#define title \ #define title \
p_dvd->p_ifo->vts.title_unit.p_title[p_dvd->i_title_id-1].title p_dvd->p_ifo->vts.title_unit.p_title[p_dvd->i_title_id-1].title
/***************************************************************************** /*****************************************************************************
* DVDRead: reads data packets. * DVDRead: reads data packets.
***************************************************************************** *****************************************************************************
...@@ -596,7 +596,7 @@ static ssize_t DVDRead( input_thread_t * p_input, ...@@ -596,7 +596,7 @@ static ssize_t DVDRead( input_thread_t * p_input,
static void DVDSeek( input_thread_t * p_input, off_t i_off ) static void DVDSeek( input_thread_t * p_input, off_t i_off )
{ {
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);
vlc_mutex_lock( &p_input->stream.stream_lock ); vlc_mutex_lock( &p_input->stream.stream_lock );
...@@ -606,7 +606,7 @@ static void DVDSeek( input_thread_t * p_input, off_t i_off ) ...@@ -606,7 +606,7 @@ static void DVDSeek( input_thread_t * p_input, off_t i_off )
p_dvd->i_prg_cell = Lb2CellPrg( p_dvd ); p_dvd->i_prg_cell = Lb2CellPrg( p_dvd );
p_dvd->i_map_cell = Lb2CellMap( p_dvd ); p_dvd->i_map_cell = Lb2CellMap( p_dvd );
if( CellIsInterleaved( p_dvd ) ) if( CellIsInterleaved( p_dvd ) )
{ {
/* if we're inside a multi-angle zone, we have to choose i_sector /* if we're inside a multi-angle zone, we have to choose i_sector
...@@ -614,7 +614,7 @@ static void DVDSeek( input_thread_t * p_input, off_t i_off ) ...@@ -614,7 +614,7 @@ static void DVDSeek( input_thread_t * p_input, off_t i_off )
* can be very wide out of such zones */ * can be very wide out of such zones */
p_dvd->i_vts_lb = CellFirstSector( p_dvd ); p_dvd->i_vts_lb = CellFirstSector( p_dvd );
} }
p_dvd->i_last_lb = CellLastSector( p_dvd ); p_dvd->i_last_lb = CellLastSector( p_dvd );
p_dvd->i_chapter = CellPrg2Chapter( p_dvd ); p_dvd->i_chapter = CellPrg2Chapter( p_dvd );
...@@ -694,7 +694,7 @@ static char * DVDParse( input_thread_t * p_input ) ...@@ -694,7 +694,7 @@ static char * DVDParse( input_thread_t * p_input )
{ {
psz_parser++; psz_parser++;
} }
if( *psz_parser == '@' ) if( *psz_parser == '@' )
{ {
/* found end of raw device, and beginning of options */ /* found end of raw device, and beginning of options */
...@@ -766,8 +766,8 @@ static char * DVDParse( input_thread_t * p_input ) ...@@ -766,8 +766,8 @@ static char * DVDParse( input_thread_t * p_input )
else else
{ {
char * psz_env; char * psz_env;
#ifndef WIN32 #ifndef WIN32
if( !S_ISCHR(stat_info.st_mode) ) if( !S_ISCHR(stat_info.st_mode) )
{ {
msg_Warn( p_input, "raw device %s is" msg_Warn( p_input, "raw device %s is"
...@@ -791,11 +791,11 @@ static char * DVDParse( input_thread_t * p_input ) ...@@ -791,11 +791,11 @@ static char * DVDParse( input_thread_t * p_input )
psz_raw = ""; psz_raw = "";
} }
} }
if( !*psz_device ) if( !*psz_device )
{ {
free( psz_device ); free( psz_device );
if( !p_input->psz_access ) if( !p_input->psz_access )
{ {
/* no device and no access specified: we probably don't want DVD */ /* no device and no access specified: we probably don't want DVD */
...@@ -804,16 +804,16 @@ static char * DVDParse( input_thread_t * p_input ) ...@@ -804,16 +804,16 @@ static char * DVDParse( input_thread_t * p_input )
psz_device = config_GetPsz( p_input, "dvd" ); psz_device = config_GetPsz( p_input, "dvd" );
} }
#ifndef WIN32 #ifndef WIN32
/* check block device */ /* check block device */
if( stat( psz_device, &stat_info ) == -1 ) if( stat( psz_device, &stat_info ) == -1 )
{ {
msg_Err( p_input, "cannot stat() device `%s' (%s)", msg_Err( p_input, "cannot stat() device `%s' (%s)",
psz_device, strerror(errno)); psz_device, strerror(errno));
free( psz_device ); free( psz_device );
return NULL; return NULL;
} }
if( !S_ISBLK(stat_info.st_mode) && !S_ISCHR(stat_info.st_mode) ) if( !S_ISBLK(stat_info.st_mode) && !S_ISCHR(stat_info.st_mode) )
{ {
msg_Warn( p_input, msg_Warn( p_input,
...@@ -822,10 +822,10 @@ static char * DVDParse( input_thread_t * p_input ) ...@@ -822,10 +822,10 @@ static char * DVDParse( input_thread_t * p_input )
return NULL; return NULL;
} }
#endif #endif
msg_Dbg( p_input, "dvd=%s raw=%s title=%d chapter=%d angle=%d", msg_Dbg( p_input, "dvd=%s raw=%s title=%d chapter=%d angle=%d",
psz_device, psz_raw, p_dvd->i_title, psz_device, psz_raw, p_dvd->i_title,
p_dvd->i_chapter, p_dvd->i_angle ); p_dvd->i_chapter, p_dvd->i_angle );
return psz_device; return psz_device;
} }
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* dvd.h: thread structure of the DVD plugin * dvd.h: thread structure of the DVD plugin
***************************************************************************** *****************************************************************************
* Copyright (C) 1999-2001 VideoLAN * Copyright (C) 1999-2001 VideoLAN
* $Id: dvd.h,v 1.1 2002/08/04 17:23:41 sam Exp $ * $Id: dvd.h,v 1.2 2002/12/06 16:34:04 sam Exp $
* *
* Author: Stéphane Borel <stef@via.ecp.fr> * Author: Stéphane Borel <stef@via.ecp.fr>
* *
...@@ -36,27 +36,27 @@ typedef struct thread_dvd_data_s ...@@ -36,27 +36,27 @@ typedef struct thread_dvd_data_s
{ {
dvdcss_handle dvdhandle; /* libdvdcss handle */ dvdcss_handle dvdhandle; /* libdvdcss handle */
int i_audio_nb; unsigned int i_audio_nb;
int i_spu_nb; unsigned int i_spu_nb;
/* Navigation information */ /* Navigation information */
int i_title; unsigned int i_title;
int i_title_id; unsigned int i_title_id;
int i_chapter_nb; unsigned int i_chapter_nb;
int i_chapter; unsigned int i_chapter;
vlc_bool_t b_new_chapter; vlc_bool_t b_new_chapter;
int i_angle_nb; unsigned int i_angle_nb;
int i_angle; unsigned int i_angle;
int i_map_cell; /* cell index in adress map */ unsigned int i_map_cell; /* cell index in adress map */
int i_prg_cell; /* cell index in program map */ unsigned int i_prg_cell; /* cell index in program map */
int i_angle_cell; /* cell index in the current angle */ unsigned int i_angle_cell; /* cell index in the current angle */
int i_vts_start; /* offset to beginning of vts */ unsigned int i_vts_start; /* offset to beginning of vts */
int i_vts_lb; /* sector in vts */ unsigned int i_vts_lb; /* sector in vts */
int i_last_lb; /* last sector of current cell */ unsigned int i_last_lb; /* last sector of current cell */
/* Structure that contains all information of the DVD */ /* Structure that contains all information of the DVD */
struct ifo_s * p_ifo; struct ifo_s * p_ifo;
......
/* es.c: functions to find and select ES