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
# fi
#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_cv_c_Wall],
[CFLAGS="-Wall ${CFLAGS_save}"
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_cv_c_Wconversion],
[CFLAGS="-Wconversion ${CFLAGS_save}"
......@@ -495,17 +495,18 @@ AC_CACHE_CHECK([if \$CC accepts -Winline],
[CFLAGS="-Winline ${CFLAGS_save}"
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
CFLAGS_save="-Wall ${CFLAGS_save}"; CFLAGS="${CFLAGS_save}"
CXXFLAGS_save="-Wall ${CFLAGS_save}"; CXXFLAGS="${CXXFLAGS_save}"
OBJCFLAGS_save="-Wall ${OBJCFLAGS_save}"; OBJCFLAGS="${OBJCFLAGS_save}"
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
CFLAGS_save="-Wunreachable-code ${CFLAGS_save}"; CFLAGS="${CFLAGS_save}"
CXXFLAGS_save="-Wunreachable-code ${CFLAGS_save}"; CXXFLAGS="${CXXFLAGS_save}"
......
/*****************************************************************************
* input_ext-intf.h: structures of the input exported to the interface
* 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
* $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>
*
......@@ -12,7 +12,7 @@
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
......@@ -61,7 +61,7 @@ struct es_descriptor_t
/* PES parser information */
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_fifo_t * p_decoder_fifo;
......@@ -75,7 +75,7 @@ struct es_descriptor_t
#define PROGRAM_ASSOCIATION_TABLE_PID 0x0000
#define CONDITIONNAL_ACCESS_TABLE_PID 0x0001 /* not used */
#define EMPTY_ID 0xffff /* empty record in a table */
/* ES Categories to be used by interface plugins */
#define UNKNOWN_ES 0x00
......@@ -114,7 +114,7 @@ struct pgrm_descriptor_t
/* Demultiplexer 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 */
};
......@@ -131,7 +131,7 @@ struct pgrm_descriptor_t
struct input_area_t
{
/* 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_size; /* total size of the area
* (in arbitrary units) */
......@@ -143,8 +143,8 @@ struct input_area_t
* (changed by the interface thread */
/* area subdivision */
int i_part_nb; /* number of parts (chapter for DVD)*/
int i_part; /* currently selected part */
unsigned int i_part_nb; /* number of parts (chapter for DVD)*/
unsigned int i_part; /* currently selected part */
/* offset to plugin related data */
......@@ -168,7 +168,7 @@ struct input_info_t {
* Value of this item
*/
char * psz_value;
/**
* Pointer to next item in list, or NULL it at end of list
*/
......@@ -188,12 +188,12 @@ struct input_info_category_t {
* The name of this category
*/
char * psz_name;
/**
* first element of a linked list containing info items
*/
input_info_t * p_info;
/**
* Pointer to next element in this list, or NULL if at end of list
*/
......@@ -215,13 +215,13 @@ struct stream_descriptor_t
* or modify stream, pgrm or es */
/* Input method data */
int i_method; /* input method for stream: file,
unsigned int i_method; /* input method for stream: file,
disc or network */
vlc_bool_t b_pace_control; /* can we read when we want ? */
vlc_bool_t b_seekable; /* can we do lseek() ? */
/* if (b_seekable) : */
int i_area_nb;
unsigned int i_area_nb;
input_area_t ** pp_areas; /* list of areas in stream == offset
* interval with own properties */
input_area_t * p_selected_area;
......@@ -232,7 +232,7 @@ struct stream_descriptor_t
* units of 50 bytes/s) ; 0 if undef */
/* 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 */
vlc_cond_t stream_wait; /* interface -> input in case of a
* status change request */
......@@ -241,20 +241,20 @@ struct stream_descriptor_t
stream_sys_t * p_demux_data;
/* 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 * p_selected_program; /* currently
pgrm_descriptor_t * p_selected_program; /* currently
selected program */
pgrm_descriptor_t * p_new_program; /* Newly selected program */
/* ES descriptions */
int i_es_number;
unsigned int i_es_number;
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 * p_newly_selected_es; /* ES selected from
* the interface */
es_descriptor_t * p_removed_es; /* ES removed from the interface */
/* Stream control */
stream_ctrl_t control;
......@@ -263,7 +263,7 @@ struct stream_descriptor_t
/* Input info */
input_info_category_t * p_info;
/* Statistics */
count_t c_packets_read; /* packets read */
count_t c_packets_trashed; /* trashed packets */
......
......@@ -8,7 +8,7 @@
* -udf.* to find files
*****************************************************************************
* 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>
*
......@@ -16,7 +16,7 @@
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
......@@ -104,7 +104,7 @@ int E_(DVDOpen) ( vlc_object_t *p_this )
return -1;
}
p_input->p_access_data = (void *)p_dvd;
p_input->pf_read = DVDRead;
p_input->pf_seek = DVDSeek;
p_input->pf_set_area = DVDSetArea;
......@@ -116,10 +116,10 @@ int E_(DVDOpen) ( vlc_object_t *p_this )
free( p_dvd );
return -1;
}
/*
/*
* set up input
*/
*/
p_input->i_mtu = 0;
/* override environment variable DVDCSS_METHOD with config option
......@@ -146,9 +146,9 @@ int E_(DVDOpen) ( vlc_object_t *p_this )
/*
* get plugin ready
*/
*/
p_dvd->dvdhandle = dvdcss_open( psz_device );
/* free allocated string */
free( psz_device );
......@@ -210,7 +210,7 @@ int E_(DVDOpen) ( vlc_object_t *p_this )
/* Titles are Program Chains */
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
* first call to DVDSetArea */
area[i]->i_start = 0;
......@@ -223,23 +223,23 @@ int E_(DVDOpen) ( vlc_object_t *p_this )
/* Offset to vts_i_0.ifo */
area[i]->i_plugin_data = p_dvd->p_ifo->i_start +
title_inf.p_attr[i-1].i_start_sector;
}
}
#undef area
p_dvd->i_title = p_dvd->i_title <= title_inf.i_title_nb ?
p_dvd->i_title : 1;
#undef title_inf
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_dvd->i_chapter : 1;
p_dvd->i_chapter = 1;
p_dvd->b_new_chapter = 0;
p_dvd->i_audio_nb = 0;
p_dvd->i_spu_nb = 0;
/* set title, chapter, audio and subpic */
if( DVDSetArea( p_input, p_area ) < 0 )
{
......@@ -277,13 +277,13 @@ void E_(DVDClose) ( vlc_object_t *p_this )
* DVDSetProgram: used to change angle
*****************************************************************************/
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 )
{
thread_dvd_data_t * p_dvd;
int i_angle;
p_dvd = (thread_dvd_data_t*)(p_input->p_access_data);
i_angle = p_program->i_number;
......@@ -342,7 +342,7 @@ static void DVDFlushStream( input_thread_t * p_input )
{
input_DelES( p_input, p_input->stream.pp_es[0] );
}
while( p_input->stream.i_pgrm_number )
{
input_DelProgram( p_input, p_input->stream.pp_programs[0] );
......@@ -367,7 +367,7 @@ static int DVDReadAngle( input_thread_t * p_input )
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;
input_AddProgram( p_input, 1, sizeof( stream_ps_data_t ) );
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 )
/* Destroy obsolete ES by reinitializing programs */
DVDFlushStream( p_input );
/* Angle management: angles are handled through programs */
p_dvd->i_angle_nb = DVDReadAngle( p_input );
if( ( p_dvd->i_angle <= 0 ) || p_dvd->i_angle > p_dvd->i_angle_nb )
{
p_dvd->i_angle = 1;
}
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",
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 )
DVDReadVideo( p_input );
DVDReadAudio( p_input );
DVDReadSPU ( p_input );
if( p_input->p_demux )
{
DVDLaunchDecoders( p_input );
......@@ -495,7 +495,7 @@ static int DVDSetArea( input_thread_t * p_input, input_area_t * p_area )
/* Chapter selection */
p_dvd->i_chapter = DVDSetChapter( p_dvd, p_area->i_part );
p_input->stream.p_selected_area->i_tell = DVDTell;
/* warn interface that something has changed */
......@@ -509,7 +509,7 @@ static int DVDSetArea( input_thread_t * p_input, input_area_t * p_area )
#define title \
p_dvd->p_ifo->vts.title_unit.p_title[p_dvd->i_title_id-1].title
/*****************************************************************************
* DVDRead: reads data packets.
*****************************************************************************
......@@ -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 )
{
thread_dvd_data_t * p_dvd;
p_dvd = ( thread_dvd_data_t * )(p_input->p_access_data);
vlc_mutex_lock( &p_input->stream.stream_lock );
......@@ -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_map_cell = Lb2CellMap( p_dvd );
if( CellIsInterleaved( p_dvd ) )
{
/* 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 )
* can be very wide out of such zones */
p_dvd->i_vts_lb = CellFirstSector( p_dvd );
}
p_dvd->i_last_lb = CellLastSector( p_dvd );
p_dvd->i_chapter = CellPrg2Chapter( p_dvd );
......@@ -694,7 +694,7 @@ static char * DVDParse( input_thread_t * p_input )
{
psz_parser++;
}
if( *psz_parser == '@' )
{
/* found end of raw device, and beginning of options */
......@@ -766,8 +766,8 @@ static char * DVDParse( input_thread_t * p_input )
else
{
char * psz_env;
#ifndef WIN32
#ifndef WIN32
if( !S_ISCHR(stat_info.st_mode) )
{
msg_Warn( p_input, "raw device %s is"
......@@ -791,11 +791,11 @@ static char * DVDParse( input_thread_t * p_input )
psz_raw = "";
}
}
if( !*psz_device )
{
free( psz_device );
if( !p_input->psz_access )
{
/* no device and no access specified: we probably don't want DVD */
......@@ -804,16 +804,16 @@ static char * DVDParse( input_thread_t * p_input )
psz_device = config_GetPsz( p_input, "dvd" );
}
#ifndef WIN32
#ifndef WIN32
/* check block device */
if( stat( psz_device, &stat_info ) == -1 )
{
msg_Err( p_input, "cannot stat() device `%s' (%s)",
psz_device, strerror(errno));
free( psz_device );
return NULL;
return NULL;
}
if( !S_ISBLK(stat_info.st_mode) && !S_ISCHR(stat_info.st_mode) )
{
msg_Warn( p_input,
......@@ -822,10 +822,10 @@ static char * DVDParse( input_thread_t * p_input )
return NULL;
}
#endif
msg_Dbg( p_input, "dvd=%s raw=%s title=%d chapter=%d angle=%d",
psz_device, psz_raw, p_dvd->i_title,
p_dvd->i_chapter, p_dvd->i_angle );
return psz_device;
}
}
......@@ -2,7 +2,7 @@
* dvd.h: thread structure of the DVD plugin
*****************************************************************************
* 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>
*
......@@ -36,27 +36,27 @@ typedef struct thread_dvd_data_s
{
dvdcss_handle dvdhandle; /* libdvdcss handle */
int i_audio_nb;
int i_spu_nb;
unsigned int i_audio_nb;
unsigned int i_spu_nb;
/* Navigation information */
int i_title;
int i_title_id;
unsigned int i_title;
unsigned int i_title_id;
int i_chapter_nb;
int i_chapter;
unsigned int i_chapter_nb;
unsigned int i_chapter;
vlc_bool_t b_new_chapter;
int i_angle_nb;
int i_angle;
unsigned int i_angle_nb;
unsigned int i_angle;
int i_map_cell; /* cell index in adress map */
int i_prg_cell; /* cell index in program map */
int i_angle_cell; /* cell index in the current angle */
unsigned int i_map_cell; /* cell index in adress map */
unsigned int i_prg_cell; /* cell index in program map */
unsigned int i_angle_cell; /* cell index in the current angle */
int i_vts_start; /* offset to beginning of vts */
int i_vts_lb; /* sector in vts */
int i_last_lb; /* last sector of current cell */
unsigned int i_vts_start; /* offset to beginning of vts */
unsigned int i_vts_lb; /* sector in vts */
unsigned int i_last_lb; /* last sector of current cell */
/* Structure that contains all information of the DVD */
struct ifo_s * p_ifo;
......
/* es.c: functions to find and select ES
*****************************************************************************
* Copyright (C) 1998-2001 VideoLAN
* $Id: es.c,v 1.3 2002/11/05 18:25:43 gbazin Exp $
* $Id: es.c,v 1.4 2002/12/06 16:34:04 sam Exp $
*
* Author: Stphane Borel <stef@via.ecp.fr>
*
......@@ -9,7 +9,7 @@
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
......@@ -91,7 +91,7 @@ void DVDReadVideo( input_thread_t * p_input )
/* ES 0 -> video MPEG2 */
IfoPrintVideo( p_dvd );
i_ratio = vts.manager_inf.video_attr.i_ratio;
if( i_ratio )
{
ADDES( 0xe0, 0, VLC_FOURCC('m','p','g','v'), VIDEO_ES, 0, sizeof(int) );
......@@ -101,7 +101,7 @@ void DVDReadVideo( input_thread_t * p_input )
{
ADDES( 0xe0, 0, VLC_FOURCC('m','p','g','v'), VIDEO_ES, 0, 0 );
}
}
/*****************************************************************************
......@@ -109,7 +109,7 @@ void DVDReadVideo( input_thread_t * p_input )
*****************************************************************************/
#define audio_status \
vts.title_unit.p_title[p_dvd->i_title_id-1].title.pi_audio_status[i-1]
void DVDReadAudio( input_thread_t * p_input )
{
thread_dvd_data_t * p_dvd;
......@@ -120,7 +120,7 @@ void DVDReadAudio( input_thread_t * p_input )
p_dvd = (thread_dvd_data_t*)(p_input->p_access_data);
p_dvd->i_audio_nb = 0;
/* Audio ES, in the order they appear in .ifo */
for( i = 1 ; i <= vts.manager_inf.i_audio_nb ; i++ )
{
......@@ -184,7 +184,7 @@ void DVDReadSPU( input_thread_t * p_input )
es_descriptor_t * p_es;
int i_id;
int i;
p_dvd = (thread_dvd_data_t*)(p_input->p_access_data);
p_dvd->i_spu_nb = 0;
......@@ -226,7 +226,7 @@ void DVDReadSPU( input_thread_t * p_input )
sizeof(int) + 16*sizeof(u32) );
*(int*)p_es->p_demux_data = 0xBeeF;
memcpy( (char*)p_es->p_demux_data + sizeof(int),
palette, 16*sizeof(u32) );
palette, 16*sizeof(u32) );
}
else
{
......@@ -248,8 +248,8 @@ void DVDReadSPU( input_thread_t * p_input )
void DVDLaunchDecoders( input_thread_t * p_input )
{
thread_dvd_data_t * p_dvd;
int i_audio;
int i_spu;
unsigned int i_audio;
unsigned int i_spu;
p_dvd = (thread_dvd_data_t*)(p_input->p_access_data);
......@@ -266,7 +266,7 @@ void DVDLaunchDecoders( input_thread_t * p_input )
config_PutInt( p_input, "audio-channel", 1 );
i_audio = 1;
}
if( ( config_GetInt( p_input, "audio-type" )
== REQUESTED_A52 ) )
{
......@@ -303,7 +303,7 @@ void DVDLaunchDecoders( input_thread_t * p_input )
}
if( i_spu > 0 )
{
int i = 0, j = 0;
unsigned int i = 0, j = 0;
for( i = 0; i < p_input->stream.i_es_number; i++ )
{
if ( p_input->stream.pp_es[i]->i_fourcc
......
/* seek.c: functions to navigate through DVD.
*****************************************************************************
* Copyright (C) 1998-2001 VideoLAN
* $Id: seek.c,v 1.2 2002/08/08 00:35:10 sam Exp $
* $Id: seek.c,v 1.3 2002/12/06 16:34:04 sam Exp $
*
* Author: Stphane Borel <stef@via.ecp.fr>
*
......@@ -9,7 +9,7 @@
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
......@@ -82,24 +82,24 @@ int CellPrg2Map( thread_dvd_data_t * p_dvd )
{
i_cell++;
}
if( i_cell >= cell.i_cell_nb )
{
return -1;
}
return i_cell;
return i_cell;
}
int CellAngleOffset( thread_dvd_data_t * p_dvd, int i_prg_cell )
{
int i_cell_off;
if( i_prg_cell >= title.i_cell_nb )
{
return 0;
}
/* basic handling of angles */
switch( ( ( title.p_cell_play[i_prg_cell].i_category & 0xf000 )
>> 12 ) )
......@@ -126,7 +126,7 @@ int CellFirstSector( thread_dvd_data_t * p_dvd )
return __MAX( cell.p_cell_map[p_dvd->i_map_cell].i_first_sector,
title.p_cell_play[p_dvd->i_prg_cell].i_first_sector );
}
int CellLastSector( thread_dvd_data_t * p_dvd )
{
return __MIN( cell.p_cell_map[p_dvd->i_map_cell].i_last_sector,
......@@ -135,8 +135,8 @@ int CellLastSector( thread_dvd_data_t * p_dvd )
int NextCellPrg( thread_dvd_data_t * p_dvd )
{
int i_cell = p_dvd->i_prg_cell;
unsigned int i_cell = p_dvd->i_prg_cell;
if( p_dvd->i_vts_lb > title.p_cell_play[i_cell].i_last_sector )
{
i_cell ++;
......@@ -147,14 +147,14 @@ int NextCellPrg( thread_dvd_data_t * p_dvd )
return -1;
}
}
return i_cell;
}
int Lb2CellPrg( thread_dvd_data_t * p_dvd )
{
int i_cell = 0;
unsigned int i_cell = 0;
while( p_dvd->i_vts_lb > title.p_cell_play[i_cell].i_last_sector )
{
i_cell ++;
......@@ -165,14 +165,14 @@ int Lb2CellPrg( thread_dvd_data_t * p_dvd )
return -1;
}
}
return i_cell;
}
int Lb2CellMap( thread_dvd_data_t * p_dvd )
{
int i_cell = 0;
while( p_dvd->i_vts_lb > cell.p_cell_map[i_cell].i_last_sector )
{
i_cell ++;
......@@ -182,7 +182,7 @@ int Lb2CellMap( thread_dvd_data_t * p_dvd )
return -1;
}
}
return i_cell;
}
......@@ -211,7 +211,7 @@ int LbMaxOnce( thread_dvd_data_t * p_dvd )
p_dvd->i_vts_lb = CellFirstSector( p_dvd );
p_dvd->i_last_lb = CellLastSector( p_dvd );
p_dvd->i_chapter = NextChapter( p_dvd );
if( p_dvd->i_chapter < 0 )
{
......@@ -239,14 +239,14 @@ int LbMaxOnce( thread_dvd_data_t * p_dvd )
int CellPrg2Chapter( thread_dvd_data_t * p_dvd )
{
int i_chapter = 1;
int i_cell = p_dvd->i_prg_cell;
unsigned int i_chapter = 1;
unsigned int i_cell = p_dvd->i_prg_cell;
if( CellIsInterleaved( p_dvd ) )
{
i_cell -= (p_dvd->i_angle - 1);
}
while( title.chapter_map.pi_start_cell[i_chapter] <= i_cell+1 )
{
i_chapter ++;
......@@ -262,12 +262,12 @@ int CellPrg2Chapter( thread_dvd_data_t * p_dvd )
int NextChapter( thread_dvd_data_t * p_dvd )
{
int i_cell = p_dvd->i_prg_cell;
if( CellIsInterleaved( p_dvd ) )
{
i_cell -= (p_dvd->i_angle - 1);
}
if( title.chapter_map.pi_start_cell[p_dvd->i_chapter] <= i_cell+1 )
{
p_dvd->i_chapter++;
......@@ -285,13 +285,13 @@ int NextChapter( thread_dvd_data_t * p_dvd )
int DVDSetChapter( thread_dvd_data_t * p_dvd, int i_chapter )
int DVDSetChapter( thread_dvd_data_t * p_dvd, unsigned int i_chapter )
{
if( i_chapter <= 0 || i_chapter > p_dvd->i_chapter_nb )
{
i_chapter = 1;
}
if( p_dvd->i_chapter != i_chapter )
{
/* Find cell index in Program chain for current chapter */
......@@ -315,13 +315,13 @@ int DVDSetChapter( thread_dvd_data_t * p_dvd, int i_chapter )
#endif
return -1;
}
#if 0
intf_WarnMsg( 4, "dvd info: chapter %d prg_cell %d map_cell %d",
i_chapter, p_dvd->i_prg_cell, p_dvd->i_map_cell );
#endif
}
return i_chapter;
}
......
/* dvd_seek.h: DVD access plugin.
*****************************************************************************
* Copyright (C) 1998-2001 VideoLAN
* $Id: seek.h,v 1.1 2002/08/04 17:23:41 sam Exp $
* $Id: seek.h,v 1.2 2002/12/06 16:34:04 sam Exp $
*
* Author: Stphane Borel <stef@via.ecp.fr>
*
......@@ -9,7 +9,7 @@
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
......@@ -33,5 +33,5 @@ int LbMaxOnce ( thread_dvd_data_t * );
int CellPrg2Chapter ( thread_dvd_data_t * );
int NextChapter ( thread_dvd_data_t * );
int DVDSetChapter ( thread_dvd_data_t *, int );
int DVDSetChapter ( thread_dvd_data_t *, unsigned int );
This diff is collapsed.
......@@ -2,7 +2,7 @@
* access.c: access capabilities for dvdplay plugin.
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* $Id: access.c,v 1.6 2002/11/13 20:23:21 fenrir Exp $
* $Id: access.c,v 1.7 2002/12/06 16:34:04 sam Exp $
*
* Author: Stphane Borel <stef@via.ecp.fr>
*
......@@ -10,7 +10,7 @@
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
......@@ -78,12 +78,12 @@ int E_(OpenDVD) ( vlc_object_t *p_this )
char * psz_source;
dvd_data_t * p_dvd;
input_area_t * p_area;
int i_title_nr;
int i_title;
int i_chapter;
int i_angle;
int i;
unsigned int i_title_nr;
unsigned int i_title;
unsigned int i_chapter;
unsigned int i_angle;
unsigned int i;
p_dvd = malloc( sizeof(dvd_data_t) );
if( p_dvd == NULL )
{
......@@ -99,7 +99,7 @@ int E_(OpenDVD) ( vlc_object_t *p_this )
p_input->pf_set_program = dvdplay_SetProgram;
/* command line */
if( ( psz_source = dvdplay_ParseCL( p_input,
if( ( psz_source = dvdplay_ParseCL( p_input,
&i_title, &i_chapter, &i_angle ) ) == NULL )
{
free( p_dvd );
......@@ -122,7 +122,7 @@ int E_(OpenDVD) ( vlc_object_t *p_this )
p_dvd->p_intf = NULL;
p_dvd->i_still_time = 0;
/* set up input */
p_input->i_mtu = 0;
......@@ -133,7 +133,7 @@ int E_(OpenDVD) ( vlc_object_t *p_this )
p_input->stream.b_pace_control = 1;
/* seek is only allowed when we have size info */
p_input->stream.b_seekable = 0;
/* Initialize ES structures */
input_InitStream( p_input, sizeof( stream_ps_data_t ) );
......@@ -145,11 +145,11 @@ int E_(OpenDVD) ( vlc_object_t *p_this )
/* Area 0 for menu */
area[0]->i_plugin_data = 0;
for( i = 1 ; i <= i_title_nr ; i++ )
{
input_AddArea( p_input );
/* Titles id */
area[i]->i_id = i;
......@@ -173,7 +173,7 @@ int E_(OpenDVD) ( vlc_object_t *p_this )
vlc_mutex_unlock( &p_input->stream.stream_lock );
return -1;
}
if( i_angle <= p_input->stream.i_pgrm_number )
{
dvdplay_SetProgram( p_input,
......@@ -242,7 +242,7 @@ static int dvdplay_SetProgram( input_thread_t * p_input,
{
dvd_data_t * p_dvd;
int i_angle;
p_dvd = (dvd_data_t*)(p_input->p_access_data);
i_angle = p_program->i_number;
......@@ -279,17 +279,17 @@ static int dvdplay_SetArea( input_thread_t * p_input, input_area_t * p_area )
if( p_area != p_input->stream.p_selected_area )
{
int i_chapter;
/* prevent intf to try to seek */
p_input->stream.b_seekable = 0;
/* Store selected chapter */
i_chapter = p_area->i_part;
dvdNewArea( p_input, p_area );
dvdplay_start( p_dvd->vmg, p_area->i_id );
p_area->i_part = i_chapter;
} /* i_title >= 0 */
else
......@@ -350,7 +350,7 @@ static int dvdplay_Read( input_thread_t * p_input,
static void dvdplay_Seek( input_thread_t * p_input, off_t i_off )
{
dvd_data_t * p_dvd;
p_dvd = (dvd_data_t *)p_input->p_access_data;
vlc_mutex_lock( &p_input->stream.stream_lock );
......@@ -377,11 +377,11 @@ static void pf_vmg_callback( void* p_args, dvdplay_event_t event )
input_thread_t * p_input;
dvd_data_t * p_dvd;
vlc_value_t val;
int i;
unsigned int i;
p_input = (input_thread_t*)p_args;
p_dvd = (dvd_data_t*)p_input->p_access_data;
switch( event )
{
case NEW_DOMAIN:
......@@ -395,8 +395,8 @@ static void pf_vmg_callback( void* p_args, dvdplay_event_t event )
/* prevent intf to try to seek by default */
p_input->stream.b_seekable = 0;
if( ( i = dvdplay_title_cur( p_dvd->vmg ) ) !=
p_input->stream.p_selected_area->i_id )
i = dvdplay_title_cur( p_dvd->vmg );
if( i != p_input->stream.p_selected_area->i_id )
{
/* the title number has changed: update area */
msg_Warn( p_input, "new title %d (%d)", i,
......@@ -407,7 +407,7 @@ static void pf_vmg_callback( void* p_args, dvdplay_event_t event )
/* new pgc in same title: reinit ES */
dvdNewPGC( p_input );
p_input->stream.b_changed = 1;
break;
......@@ -497,9 +497,9 @@ static int dvdNewArea( input_thread_t * p_input, input_area_t * p_area )
{
input_AddProgram( p_input, i+1, 0 );
}
dvdplay_SetProgram( p_input,
p_input->stream.pp_programs[i_angle-1] );
p_input->stream.pp_programs[i_angle-1] );
// dvdNewPGC( p_input );
......@@ -517,7 +517,7 @@ static int dvdNewPGC( input_thread_t * p_input )
// int i_subp_nr = -1;
// int i_subp = -1;
// int i_sec;
p_dvd = (dvd_data_t*)p_input->p_access_data;
// dvdplay_audio_info( p_dvd->vmg, &i_audio_nr, &i_audio );
......@@ -539,7 +539,7 @@ static int dvdNewPGC( input_thread_t * p_input )
{
p_input->stream.b_seekable = 0;
}
#if 0
i_sec = dvdplay_title_time( p_dvd->vmg );
msg_Dbg( p_input, "title time: %d:%02d:%02d (%d)",
......
......@@ -2,7 +2,7 @@
* rtp.c: RTP access plug-in
*****************************************************************************
* Copyright (C) 2001, 2002 VideoLAN
* $Id: rtp.c,v 1.6 2002/11/13 20:23:21 fenrir Exp $
* $Id: rtp.c,v 1.7 2002/12/06 16:34:04 sam Exp $
*
* Authors: Tristan Leteurtre <tooney@via.ecp.fr>
*
......@@ -10,7 +10,7 @@
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
......@@ -236,7 +236,7 @@ static int Open( vlc_object_t *p_this )
i_server_port = 0;
psz_server_addr = "";
}
msg_Dbg( p_input, "opening server=%s:%d local=%s:%d",
psz_server_addr, i_server_port, psz_bind_addr, i_bind_port );
......@@ -256,7 +256,7 @@ static int Open( vlc_object_t *p_this )
return( -1 );
}
module_Unneed( p_input, p_network );
p_access_data = malloc( sizeof(input_socket_t) );
p_input->p_access_data = (access_sys_t *)p_access_data;
......@@ -272,7 +272,7 @@ static int Open( vlc_object_t *p_this )
{
p_input->psz_demux = "ts";
}
return( 0 );
}
......@@ -301,12 +301,12 @@ static void Close( vlc_object_t *p_this )
* RTPNetworkRead : Read for the network, and parses the RTP header
*****************************************************************************/
static ssize_t RTPNetworkRead( input_thread_t * p_input, byte_t * p_buffer,
size_t i_len )
size_t i_len )
{
int i_rtp_version;
int i_CSRC_count;
int i_payload_type;
byte_t * p_tmp_buffer = alloca( p_input->i_mtu );
/* Get the raw data from the socket.
......@@ -314,35 +314,35 @@ static ssize_t RTPNetworkRead( input_thread_t * p_input, byte_t * p_buffer,
ssize_t i_ret = Read( p_input, p_tmp_buffer, p_input->i_mtu );
if (!i_ret) return 0;
/* Parse the header and make some verifications.
* See RFC 1889 & RFC 2250. */
i_rtp_version = ( p_tmp_buffer[0] & 0xC0 ) >> 6;
i_CSRC_count = ( p_tmp_buffer[0] & 0x0F );
i_payload_type = ( p_tmp_buffer[1] & 0x7F );
if ( i_rtp_version != 2 )
i_payload_type = ( p_tmp_buffer[1] & 0x7F );
if ( i_rtp_version != 2 )
msg_Dbg( p_input, "RTP version is %u, should be 2", i_rtp_version );
if ( i_payload_type != 33 )
msg_Dbg( p_input, "RTP payload type is %u, only 33 (Mpeg2-TS) " \
"is supported", i_payload_type );
/* Return the packet without the RTP header. */
i_ret -= ( RTP_HEADER_LEN + 4 * i_CSRC_count );
if ( i_ret > i_len )
if ( (size_t)i_ret > i_len )
{
/* This should NOT happen. */
msg_Warn( p_input, "RTP input trashing %d bytes", i_ret - i_len );
i_ret = i_len;
}
p_input->p_vlc->pf_memcpy( p_buffer,
p_input->p_vlc->pf_memcpy( p_buffer,
p_tmp_buffer + RTP_HEADER_LEN + 4 * i_CSRC_count,
i_ret );
return i_ret;
}
......
......@@ -2,7 +2,7 @@
* vcd.c : VCD input module for vlc
*****************************************************************************
* Copyright (C) 2000 VideoLAN
* $Id: vcd.c,v 1.11 2002/11/13 20:23:21 fenrir Exp $
* $Id: vcd.c,v 1.12 2002/12/06 16:34:04 sam Exp $
*
* Author: Johan Bilien <jobi@via.ecp.fr>
*
......@@ -436,8 +436,8 @@ static int VCDSetArea( input_thread_t * p_input, input_area_t * p_area )
****************************************************************************/
static void VCDSeek( input_thread_t * p_input, off_t i_off )
{
thread_vcd_data_t * p_vcd;
int i_index;
thread_vcd_data_t * p_vcd;
unsigned int i_index;
p_vcd = (thread_vcd_data_t *) p_input->p_access_data;
......
......@@ -2,7 +2,7 @@
* a52tospdif.c : encapsulates A/52 frames into S/PDIF packets
*****************************************************************************
* Copyright (C) 2002 VideoLAN
* $Id: a52tospdif.c,v 1.15 2002/11/28 23:24:14 massiot Exp $
* $Id: a52tospdif.c,v 1.16 2002/12/06 16:34:04 sam Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
* Stphane Borel <stef@via.ecp.fr>
......@@ -85,15 +85,15 @@ static void DoWork( aout_instance_t * p_aout, aout_filter_t * p_filter,
* endian.
*/
static const u8 p_sync[6] = { 0x72, 0xF8, 0x1F, 0x4E, 0x01, 0x00 };
static const uint8_t p_sync[6] = { 0x72, 0xF8, 0x1F, 0x4E, 0x01, 0x00 };
#ifndef HAVE_SWAB
u16 i;
byte_t * p_tmp;
uint16_t i;
#endif
u16 i_length = p_in_buf->i_nb_bytes;
u8 * pi_length;
uint16_t i_length = p_in_buf->i_nb_bytes;
uint8_t * pi_length;
byte_t * p_in = p_in_buf->p_buffer;
byte_t * p_out = p_out_buf->p_buffer;
byte_t * p_tmp;
/* Copy the S/PDIF headers. */
memcpy( p_out, p_sync, 6 );
......
......@@ -2,7 +2,7 @@
* ugly.c : ugly resampler (changes pitch)
*****************************************************************************
* Copyright (C) 2002 VideoLAN
* $Id: ugly.c,v 1.7 2002/11/20 16:43:32 sam Exp $
* $Id: ugly.c,v 1.8 2002/12/06 16:34:04 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
......@@ -82,12 +82,12 @@ static void DoWork( aout_instance_t * p_aout, aout_filter_t * p_filter,
int32_t* p_in = (int32_t*)p_in_buf->p_buffer;
int32_t* p_out = (int32_t*)p_out_buf->p_buffer;
int i_nb_channels = aout_FormatNbChannels( &p_filter->input );
int i_in_nb = p_in_buf->i_nb_samples;
int i_out_nb = i_in_nb * p_filter->output.i_rate
/ p_filter->input.i_rate;
int i_sample_bytes = i_nb_channels * sizeof(int32_t);
int i_out, i_chan, i_remainder = 0;
unsigned int i_nb_channels = aout_FormatNbChannels( &p_filter->input );
unsigned int i_in_nb = p_in_buf->i_nb_samples;
unsigned int i_out_nb = i_in_nb * p_filter->output.i_rate
/ p_filter->input.i_rate;
unsigned int i_sample_bytes = i_nb_channels * sizeof(int32_t);
unsigned int i_out, i_chan, i_remainder = 0;
for( i_out = i_out_nb ; i_out-- ; )
{
......
......@@ -2,7 +2,7 @@
* oss.c : OSS /dev/dsp module for vlc
*****************************************************************************
* Copyright (C) 2000-2002 VideoLAN
* $Id: oss.c,v 1.34 2002/11/21 15:51:57 gbazin Exp $
* $Id: oss.c,v 1.35 2002/12/06 16:34:04 sam Exp $
*
* Authors: Michel Kaempf <maxx@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org>
......@@ -325,10 +325,10 @@ static int Open( vlc_object_t *p_this )
if ( !AOUT_FMT_NON_LINEAR( &p_aout->output.output ) )
{
int i_format = AFMT_S16_NE;
int i_frame_size, i_fragments;
int i_rate;
int i_nb_channels;
unsigned int i_format = AFMT_S16_NE;
unsigned int i_frame_size, i_fragments;
unsigned int i_rate;
unsigned int i_nb_channels;
audio_buf_info audio_buf;
if( ioctl( p_sys->i_fd, SNDCTL_DSP_SETFMT, &i_format ) < 0 )
......
......@@ -2,7 +2,7 @@
* a52.c: A/52 basic parser
*****************************************************************************
* Copyright (C) 2001-2002 VideoLAN
* $Id: a52.c,v 1.18 2002/11/14 22:38:47 massiot Exp $
* $Id: a52.c,v 1.19 2002/12/06 16:34:05 sam Exp $
*
* Authors: Stphane Borel <stef@via.ecp.fr>
* Christophe Massiot <massiot@via.ecp.fr>
......@@ -13,7 +13,7 @@
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
......@@ -86,14 +86,14 @@ vlc_module_end();
/*****************************************************************************
* OpenDecoder: probe the decoder and return score
*****************************************************************************/
static int OpenDecoder( vlc_object_t *p_this )
{
static int OpenDecoder( vlc_object_t *p_this )
{
decoder_fifo_t *p_fifo = (decoder_fifo_t*) p_this;
if( p_fifo->i_fourcc != VLC_FOURCC('a','5','2',' ')
&& p_fifo->i_fourcc != VLC_FOURCC('a','5','2','b') )
{
return VLC_EGENERIC;
{
return VLC_EGENERIC;
}
p_fifo->pf_run = RunDecoder;
......@@ -109,7 +109,7 @@ static int RunDecoder( decoder_fifo_t *p_fifo )
{
dec_thread_t * p_dec;
audio_date_t end_date;
/* Allocate the memory needed to store the thread's structure */
p_dec = malloc( sizeof(dec_thread_t) );
if( p_dec == NULL )
......@@ -140,14 +140,15 @@ static int RunDecoder( decoder_fifo_t *p_fifo )
/* decoder thread's main loop */
while ( !p_dec->p_fifo->b_die && !p_dec->p_fifo->b_error )
{
int i_frame_size, i_original_channels, i_rate, i_bit_rate;
int i_bit_rate;
unsigned int i_rate, i_original_channels, i_frame_size;
mtime_t pts;
byte_t p_header[7];
aout_buffer_t * p_buffer;
/* Look for sync word - should be 0x0b77 */
RealignBits( &p_dec->bit_stream );
while ( (ShowBits( &p_dec->bit_stream, 16 ) ) != 0x0b77 &&
while ( (ShowBits( &p_dec->bit_stream, 16 ) ) != 0x0b77 &&
(!p_dec->p_fifo->b_die) && (!p_dec->p_fifo->b_error))
{
RemoveBits( &p_dec->bit_stream, 8 );
......@@ -245,7 +246,7 @@ static int RunDecoder( decoder_fifo_t *p_fifo )
/* End of the spdif decoder thread */
EndThread( p_dec );
return 0;
}
......@@ -270,14 +271,15 @@ static void EndThread( dec_thread_t * p_dec )
* since we don't want to oblige S/PDIF people to use liba52 just to get
* their SyncInfo...
*****************************************************************************/
int SyncInfo( const byte_t * p_buf, int * pi_channels, int * pi_sample_rate,
int * pi_bit_rate)
static int SyncInfo( const byte_t * p_buf, int * pi_channels,
int * pi_sample_rate, int * pi_bit_rate )
{
static const u8 halfrate[12] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3};
static const uint8_t halfrate[12] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3 };
static const int rate[] = { 32, 40, 48, 56, 64, 80, 96, 112,
128, 160, 192, 224, 256, 320, 384, 448,
512, 576, 640};
static const u8 lfeon[8] = {0x10, 0x10, 0x04, 0x04, 0x04, 0x01, 0x04, 0x01};
512, 576, 640 };
static const uint8_t lfeon[8] = { 0x10, 0x10, 0x04, 0x04,
0x04, 0x01, 0x04, 0x01 };
int frmsizecod;
int bitrate;
int half;
......@@ -339,7 +341,7 @@ int SyncInfo( const byte_t * p_buf, int * pi_channels, int * pi_sample_rate,
default:
return 0;
}
if ( p_buf[6] & lfeon[acmod] ) *pi_channels |= AOUT_CHAN_LFE;
frmsizecod = p_buf[4] & 63;
......
......@@ -2,7 +2,7 @@
* postprocessing_mmx.c: Post Processing library in MMX
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* $Id: postprocessing_mmx.c,v 1.1 2002/08/04 22:13:06 fenrir Exp $
* $Id: postprocessing_mmx.c,v 1.2 2002/12/06 16:34:05 sam Exp $
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
*
......@@ -114,7 +114,7 @@ UNUSED_LONGLONG( mmx_m2_5_m5_2 ) = 0xfffe0005fffb0002ULL;
****************************************************************************/
static inline int pp_deblock_isDC_mode( u8 *p_v )
{
int i_eq_cnt;
unsigned int i_eq_cnt;
/* algo :
x = v[i] - v[i+1] without signed saturation
......
......@@ -2,7 +2,7 @@
* postprocessing_mmxext.c: Post Processing plugin MMXEXT
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* $Id: postprocessing_mmxext.c,v 1.3 2002/10/28 06:26:11 fenrir Exp $
* $Id: postprocessing_mmxext.c,v 1.4 2002/12/06 16:34:05 sam Exp $
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
*
......@@ -122,7 +122,7 @@ UNUSED_LONGLONG( mmx_m2_5_m5_2 ) = 0xfffe0005fffb0002ULL;
****************************************************************************/
static inline int pp_deblock_isDC_mode( u8 *p_v )
{
int i_eq_cnt;
unsigned int i_eq_cnt;
/* algo :
......
This diff is collapsed.
......@@ -95,8 +95,8 @@ enum mad_flow libmad_input( void *p_data, struct mad_stream *p_stream )
/* Fill-in the buffer. If an error occurs print a message and leave
* the decoding loop. If the end of stream is reached we also leave
* the loop but the return status is left untouched. */
if( i_wanted > p_dec->bit_stream.p_data->p_payload_end
- p_dec->bit_stream.p_data->p_payload_start )
if( i_wanted > (size_t)(p_dec->bit_stream.p_data->p_payload_end
- p_dec->bit_stream.p_data->p_payload_start) )
{
i_wanted = p_dec->bit_stream.p_data->p_payload_end
- p_dec->bit_stream.p_data->p_payload_start;
......@@ -146,9 +146,9 @@ enum mad_flow libmad_output( void *p_data, struct mad_header const *p_header,
aout_buffer_t * p_buffer;
mad_fixed_t const * p_left = p_pcm->samples[0];
mad_fixed_t const * p_right = p_pcm->samples[1];
int i_samples = p_pcm->length;
unsigned int i_samples = p_pcm->length;
mad_fixed_t * p_samples;
int i_channels = (p_pcm->channels == 2) ?
unsigned int i_channels = (p_pcm->channels == 2) ?
AOUT_CHAN_LEFT | AOUT_CHAN_RIGHT :
AOUT_CHAN_CENTER;
......
......@@ -2,7 +2,7 @@
* decoder.c: MPEG audio decoder thread
*****************************************************************************
* Copyright (C) 1999-2001 VideoLAN
* $Id: decoder.c,v 1.8 2002/11/14 22:38:47 massiot Exp $
* $Id: decoder.c,v 1.9 2002/12/06 16:34:05 sam Exp $
*
* Authors: Michel Kaempf <maxx@via.ecp.fr>
* Michel Lespinasse <walken@via.ecp.fr>
......@@ -173,7 +173,7 @@ static void DecodeThread( adec_thread_t * p_dec )
{
/* Create the output fifo if it doesn't exist yet */
if( ( p_dec->p_aout_input == NULL ) ||
( p_dec->output_format.i_physical_channels !=
( p_dec->output_format.i_physical_channels != (unsigned int)
( sync_info.b_stereo ? AOUT_CHAN_LEFT | AOUT_CHAN_RIGHT :
AOUT_CHAN_CENTER ) ) ||
( p_dec->output_format.i_rate != sync_info.sample_rate ) )
......
......@@ -2,7 +2,7 @@
* mpeg_adec.h : audio decoder thread interface
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* $Id: decoder.h,v 1.3 2002/08/26 23:00:22 massiot Exp $
* $Id: decoder.h,v 1.4 2002/12/06 16:34:05 sam Exp $
*
* Authors: Michel Kaempf <maxx@via.ecp.fr>
*
......@@ -26,7 +26,7 @@
*****************************************************************************/
typedef struct adec_thread_s
{
/*
/*
* Sync Information
*/
int i_sync;
......@@ -41,8 +41,8 @@ typedef struct adec_thread_s
/*
* Decoder properties
*/
u32 header;
int frame_size;
uint32_t header;
unsigned int frame_size;
adec_bank_t bank_0;
adec_bank_t bank_1;
......
......@@ -2,7 +2,7 @@
* generic.c: MPEG audio decoder
*****************************************************************************
* Copyright (C) 1999-2001 VideoLAN
* $Id: generic.c,v 1.4 2002/08/28 22:25:38 massiot Exp $
* $Id: generic.c,v 1.5 2002/12/06 16:34:05 sam Exp $
*
* Authors: Michel Kaempf <maxx@via.ecp.fr>
* Michel Lespinasse <walken@via.ecp.fr>
......@@ -185,7 +185,7 @@ int adec_SyncFrame( adec_thread_t * p_adec, adec_sync_info_t * p_sync_info )
int adec_DecodeFrame( adec_thread_t * p_adec, float * buffer )
{
int i_total_bytes_read;
unsigned int i_total_bytes_read;
/* parse audio data */
......
......@@ -2,7 +2,7 @@
* audio_decoder.h : audio decoder interface
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* $Id: generic.h,v 1.1 2002/08/04 17:23:42 sam Exp $
* $Id: generic.h,v 1.2 2002/12/06 16:34:05 sam Exp $
*
* Authors: Michel Kaempf <maxx@via.ecp.fr>
*
......@@ -10,7 +10,7 @@
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
......@@ -26,10 +26,10 @@
typedef struct audiodec_s audiodec_t;
typedef struct adec_sync_info_s {
int sample_rate; /* sample rate in Hz */
int frame_size; /* frame size in bytes */
int bit_rate; /* nominal bit rate in kbps */
int b_stereo; /* mono/stereo */
unsigned int sample_rate; /* sample rate in Hz */
unsigned int frame_size; /* frame size in bytes */
unsigned int bit_rate; /* nominal bit rate in kbps */
vlc_bool_t b_stereo; /* mono/stereo */
} adec_sync_info_t;
typedef struct adec_bank_s
......@@ -38,7 +38,7 @@ typedef struct adec_bank_s
float v2[512];
float * actual;
int pos;
} adec_bank_t;
......@@ -2,7 +2,7 @@
* parse.c: SPU parser
*****************************************************************************
* Copyright (C) 2000-2001 VideoLAN
* $Id: parse.c,v 1.5 2002/11/06 21:48:24 gbazin Exp $
* $Id: parse.c,v 1.6 2002/12/06 16:34:05 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
......@@ -10,7 +10,7 @@
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
......@@ -249,16 +249,16 @@ static int ParseControlSeq( spudec_thread_t *p_spudec,
subpicture_t * p_spu )
{
/* Our current index in the SPU packet */
int i_index = p_spudec->i_rle_size + 4;
unsigned int i_index = p_spudec->i_rle_size + 4;
/* The next start-of-control-sequence index and the previous one */
int i_next_seq = 0, i_cur_seq = 0;
unsigned int i_next_seq = 0, i_cur_seq = 0;
/* Command and date */
uint8_t i_command = SPU_CMD_END;
mtime_t date = 0;
int i, pi_alpha[4];
unsigned int i, pi_alpha[4];
/* Initialize the structure */
p_spu->i_start = p_spu->i_stop = 0;
......@@ -272,18 +272,18 @@ static int ParseControlSeq( spudec_thread_t *p_spudec,
{
/* Get the control sequence date */
date = GetBits( &p_spudec->bit_stream, 16 );
/* Next offset */
i_cur_seq = i_index;
i_next_seq = GetBits( &p_spudec->bit_stream, 16 );
/* Skip what we just read */
i_index += 4;
}
i_command = GetBits( &p_spudec->bit_stream, 8 );
i_index++;
switch( i_command )
{
case SPU_CMD_FORCE_DISPLAY: /* 00 (force displaying) */
......
......@@ -2,7 +2,7 @@
* spudec.h : sub picture unit decoder thread interface
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* $Id: spudec.h,v 1.4 2002/11/06 21:48:24 gbazin Exp $
* $Id: spudec.h,v 1.5 2002/12/06 16:34:05 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
......@@ -10,7 +10,7 @@
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
......@@ -41,7 +41,7 @@ struct subpicture_sys_t
/* Cropping properties */
vlc_mutex_t lock;
vlc_bool_t b_crop;
int i_x_start, i_y_start, i_x_end, i_y_end;
unsigned int i_x_start, i_y_start, i_x_end, i_y_end;
};
/*****************************************************************************
......@@ -49,11 +49,11 @@ struct subpicture_sys_t
*****************************************************************************/
typedef struct subtitler_font_s
{
int i_height; /* character height in pixels */
int i_width[256]; /* character widths in pixels */
int i_memory[256]; /* amount of memory used by character */
int * p_length[256]; /* line byte widths */
u16 ** p_offset[256]; /* pointer to RLE data */
unsigned int i_height; /* character height in pixels */
unsigned int i_width[256]; /* character widths in pixels */
unsigned int i_memory[256]; /* amount of memory used by character */
unsigned int * p_length[256]; /* line byte widths */
uint16_t ** p_offset[256]; /* pointer to RLE data */
} subtitler_font_t;
/*****************************************************************************
......@@ -81,8 +81,8 @@ struct spudec_thread_t
/*
* Private properties
*/
int i_spu_size; /* size of current SPU packet */
int i_rle_size; /* size of the RLE part */
unsigned int i_spu_size; /* size of current SPU packet */
unsigned int i_rle_size; /* size of the RLE part */
};
/*****************************************************************************
......
......@@ -9,7 +9,7 @@
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
......@@ -54,7 +54,7 @@ typedef struct subtitler_line_s
/*****************************************************************************
* Local prototypes
*****************************************************************************/
static uint16_t *PlotSubtitleLine( char *, subtitler_font_t *, int,
static uint16_t *PlotSubtitleLine( char *, subtitler_font_t *, unsigned int,
uint16_t * );
static void DestroySPU ( subpicture_t * );
......@@ -67,12 +67,12 @@ static void DestroySPU ( subpicture_t * );
* 1 byte : font height in rows
*
* then, per character:
* 1 byte : character
* 1 byte : character
* 1 byte : character width in pixels
*
* then, per row:
* 1 byte : length of row, in entries
*
*
* then, per entry
* 1 byte : colour
* 1 byte : number of pixels of that colour
......@@ -85,14 +85,14 @@ subtitler_font_t* E_(subtitler_LoadFont)( vout_thread_t * p_vout,
{
subtitler_font_t * p_font;
int i;
int i_file;
int i_char;
int i_length;
int i_line;
int i_total_length;
unsigned int i;
unsigned int i_char;
unsigned int i_length;
unsigned int i_line;
unsigned int i_total_length;
byte_t pi_buffer[512]; /* file buffer */
int i_file;
byte_t pi_buffer[512]; /* file buffer */
msg_Dbg( p_vout, "loading font '%s'", psz_name );
......@@ -132,7 +132,7 @@ subtitler_font_t* E_(subtitler_LoadFont)( vout_thread_t * p_vout,
if( read( i_file, pi_buffer, 1 ) != 1 )
{
msg_Err( p_vout, "unexpected end of font file '%s'", psz_name );
free( p_font );
free( p_font );
close( i_file );
return( NULL );
}
......@@ -210,7 +210,7 @@ subtitler_font_t* E_(subtitler_LoadFont)( vout_thread_t * p_vout,
i_total_length += i_length;
/* Read line RLE data */
if( read( i_file, pi_buffer, i_length*2 ) != i_length*2)
if( read( i_file, pi_buffer, i_length*2 ) != (int)i_length*2)
{
msg_Err( p_vout, "unexpected end of font file '%s'", psz_name);
E_(subtitler_UnloadFont)( p_vout, p_font );
......@@ -237,7 +237,7 @@ subtitler_font_t* E_(subtitler_LoadFont)( vout_thread_t * p_vout,
/* Set total memory size of character */
p_font->i_memory[ i_char ] = i_total_length;
}
close(i_file);
......@@ -248,11 +248,11 @@ subtitler_font_t* E_(subtitler_LoadFont)( vout_thread_t * p_vout,
/*****************************************************************************
* subtitler_UnloadFont: unload a run-length encoded font file from memory
*****************************************************************************/
void E_(subtitler_UnloadFont)( vout_thread_t * p_vout,
void E_(subtitler_UnloadFont)( vout_thread_t * p_vout,
subtitler_font_t * p_font )
{
int i_char;
int i_line;
unsigned int i_char;
unsigned int i_line;
msg_Dbg( p_vout, "unloading font" );
......@@ -292,12 +292,12 @@ void subtitler_PlotSubtitle ( vout_thread_t *p_vout , char *psz_subtitle,
{
subpicture_t * p_spu;
int i_x;
int i_width;
int i_lines;
int i_longest_width;
int i_total_length;
int i_char;
unsigned int i_x;
unsigned int i_width;
unsigned int i_lines;
unsigned int i_longest_width;
unsigned int i_total_length;
unsigned int i_char;
uint16_t * p_data;
......@@ -328,7 +328,7 @@ void subtitler_PlotSubtitle ( vout_thread_t *p_vout , char *psz_subtitle,
while( *p_char != '\n' && *p_char != 0 )
{
i_width += p_font->i_width[ toascii( *p_char ) ];
i_width += p_font->i_width[ toascii( *p_char ) ];
if( i_width > p_vout->output.i_width )
{
......@@ -388,7 +388,7 @@ void subtitler_PlotSubtitle ( vout_thread_t *p_vout , char *psz_subtitle,
no characters are lost */
if( *p_char != '\n' && *p_char != 0 )
{
p_char--;
p_char--;
}
p_line_start = p_char;
......@@ -411,7 +411,7 @@ void subtitler_PlotSubtitle ( vout_thread_t *p_vout , char *psz_subtitle,
i_lines++;
i_width = 0;
for( i_x = 0; i_x < strlen( p_line->p_text ); i_x++ )
{
{
i_char = toascii(*(( p_line->p_text )+ i_x ));
i_width += p_font->i_width[ i_char ];
i_total_length += p_font->i_memory[ i_char ];
......@@ -452,7 +452,7 @@ void subtitler_PlotSubtitle ( vout_thread_t *p_vout , char *psz_subtitle,
p_spu->i_start = i_start;
p_spu->i_stop = i_stop;
p_spu->b_ephemer = i_stop ? VLC_FALSE : VLC_TRUE;
/* FIXME: Do we need these two? */
......@@ -492,7 +492,7 @@ void subtitler_PlotSubtitle ( vout_thread_t *p_vout , char *psz_subtitle,
p_spu->p_sys->b_crop = VLC_FALSE;
p_spu->i_x = (p_vout->output.i_width - i_longest_width) / 2;
p_spu->i_y = p_vout->output.i_height - (p_font->i_height * i_lines);
p_spu->i_y = p_vout->output.i_height - (p_font->i_height * i_lines);
p_spu->i_width = i_longest_width;
p_spu->i_height = p_font->i_height*i_lines;
......@@ -518,13 +518,14 @@ void subtitler_PlotSubtitle ( vout_thread_t *p_vout , char *psz_subtitle,
* PlotSubtitleLine: plot a single line of a subtitle
*****************************************************************************/
static uint16_t * PlotSubtitleLine ( char *psz_line, subtitler_font_t *p_font,
int i_total_width, uint16_t *p_data )
unsigned int i_total_width,
uint16_t *p_data )
{
int i_x;
int i_y;
int i_length;
int i_line_width;
int i_char;
unsigned int i_x;
unsigned int i_y;
unsigned int i_length;
unsigned int i_line_width;
unsigned int i_char;
uint16_t * p_rle;
......@@ -552,12 +553,12 @@ static uint16_t * PlotSubtitleLine ( char *psz_line, subtitler_font_t *p_font,
if(p_rle != NULL )
{
memcpy(p_data, p_rle, i_length * sizeof(uint16_t) );
memcpy(p_data, p_rle, i_length * sizeof(uint16_t) );
p_data+=i_length;
}
}
}
/* Pad line to fit box */
if( i_line_width < i_total_width )
{
......
......@@ -2,7 +2,7 @@
* text.c: text subtitles parser
*****************************************************************************
* Copyright (C) 2000-2001 VideoLAN
* $Id: text.c,v 1.2 2002/11/15 18:10:26 fenrir Exp $
* $Id: text.c,v 1.3 2002/12/06 16:34:05 sam Exp $
*
* Authors: Gildas Bazin <gbazin@netcourrier.com>
*
......@@ -59,10 +59,10 @@ void E_(ParseText)( spudec_thread_t *p_spudec, subtitler_font_t *p_font )
/* Check validity of packet data */
if( (p_spudec->bit_stream.p_data->p_payload_end
- p_spudec->bit_stream.p_data->p_payload_start) <= 0
|| (strlen(p_spudec->bit_stream.p_data->p_payload_start)
> p_spudec->bit_stream.p_data->p_payload_end
- p_spudec->bit_stream.p_data->p_payload_start) )
- p_spudec->bit_stream.p_data->p_payload_start) <= 0
|| (strlen(p_spudec->bit_stream.p_data->p_payload_start)
> (size_t)(p_spudec->bit_stream.p_data->p_payload_end
- p_spudec->bit_stream.p_data->p_payload_start)) )
{
/* Dump the packet */
NextDataPacket( p_spudec->p_fifo, &p_spudec->bit_stream );
......
......@@ -2,7 +2,7 @@
* rc.c : remote control stdin/stdout plugin for vlc
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* $Id: rc.c,v 1.13 2002/12/02 21:13:25 jlj Exp $
* $Id: rc.c,v 1.14 2002/12/06 16:34:06 sam Exp $
*
* Authors: Peter Surda <shurdeek@panorama.sth.ac.at>
*
......@@ -459,7 +459,7 @@ static int Playlist( vlc_object_t *p_this, char *psz_cmd, char *psz_arg )
!strcmp( psz_cmd, "chapter_n" ) ||
!strcmp( psz_cmd, "chapter_p" ) )
{
int i_chapter = 0;
unsigned int i_chapter = 0;
if( !strcmp( psz_cmd, "chapter" ) )
{
......@@ -513,7 +513,7 @@ static int Playlist( vlc_object_t *p_this, char *psz_cmd, char *psz_arg )
!strcmp( psz_cmd, "title_n" ) ||
!strcmp( psz_cmd, "title_p" ) )
{
int i_title = 0;
unsigned int i_title = 0;
if( !strcmp( psz_cmd, "title" ) )
{
......
This diff is collapsed.
This diff is collapsed.
/*****************************************************************************
* libasf.h :
* libasf.h :
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* $Id: libasf.h,v 1.4 2002/11/14 16:17:47 fenrir Exp $
* $Id: libasf.h,v 1.5 2002/12/06 16:34:06 sam Exp $
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
*
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
......@@ -53,7 +53,7 @@ static const guid_t asf_object_null_guid =
{ 0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00 }
};
static const guid_t asf_object_header_guid =
static const guid_t asf_object_header_guid =
{
0x75B22630,
0x668E,
......@@ -61,7 +61,7 @@ static const guid_t asf_object_header_guid =
{ 0xA6,0xD9, 0x00,0xAA,0x00,0x62,0xCE,0x6C }
};
static const guid_t asf_object_data_guid =
static const guid_t asf_object_data_guid =
{
0x75B22636,
0x668E,
......@@ -104,12 +104,12 @@ static const guid_t asf_object_content_description_guid =
{ 0xa6, 0xd9, 0x00, 0xaa, 0x00, 0x62, 0xce, 0x6c }
};
static const guid_t asf_object_header_extention_guid =
static const guid_t asf_object_header_extention_guid =
{
0x5FBF03B5,
0xA92E,
0x11CF,
{ 0x8E,0xE3, 0x00,0xC0,0x0C,0x20,0x53,0x65 }
{ 0x8E,0xE3, 0x00,0xC0,0x0C,0x20,0x53,0x65 }
};
static const guid_t asf_object_codec_list_guid =
......@@ -167,15 +167,15 @@ typedef struct asf_packet_s
int i_payload_size;
u8 *p_payload_data;
} asf_packet_t;
#endif
#define ASF_OBJECT_COMMON \
int i_type; \
guid_t i_object_id; \
u64 i_object_size; \
u64 i_object_pos; \
uint64_t i_object_size; \
uint64_t i_object_pos; \
union asf_object_u *p_father; \
union asf_object_u *p_first; \
union asf_object_u *p_last; \
......@@ -195,7 +195,7 @@ typedef struct asf_index_entry_s
} asf_index_entry_t;
/****************************************************************************
* High level asf object
* High level asf object
****************************************************************************/
/* This is the first header find in a asf file
* It's the only object that have subobject */
......@@ -205,7 +205,7 @@ typedef struct asf_object_header_s
uint32_t i_sub_object_count;
uint8_t i_reserved1; /* 0x01, but could be safely ignored */
uint8_t i_reserved2; /* 0x02, if not must failed to source the contain */
} asf_object_header_t;
typedef struct asf_object_data_s
......@@ -214,7 +214,7 @@ typedef struct asf_object_data_s
guid_t i_file_id;
uint64_t i_total_data_packets;
uint16_t i_reserved;
} asf_object_data_t;
......@@ -225,7 +225,7 @@ typedef struct asf_object_index_s
uint64_t i_index_entry_time_interval;
uint32_t i_max_packet_count;
uint32_t i_index_entry_count;
asf_index_entry_t *index_entry;
} asf_object_index_t;
......@@ -233,7 +233,7 @@ typedef struct asf_object_index_s
typedef struct asf_object_root_s
{
ASF_OBJECT_COMMON
asf_object_header_t *p_hdr;
asf_object_data_t *p_data;
asf_object_index_t *p_index;
......@@ -249,7 +249,7 @@ typedef struct asf_object_root_s
typedef struct asf_object_file_properties_s
{
ASF_OBJECT_COMMON
guid_t i_file_id;
uint64_t i_file_size;
uint64_t i_creation_date;
......@@ -261,7 +261,7 @@ typedef struct asf_object_file_properties_s
uint32_t i_min_data_packet_size;
uint32_t i_max_data_packet_size;
uint32_t i_max_bitrate;
} asf_object_file_properties_t;
#define ASF_STREAM_PROPERTIES_ENCRYPTED 0x8000
......@@ -320,7 +320,7 @@ typedef struct asf_codec_entry_s
uint16_t i_type;
char *psz_name;
char *psz_description;
uint16_t i_information_length;
uint8_t *p_information;
} asf_codec_entry_t;
......@@ -330,7 +330,7 @@ typedef struct asf_object_codec_list_s
ASF_OBJECT_COMMON
guid_t i_reserved;
uint32_t i_codec_entries_count;
asf_codec_entry_t *codec;
asf_codec_entry_t *codec;
} asf_object_codec_list_t;
......@@ -339,7 +339,7 @@ typedef struct asf_object_script_command_s
{
ASF_OBJECT_COMMON
} asf_object_script_command_t;
#endif
typedef struct asf_marker_s
......@@ -352,7 +352,7 @@ typedef struct asf_marker_s
uint32_t i_marker_description_length;
uint8_t *i_marker_description;
/* u8 padding */
} asf_marker_t;
typedef struct asf_object_marker_s
......@@ -383,10 +383,10 @@ typedef union asf_object_u
asf_object_root_t root;
asf_object_file_properties_t file_properties;
asf_object_stream_properties_t stream_properties;
asf_object_header_extention_t header_extention;
asf_object_header_extention_t header_extention;
asf_object_codec_list_t codec_list;
asf_object_marker_t marker;
} asf_object_t;
......@@ -397,7 +397,7 @@ int ASF_SkipBytes( input_thread_t *p_input, int i_count );
void GetGUID( guid_t *p_guid, uint8_t *p_data );
int CmpGUID( const guid_t *p_guid1, const guid_t *p_guid2 );
int ASF_ReadObjectCommon( input_thread_t *p_input,
asf_object_t *p_obj );
int ASF_NextObject( input_thread_t *p_input,
......
This diff is collapsed.
......@@ -2,14 +2,14 @@
* avi.h : AVI file Stream input module for vlc
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* $Id: avi.h,v 1.7 2002/11/15 18:10:26 fenrir Exp $
* $Id: avi.h,v 1.8 2002/12/06 16:34:06 sam Exp $
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
*
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
......@@ -26,11 +26,11 @@ typedef struct avi_packet_s
off_t i_pos;
uint32_t i_size;
vlc_fourcc_t i_type; // only for AVIFOURCC_LIST
uint8_t i_peek[8]; //first 8 bytes
int i_stream;
int i_cat;
unsigned int i_stream;
unsigned int i_cat;
} avi_packet_t;
......@@ -48,22 +48,22 @@ typedef struct avi_stream_s
{
vlc_bool_t b_activated;
int i_cat; /* AUDIO_ES, VIDEO_ES */
unsigned int i_cat; /* AUDIO_ES, VIDEO_ES */
vlc_fourcc_t i_fourcc;
vlc_fourcc_t i_codec;
int i_rate;
int i_scale;
int i_samplesize;
es_descriptor_t *p_es;
AVIIndexEntry_t *p_index;
int i_idxnb;
int i_idxmax;
unsigned int i_idxnb;
unsigned int i_idxmax;
int i_idxposc; /* numero of chunk */
int i_idxposb; /* byte in the current chunk */
unsigned int i_idxposc; /* numero of chunk */
unsigned int i_idxposb; /* byte in the current chunk */
} avi_stream_t;
......@@ -71,21 +71,21 @@ struct demux_sys_t
{
mtime_t i_time;
mtime_t i_length;
mtime_t i_pcr;
mtime_t i_pcr;
vlc_bool_t b_seekable;
avi_chunk_t ck_root;
off_t i_movi_begin;
off_t i_movi_lastchunk_pos; /* XXX position of last valid chunk */
/* number of streams and information */
int i_streams;
avi_stream_t **pp_info;
unsigned int i_streams;
avi_stream_t **pp_info;
#ifdef __AVI_SUBTITLE__
subtitle_demux_t *p_sub;
#endif
};
......@@ -2,7 +2,7 @@
* libavi.c :
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* $Id: libavi.c,v 1.8 2002/12/04 15:47:31 fenrir Exp $
* $Id: libavi.c,v 1.9 2002/12/06 16:34:06 sam Exp $
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
*
* This program is free software; you can redistribute it and/or modify
......@@ -378,7 +378,7 @@ static int AVI_ChunkRead_list( input_thread_t *p_input,
if( AVI_ChunkRead( p_input, p_chk, p_container, b_seekable ) ||
( AVI_TellAbsolute( p_input ) >=
p_chk->common.p_father->common.i_chunk_pos +
(off_t)p_chk->common.p_father->common.i_chunk_pos +
__EVEN( p_chk->common.p_father->common.i_chunk_size ) ) )
{
break;
......@@ -599,7 +599,7 @@ static int AVI_ChunkRead_idx1( input_thread_t *p_input,
avi_chunk_t *p_chk,
vlc_bool_t b_seekable )
{
int i_count, i_index;
unsigned int i_count, i_index;
AVI_READCHUNK_ENTER;
......@@ -769,9 +769,9 @@ static struct
{ 0, NULL, NULL }
};
static int AVI_ChunkFunctionFind( int i_fourcc )
static int AVI_ChunkFunctionFind( vlc_fourcc_t i_fourcc )
{
int i_index;
unsigned int i_index;
for( i_index = 0; ; i_index++ )
{
if( ( AVI_Chunk_Function[i_index].i_fourcc == i_fourcc )||
......@@ -885,7 +885,7 @@ int AVI_ChunkReadRoot( input_thread_t *p_input,
if( AVI_ChunkRead( p_input, p_chk, p_root, b_seekable ) ||
( AVI_TellAbsolute( p_input ) >=
p_chk->common.p_father->common.i_chunk_pos +
(off_t)p_chk->common.p_father->common.i_chunk_pos +
__EVEN( p_chk->common.p_father->common.i_chunk_size ) ) )
{
break;
......
......@@ -2,7 +2,7 @@
* libavi.h : LibAVI library
******************************************************************************
* Copyright (C) 2001 VideoLAN
* $Id: libavi.h,v 1.5 2002/12/04 15:47:31 fenrir Exp $
* $Id: libavi.h,v 1.6 2002/12/06 16:34:06 sam Exp $
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
*
* This program is free software; you can redistribute it and/or modify
......@@ -191,8 +191,8 @@ typedef struct avi_chunk_list_s
typedef struct avi_chunk_idx1_s
{
AVI_CHUNK_COMMON
int i_entry_count;
int i_entry_max;
unsigned int i_entry_count;
unsigned int i_entry_max;
idx1_entry_t *entry;
} avi_chunk_idx1_t;
......
......@@ -2,7 +2,7 @@
* libmp4.c : LibMP4 library for mp4 module for vlc
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* $Id: libmp4.c,v 1.9 2002/11/17 06:46:56 fenrir Exp $
* $Id: libmp4.c,v 1.10 2002/12/06 16:34:06 sam Exp $
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
*
* This program is free software; you can redistribute it and/or modify
......@@ -534,7 +534,7 @@ int MP4_ReadBoxContainerRaw( MP4_Stream_t *p_stream, MP4_Box_t *p_container )
MP4_Box_t *p_box;
if( MP4_TellStream( p_stream ) + 8 >
p_container->i_pos + p_container->i_size )
(off_t)(p_container->i_pos + p_container->i_size) )
{
/* there is no box to load */
return( 0 );
......@@ -573,7 +573,7 @@ int MP4_ReadBoxContainerRaw( MP4_Stream_t *p_stream, MP4_Box_t *p_container )
int MP4_ReadBoxContainer( MP4_Stream_t *p_stream, MP4_Box_t *p_container )
{
if( p_container->i_size <= MP4_BOX_HEADERSIZE(p_container ) + 8 )
if( p_container->i_size <= (size_t)MP4_BOX_HEADERSIZE(p_container ) + 8 )
{
/* container is empty, 8 stand for the first header in this box */
return( 1 );
......@@ -612,7 +612,7 @@ int MP4_ReadBox_ftyp( MP4_Stream_t *p_stream, MP4_Box_t *p_box )
if( ( p_box->data.p_ftyp->i_compatible_brands_count = i_read / 4 ) )
{
int i;
unsigned int i;
p_box->data.p_ftyp->i_compatible_brands =
calloc( p_box->data.p_ftyp->i_compatible_brands_count, sizeof(uint32_t));
......@@ -637,7 +637,7 @@ void MP4_FreeBox_ftyp( input_thread_t *p_input, MP4_Box_t *p_box )
int MP4_ReadBox_mvhd( MP4_Stream_t *p_stream, MP4_Box_t *p_box )
{
int i;
unsigned int i;
#ifdef MP4_VERBOSE
char s_creation_time[128];
char s_modification_time[128];
......@@ -709,7 +709,7 @@ int MP4_ReadBox_mvhd( MP4_Stream_t *p_stream, MP4_Box_t *p_box )
int MP4_ReadBox_tkhd( MP4_Stream_t *p_stream, MP4_Box_t *p_box )
{
int i;
unsigned int i;
#ifdef MP4_VERBOSE
char s_creation_time[128];
char s_modification_time[128];
......@@ -773,7 +773,7 @@ int MP4_ReadBox_tkhd( MP4_Stream_t *p_stream, MP4_Box_t *p_box )
int MP4_ReadBox_tref( MP4_Stream_t *p_stream, MP4_Box_t *p_box )
{
if( p_box->i_size < MP4_BOX_HEADERSIZE(p_box ) + 8 )
if( p_box->i_size < (size_t)MP4_BOX_HEADERSIZE(p_box ) + 8 )
{
/* container is empty, 8 stand for the first header in this box */
return( 1 );
......@@ -797,7 +797,7 @@ int MP4_ReadBox_tref( MP4_Stream_t *p_stream, MP4_Box_t *p_box )
int MP4_ReadBox_mdhd( MP4_Stream_t *p_stream, MP4_Box_t *p_box )
{
int i;
unsigned int i;
uint16_t i_language;
#ifdef MP4_VERBOSE
char s_creation_time[128];
......@@ -879,7 +879,7 @@ void MP4_FreeBox_hdlr( input_thread_t *p_input, MP4_Box_t *p_box )
int MP4_ReadBox_vmhd( MP4_Stream_t *p_stream, MP4_Box_t *p_box )
{
int i;
unsigned int i;
MP4_READBOX_ENTER( MP4_Box_data_vmhd_t );
......@@ -1014,7 +1014,7 @@ int MP4_ReadBox_dref( MP4_Stream_t *p_stream, MP4_Box_t *p_box )
int MP4_ReadBox_stts( MP4_Stream_t *p_stream, MP4_Box_t *p_box )
{
int i;
unsigned int i;
MP4_READBOX_ENTER( MP4_Box_data_stts_t );
MP4_GETVERSIONFLAGS( p_box->data.p_stts );
......@@ -1049,7 +1049,7 @@ void MP4_FreeBox_stts( input_thread_t *p_input, MP4_Box_t *p_box )
int MP4_ReadBox_ctts( MP4_Stream_t *p_stream, MP4_Box_t *p_box )
{
int i;
unsigned int i;
MP4_READBOX_ENTER( MP4_Box_data_ctts_t );
MP4_GETVERSIONFLAGS( p_box->data.p_ctts );
......@@ -1084,8 +1084,8 @@ void MP4_FreeBox_ctts( input_thread_t *p_input, MP4_Box_t *p_box )
static int MP4_ReadLengthDescriptor( uint8_t **pp_peek, int64_t *i_read )
{
int i_b;
int i_len = 0;
unsigned int i_b;
unsigned int i_len = 0;
do
{
i_b = **pp_peek;
......@@ -1100,9 +1100,9 @@ static int MP4_ReadLengthDescriptor( uint8_t **pp_peek, int64_t *i_read )
int MP4_ReadBox_esds( MP4_Stream_t *p_stream, MP4_Box_t *p_box )
{
#define es_descriptor p_box->data.p_esds->es_descriptor
int i_len;
int i_flags;
int i_type;
unsigned int i_len;
unsigned int i_flags;
unsigned int i_type;
MP4_READBOX_ENTER( MP4_Box_data_esds_t );
......@@ -1127,7 +1127,7 @@ int MP4_ReadBox_esds( MP4_Stream_t *p_stream, MP4_Box_t *p_box )
}
if( es_descriptor.b_url )
{
int i_len;
unsigned int i_len;
MP4_GET1BYTE( i_len );
es_descriptor.psz_URL = calloc( sizeof(char), i_len + 1 );
......@@ -1188,7 +1188,7 @@ void MP4_FreeBox_esds( input_thread_t *p_input, MP4_Box_t *p_box )
int MP4_ReadBox_sample_soun( MP4_Stream_t *p_stream, MP4_Box_t *p_box )
{
int i;
unsigned int i;
MP4_READBOX_ENTER( MP4_Box_data_sample_soun_t );
......@@ -1228,7 +1228,7 @@ int MP4_ReadBox_sample_soun( MP4_Stream_t *p_stream, MP4_Box_t *p_box )
#if 0
int MP4_ReadBox_sample_mp4a( MP4_Stream_t *p_stream, MP4_Box_t *p_box )
{
int i;
unsigned int i;
MP4_READBOX_ENTER( MP4_Box_data_sample_mp4a_t );
......@@ -1268,7 +1268,7 @@ int MP4_ReadBox_sample_mp4a( MP4_Stream_t *p_stream, MP4_Box_t *p_box )
int MP4_ReadBox_sample_vide( MP4_Stream_t *p_stream, MP4_Box_t *p_box )
{
int i;
unsigned int i;
MP4_READBOX_ENTER( MP4_Box_data_sample_vide_t );
......@@ -1340,7 +1340,7 @@ int MP4_ReadBox_stsd( MP4_Stream_t *p_stream, MP4_Box_t *p_box )
int MP4_ReadBox_stsz( MP4_Stream_t *p_stream, MP4_Box_t *p_box )
{
int i;
unsigned int i;
MP4_READBOX_ENTER( MP4_Box_data_stsz_t );
......@@ -1378,7 +1378,7 @@ void MP4_FreeBox_stsz( input_thread_t *p_input, MP4_Box_t *p_box )
int MP4_ReadBox_stsc( MP4_Stream_t *p_stream, MP4_Box_t *p_box )
{
int i;
unsigned int i;
MP4_READBOX_ENTER( MP4_Box_data_stsc_t );
......@@ -1418,7 +1418,7 @@ void MP4_FreeBox_stsc( input_thread_t *p_input, MP4_Box_t *p_box )
int MP4_ReadBox_stco_co64( MP4_Stream_t *p_stream, MP4_Box_t *p_box )
{
int i;
unsigned int i;
MP4_READBOX_ENTER( MP4_Box_data_co64_t );
......@@ -1465,7 +1465,7 @@ void MP4_FreeBox_stco_co64( input_thread_t *p_input, MP4_Box_t *p_box )
int MP4_ReadBox_stss( MP4_Stream_t *p_stream, MP4_Box_t *p_box )
{
int i;
unsigned int i;
MP4_READBOX_ENTER( MP4_Box_data_stss_t );
......@@ -1500,7 +1500,7 @@ void MP4_FreeBox_stss( input_thread_t *p_input, MP4_Box_t *p_box )
int MP4_ReadBox_stsh( MP4_Stream_t *p_stream, MP4_Box_t *p_box )
{
int i;
unsigned int i;
MP4_READBOX_ENTER( MP4_Box_data_stsh_t );
......@@ -1540,7 +1540,7 @@ void MP4_FreeBox_stsh( input_thread_t *p_input, MP4_Box_t *p_box )
int MP4_ReadBox_stdp( MP4_Stream_t *p_stream, MP4_Box_t *p_box )
{
int i;
unsigned int i;
MP4_READBOX_ENTER( MP4_Box_data_stdp_t );
......@@ -1571,7 +1571,7 @@ void MP4_FreeBox_stdp( input_thread_t *p_input, MP4_Box_t *p_box )
int MP4_ReadBox_padb( MP4_Stream_t *p_stream, MP4_Box_t *p_box )
{
int i;
unsigned int i;
MP4_READBOX_ENTER( MP4_Box_data_padb_t );
......@@ -1619,7 +1619,7 @@ void MP4_FreeBox_padb( input_thread_t *p_input, MP4_Box_t *p_box )
int MP4_ReadBox_elst( MP4_Stream_t *p_stream, MP4_Box_t *p_box )
{
int i;
unsigned int i;
MP4_READBOX_ENTER( MP4_Box_data_padb_t );
......@@ -1678,8 +1678,8 @@ void MP4_FreeBox_elst( input_thread_t *p_input, MP4_Box_t *p_box )
int MP4_ReadBox_cprt( MP4_Stream_t *p_stream, MP4_Box_t *p_box )
{
int i_language;
int i;
unsigned int i_language;
unsigned int i;
MP4_READBOX_ENTER( MP4_Box_data_cprt_t );
......@@ -2009,7 +2009,7 @@ static struct
int MP4_ReadBox( MP4_Stream_t *p_stream, MP4_Box_t *p_box, MP4_Box_t *p_father )
{
int i_result;
int i_index;
unsigned int i_index;
if( !MP4_ReadBoxCommon( p_stream, p_box ) )
{
......@@ -2061,7 +2061,7 @@ int MP4_ReadBox( MP4_Stream_t *p_stream, MP4_Box_t *p_box, MP4_Box_t *p_father )
*****************************************************************************/
int MP4_CountBox( MP4_Box_t *p_box, uint32_t i_type )
{
int i_count;
unsigned int i_count;
MP4_Box_t *p_child;
if( !p_box )
......@@ -2167,7 +2167,7 @@ MP4_Box_t *MP4_FindNbBox( MP4_Box_t *p_box, uint32_t i_number )
*****************************************************************************/
void MP4_BoxFree( input_thread_t *p_input, MP4_Box_t *p_box )
{
int i_index;
unsigned int i_index;
MP4_Box_t *p_child;
MP4_Box_t *p_next;
......@@ -2283,7 +2283,7 @@ int MP4_BoxGetRoot( input_thread_t *p_input, MP4_Box_t *p_root )
static void __MP4_BoxDumpStructure( input_thread_t *p_input,
MP4_Box_t *p_box, int i_level )
MP4_Box_t *p_box, unsigned int i_level )
{
MP4_Box_t *p_child;
......@@ -2298,7 +2298,7 @@ static void __MP4_BoxDumpStructure( input_thread_t *p_input,
else
{
char str[512];
int i;
unsigned int i;
memset( str, (uint8_t)' ', 512 );
for( i = 0; i < i_level; i++ )
{
......@@ -2338,7 +2338,7 @@ void MP4_BoxDumpStructure( input_thread_t *p_input, MP4_Box_t *p_box )
*****************************************************************************/
static void __get_token( char **ppsz_path, char **ppsz_token, int *pi_number )
{
int i_len ;
size_t i_len ;
if( !*ppsz_path[0] )
{
*ppsz_token = NULL;
......@@ -2391,7 +2391,7 @@ static void __MP4_BoxGet( MP4_Box_t **pp_result,
{
char *psz_path;
#if !defined(HAVE_VASPRINTF) || defined(SYS_DARWIN)
int i_size;
size_t i_size;
#endif
......
......@@ -2,7 +2,7 @@
* mp4.c : MP4 file input module for vlc
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* $Id: mp4.c,v 1.8 2002/11/28 16:32:29 fenrir Exp $
* $Id: mp4.c,v 1.9 2002/12/06 16:34:06 sam Exp $
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
*
* This program is free software; you can redistribute it and/or modify
......@@ -99,7 +99,7 @@ static int MP4Init( vlc_object_t * p_this )
MP4_Box_t *p_mvhd;
MP4_Box_t *p_trak;
int i;
unsigned int i;
/* I need to seek */
if( !p_input->stream.b_seekable )
{
......@@ -313,7 +313,7 @@ static int MP4Init( vlc_object_t * p_this )
static int MP4Demux( input_thread_t *p_input )
{
demux_sys_t *p_demux = p_input->p_demux_data;
int i_track;
unsigned int i_track;
/* XXX beurk, beuRK and BEURK,
but only way I've found to detect seek from interface */
......@@ -401,7 +401,7 @@ static int MP4Demux( input_thread_t *p_input )
static int MP4Seek ( input_thread_t *p_input, mtime_t i_date )
{
demux_sys_t *p_demux = p_input->p_demux_data;
int i_track;
unsigned int i_track;
/* First update update global time */
p_demux->i_time = i_date * p_demux->i_timescale / 1000000;
......@@ -420,19 +420,19 @@ static int MP4Seek ( input_thread_t *p_input, mtime_t i_date )
* MP4End: frees unused data
*****************************************************************************/
static void __MP4End ( vlc_object_t * p_this )
{
{
#define FREE( p ) \
if( p ) { free( p ); }
int i_track;
if( p ) { free( p ); }
unsigned int i_track;
input_thread_t * p_input = (input_thread_t *)p_this;
demux_sys_t *p_demux = p_input->p_demux_data;
msg_Dbg( p_input, "Freeing all memory" );
MP4_BoxFree( p_input, &p_demux->box_root );
for( i_track = 0; i_track < p_demux->i_tracks; i_track++ )
{
int i_chunk;
for( i_chunk = 0;
unsigned int i_chunk;
for( i_chunk = 0;
i_chunk < p_demux->track[i_track].i_chunk_count; i_chunk++ )
{
if( p_demux->track[i_track].chunk )
......@@ -465,7 +465,7 @@ static void __MP4End ( vlc_object_t * p_this )
static int MP4_TrackSynchro( input_thread_t *p_input, track_data_mp4_t *p_track )
{
demux_sys_t *p_demux = p_input->p_demux_data;
int i_chunk_last;
unsigned int i_chunk_last;
MP4_Box_t *p_stss;
if( !p_track->b_ok ||
......@@ -508,9 +508,9 @@ static int MP4_TrackSynchro( input_thread_t *p_input, track_data_mp4_t *p_track
/* *** Try to find nearest sync points *** */
if( ( p_stss = MP4_BoxGet( p_track->p_stbl, "stss" ) ) )
{
int i_index;
msg_Dbg( p_input,
"track[Id 0x%x] using Sync Sample Box (stss)",
unsigned int i_index;
msg_Dbg( p_input,
"track[Id 0x%x] using Sync Sample Box (stss)",
p_track->i_track_ID );
for( i_index = 0; i_index < p_stss->data.p_stss->i_entry_count; i_index++ )
{
......@@ -574,7 +574,7 @@ static void MP4_ParseTrack( input_thread_t *p_input,
track_data_mp4_t *p_demux_track,
MP4_Box_t * p_trak )
{
int i;
unsigned int i;
MP4_Box_t *p_tkhd = MP4_BoxGet( p_trak, "tkhd" );
MP4_Box_t *p_tref = MP4_BoxGet( p_trak, "tref" );
......@@ -692,8 +692,8 @@ static int MP4_CreateChunksIndex( input_thread_t *p_input,
MP4_Box_t *p_co64; /* give offset for each chunk, same for stco and co64 */
MP4_Box_t *p_stsc;
int i_chunk;
int i_index, i_last;
unsigned int i_chunk;
unsigned int i_index, i_last;
if( ( !(p_co64 = MP4_BoxGet( p_demux_track->p_stbl, "stco" ) )&&
......@@ -900,12 +900,12 @@ static int MP4_CreateSamplesIndex( input_thread_t *p_input,
static void MP4_StartDecoder( input_thread_t *p_input,
track_data_mp4_t *p_demux_track )
{
MP4_Box_t *p_sample;
int i;
int i_chunk;
MP4_Box_t * p_sample;
unsigned int i;
unsigned int i_chunk;
int i_decoder_specific_info_len;
uint8_t *p_decoder_specific_info;
unsigned int i_decoder_specific_info_len;
uint8_t * p_decoder_specific_info;
uint8_t *p_init;
BITMAPINFOHEADER *p_bih;
......@@ -1141,7 +1141,7 @@ static int MP4_ReadSample( input_thread_t *p_input,
track_data_mp4_t *p_demux_track,
pes_packet_t **pp_pes )
{
int i_size;
size_t i_size;
off_t i_pos;
data_packet_t *p_data;
......
......@@ -2,14 +2,14 @@
* mp4.h : MP4 file input module for vlc
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* $Id: mp4.h,v 1.4 2002/11/17 06:46:56 fenrir Exp $
* $Id: mp4.h,v 1.5 2002/12/06 16:34:06 sam Exp $
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
*
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
......@@ -48,7 +48,7 @@ typedef struct waveformatex_s
uint32_t i_avgbytespersec;
uint16_t i_blockalign;
uint16_t i_bitspersample;
uint16_t i_size; /* This give size of data
uint16_t i_size; /* This give size of data
imediatly following this header. */
} waveformatex_t;
......@@ -62,7 +62,7 @@ typedef struct chunk_data_mp4_s
uint32_t i_sample_count; /* how many samples in this chunk */
uint32_t i_sample_first; /* index of the first sample in this chunk */
/* now provide way to calculate pts, dts, and offset without to
/* now provide way to calculate pts, dts, and offset without to
much memory and with fast acces */
/* with this we can calculate dts/pts without waste memory */
......@@ -70,9 +70,9 @@ typedef struct chunk_data_mp4_s
uint32_t *p_sample_count_dts;
uint32_t *p_sample_delta_dts; /* dts delta */
/* TODO if needed add pts
/* TODO if needed add pts
but quickly *add* support for edts and seeking */
} chunk_data_mp4_t;
......@@ -91,31 +91,31 @@ typedef struct track_data_mp4_s
/* display size only ! */
int i_width;
int i_height;
/* more internal data */
/* more internal data */
uint64_t i_timescale; /* time scale for this track only */
/* give the next sample to read, i_chunk is to find quickly where
/* give the next sample to read, i_chunk is to find quickly where
the sample is located */
uint32_t i_sample; /* next sample to read */
uint32_t i_chunk; /* chunk where next sample is stored */
/* total count of chunk and sample */
uint32_t i_chunk_count;
uint32_t i_chunk_count;
uint32_t i_sample_count;
chunk_data_mp4_t *chunk; /* always defined for each chunk */
/* sample size, p_sample_size defined only if i_sample_size == 0
/* sample size, p_sample_size defined only if i_sample_size == 0
else i_sample_size is size for all sample */
uint32_t i_sample_size;
uint32_t *p_sample_size; /* XXX perhaps add file offset if take
uint32_t *p_sample_size; /* XXX perhaps add file offset if take
too much time to do sumations each time*/
es_descriptor_t *p_es; /* vlc es for this track */
MP4_Box_t *p_stbl; /* will contain all timing information */
MP4_Box_t *p_stsd; /* will contain all data to initialize decoder */
MP4_Box_t *p_sample; /* actual SampleEntry to make life simpler */
} track_data_mp4_t;
......@@ -125,23 +125,21 @@ typedef struct track_data_mp4_s
*****************************************************************************/
struct demux_sys_t
{
MP4_Box_t box_root; /* container for the whole file */
MP4_Box_t box_root; /* container for the hole file */
mtime_t i_pcr;
mtime_t i_pcr;
uint64_t i_time; /* time position of the presentation in movie timescale */
uint64_t i_timescale; /* movie time scale */
uint64_t i_duration; /* movie duration */
int i_tracks; /* number of track */
uint64_t i_time; /* time position of the presentation
* in movie timescale */
uint64_t i_timescale; /* movie time scale */
uint64_t i_duration; /* movie duration */
unsigned int i_tracks; /* number of tracks */
track_data_mp4_t *track; /* array of track */
};
static inline uint64_t MP4_GetTrackPos( track_data_mp4_t *p_track )
{
int i_sample;
unsigned int i_sample;
uint64_t i_pos;
......@@ -149,13 +147,13 @@ static inline uint64_t MP4_GetTrackPos( track_data_mp4_t *p_track )
if( p_track->i_sample_size )
{
i_pos += ( p_track->i_sample -
i_pos += ( p_track->i_sample -
p_track->chunk[p_track->i_chunk].i_sample_first ) *
p_track->i_sample_size;
}
else
{
for( i_sample = p_track->chunk[p_track->i_chunk].i_sample_first;
for( i_sample = p_track->chunk[p_track->i_chunk].i_sample_first;
i_sample < p_track->i_sample; i_sample++ )
{
i_pos += p_track->p_sample_size[i_sample];
......@@ -168,10 +166,10 @@ static inline uint64_t MP4_GetTrackPos( track_data_mp4_t *p_track )
/* Return time in s of a track */
static inline mtime_t MP4_GetTrackPTS( track_data_mp4_t *p_track )
{
int i_sample;
int i_index;
unsigned int i_sample;
unsigned int i_index;
uint64_t i_dts;
i_sample = p_track->i_sample - p_track->chunk[p_track->i_chunk].i_sample_first;
i_dts = p_track->chunk[p_track->i_chunk].i_first_dts;
i_index = 0;
......@@ -179,22 +177,22 @@ static inline mtime_t MP4_GetTrackPTS( track_data_mp4_t *p_track )
{
if( i_sample > p_track->chunk[p_track->i_chunk].p_sample_count_dts[i_index] )
{
i_dts += p_track->chunk[p_track->i_chunk].p_sample_count_dts[i_index] *
i_dts += p_track->chunk[p_track->i_chunk].p_sample_count_dts[i_index] *
p_track->chunk[p_track->i_chunk].p_sample_delta_dts[i_index];
i_sample -= p_track->chunk[p_track->i_chunk].p_sample_count_dts[i_index];
i_index++;
}
else
{
i_dts += i_sample *
i_dts += i_sample *
p_track->chunk[p_track->i_chunk].p_sample_delta_dts[i_index];
i_sample = 0;
break;
}
}
return( (mtime_t)(
return( (mtime_t)(
(mtime_t)1000000 *
(mtime_t)i_dts /
(mtime_t)i_dts /
(mtime_t)p_track->i_timescale ) );
}
......
......@@ -2,7 +2,7 @@
* ps.c : Program Stream input module for vlc
*****************************************************************************
* Copyright (C) 2000-2001 VideoLAN
* $Id: ps.c,v 1.6 2002/11/20 13:37:36 sam Exp $
* $Id: ps.c,v 1.7 2002/12/06 16:34:07 sam Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
......@@ -195,7 +195,7 @@ static int Activate( vlc_object_t * p_this )
else
{
/* (We have to do it ourselves) */
int i_es;
unsigned int i_es;
/* FIXME: we should do multiple passes in case an audio type
* is not present */
......
This diff is collapsed.
This diff is collapsed.
......@@ -2,7 +2,7 @@
* wav.c : wav file input module for vlc
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* $Id: wav.c,v 1.5 2002/12/03 17:00:16 fenrir Exp $
* $Id: wav.c,v 1.6 2002/12/06 16:34:07 sam Exp $
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
*
* This program is free software; you can redistribute it and/or modify
......@@ -604,7 +604,8 @@ static int WAVDemux( input_thread_t *p_input )
p_input->stream.p_selected_program,
p_demux->i_pcr );
if( TellAbsolute( p_input ) >= p_demux->i_data_pos + p_demux->i_data_size )
if( TellAbsolute( p_input )
>= (off_t)(p_demux->i_data_pos + p_demux->i_data_size) )
{
return( 0 ); // EOF
}
......
......@@ -2,7 +2,7 @@
* gtk_common.h: private Gtk+ interface description
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* $Id: common.h,v 1.3 2002/09/30 11:05:38 sam Exp $
* $Id: common.h,v 1.4 2002/12/06 16:34:07 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
......@@ -10,7 +10,7 @@
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
......@@ -46,7 +46,7 @@ struct intf_sys_t
vlc_bool_t b_slider_free; /* slider status */
/* menus handlers */
vlc_bool_t b_program_update; /* do we need to update programs
vlc_bool_t b_program_update; /* do we need to update programs
menu */
vlc_bool_t b_title_update; /* do we need to update title menus */
vlc_bool_t b_chapter_update; /* do we need to update
......@@ -84,7 +84,7 @@ struct intf_sys_t
/* The window labels for DVD mode */
GtkLabel * p_label_title;
GtkLabel * p_label_chapter;
gint i_part; /* current chapter */
guint i_part; /* current chapter */
};
/*****************************************************************************
......
......@@ -2,7 +2,7 @@
* gtk.c : Gtk+ plugin for vlc
*****************************************************************************
* Copyright (C) 2000-2001 VideoLAN
* $Id: gtk.c,v 1.8 2002/11/12 16:02:51 gbazin Exp $
* $Id: gtk.c,v 1.9 2002/12/06 16:34:07 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
......@@ -10,7 +10,7 @@
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
......
......@@ -2,17 +2,17 @@
* gtk_callbacks.c : Callbacks for the Gtk+ plugin.
*****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN
* $Id: gtk_callbacks.c,v 1.5 2002/11/12 16:02:51 gbazin Exp $
* $Id: gtk_callbacks.c,v 1.6 2002/12/06 16:34:07 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
* Stphane Borel <stef@via.ecp.fr>
* Julien BLACHE <jb@technologeek.org>
*
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
......@@ -128,12 +128,12 @@ gboolean GtkWindowToggle( GtkWidget *widget,
gpointer user_data )
{
intf_thread_t *p_intf = GtkGetIntf( widget );
if( GTK_WIDGET_VISIBLE(p_intf->p_sys->p_window) )
{
gtk_widget_hide( p_intf->p_sys->p_window);
}
else
}
else
{
gtk_widget_show( p_intf->p_sys->p_window );
}
......@@ -240,7 +240,7 @@ void GtkTitleNext( GtkButton * button, gpointer user_data )
{
intf_thread_t * p_intf;
input_area_t * p_area;
int i_id;
unsigned int i_id;
p_intf = GtkGetIntf( button );
vlc_mutex_lock( &p_intf->p_sys->p_input->stream.stream_lock );
......@@ -248,7 +248,7 @@ void GtkTitleNext( GtkButton * button, gpointer user_data )
if( i_id < p_intf->p_sys->p_input->stream.i_area_nb )
{
p_area = p_intf->p_sys->p_input->stream.pp_areas[i_id];
p_area = p_intf->p_sys->p_input->stream.pp_areas[i_id];
vlc_mutex_unlock( &p_intf->p_sys->p_input->stream.stream_lock );
input_ChangeArea( p_intf->p_sys->p_input, (input_area_t*)p_area );
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -2,7 +2,7 @@
* input_ext-intf.c: services to the interface
*****************************************************************************
* Copyright (C) 1998-2001 VideoLAN
* $Id: input_ext-intf.c,v 1.43 2002/11/11 14:39:12 sam Exp $
* $Id: input_ext-intf.c,v 1.44 2002/12/06 16:34:08 sam Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
......@@ -272,9 +272,9 @@ char * input_OffsetToTime( input_thread_t * p_input, char * psz_buffer,
*****************************************************************************/
void input_DumpStream( input_thread_t * p_input )
{
int i, j;
char psz_time1[OFFSETTOTIME_MAX_SIZE];
char psz_time2[OFFSETTOTIME_MAX_SIZE];
char psz_time1[OFFSETTOTIME_MAX_SIZE];
char psz_time2[OFFSETTOTIME_MAX_SIZE];
unsigned int i, j;
#define S p_input->stream
msg_Dbg( p_input, "dumping stream ID 0x%x [OK:%d/D:%d]", S.i_stream_id,
......
This diff is collapsed.
This diff is collapsed.
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