Commit d21d510c authored by Christophe Massiot's avatar Christophe Massiot

* Portability : changed off64_t to off_t and activated appropriate

  GNU/Linux options ;
* Changed fseek() to fseeko() for 64-bit offsets ;
* Reset frame predictors on a stream discontinuity.
parent 785049d7
......@@ -44,16 +44,21 @@ DEFINE += -DSTATS
endif
# PROGRAM_BUILD is a complete identification of the build
# ( we can't use fancy options with date since OSes like Solaris
# or FreeBSD have strange date implementations )
# (we can't use fancy options with date since OSes like Solaris
# or FreeBSD have strange date implementations)
PROGRAM_BUILD = `date` $(USER)
# XXX: beos does not support hostname
# XXX: beos does not support hostname (how lame...)
#PROGRAM_BUILD = `date` $(USER)@`hostname`
# DEFINE will contain some of the constants definitions decided in Makefile,
# including SYS_xx. It will be passed to C compiler.
DEFINE += -DSYS_$(shell echo $(SYS) | sed 's/-.*//' | tr a-z. A-Z_)
# On Linux activate 64-bit off_t (by default under BSD)
ifneq (,$(findstring linux,$(SYS)))
DEFINE += -D_FILE_OFFSET_BITS=64 -D__USE_UNIX98
endif
################################################################################
# Tuning and other variables - do not change anything except if you know
# exactly what you are doing
......
......@@ -2,7 +2,7 @@
* input.h: structures of the input not exported to other modules
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* $Id: input.h,v 1.27 2001/02/08 13:52:34 massiot Exp $
* $Id: input.h,v 1.28 2001/02/08 17:44:12 massiot Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
......@@ -109,7 +109,7 @@ static __inline__ void input_NullPacket( input_thread_t * p_input,
if( p_pes != NULL )
{
p_pes->b_messed_up = 1;
p_pes->b_discontinuity = 1;
p_es->p_last->p_next = p_pad_data;
p_es->p_last = p_pad_data;
}
......@@ -124,10 +124,8 @@ static __inline__ void input_NullPacket( input_thread_t * p_input,
p_pes->i_rate = p_input->stream.control.i_rate;
p_pes->p_first = p_pad_data;
p_pes->b_messed_up = p_pes->b_discontinuity = 1;
p_pes->b_discontinuity = 1;
input_DecodePES( p_es->p_decoder_fifo, p_pes );
}
p_es->b_discontinuity = 0;
}
......@@ -2,7 +2,7 @@
* input_ext-dec.h: structures exported to the VideoLAN decoders
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* $Id: input_ext-dec.h,v 1.21 2001/02/08 13:52:34 massiot Exp $
* $Id: input_ext-dec.h,v 1.22 2001/02/08 17:44:12 massiot Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
* Michel Kaempf <maxx@via.ecp.fr>
......@@ -53,8 +53,6 @@ typedef struct data_packet_s
typedef struct pes_packet_s
{
/* PES properties */
boolean_t b_messed_up; /* At least one of the data packets
* has a questionable content */
boolean_t b_data_alignment; /* used to find the beginning of
* a video or audio unit */
boolean_t b_discontinuity; /* This packet doesn't follow the
......
......@@ -4,7 +4,7 @@
* control the pace of reading.
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* $Id: input_ext-intf.h,v 1.17 2001/02/08 13:52:34 massiot Exp $
* $Id: input_ext-intf.h,v 1.18 2001/02/08 17:44:12 massiot Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
......@@ -60,7 +60,6 @@ typedef struct es_descriptor_s
struct pes_packet_s * p_pes; /* Current PES */
struct data_packet_s * p_last; /* The last packet gathered at present */
int i_pes_real_size; /* as indicated by the header */
boolean_t b_discontinuity; /* Stream changed */
/* Decoder information */
struct decoder_fifo_s * p_decoder_fifo;
......@@ -115,7 +114,6 @@ typedef struct pgrm_descriptor_s
count_t c_average_count;
/* counter used to compute dynamic average values */
int i_synchro_state;
boolean_t b_discontinuity;
/* Demultiplexer data */
void * p_demux_data;
......
......@@ -2,7 +2,7 @@
* dvd_css.c: Functions for DVD authentification and unscrambling
*****************************************************************************
* Copyright (C) 1999-2001 VideoLAN
* $Id: dvd_css.c,v 1.2 2001/02/08 06:41:56 stef Exp $
* $Id: dvd_css.c,v 1.3 2001/02/08 17:44:12 massiot Exp $
*
* Author: Stphane Borel <stef@via.ecp.fr>
*
......@@ -32,7 +32,6 @@
#include <unistd.h>
#include <string.h>
#include <fcntl.h>
#include <malloc.h>
#include <netinet/in.h>
#include <sys/ioctl.h>
#ifdef HAVE_SYS_DVDIO_H
......@@ -930,7 +929,7 @@ int CSSGetKeys( css_t * p_css )
DVD_key_t my_key;
title_key_t title_key[MaxKeys] ;
int i_title;
off64_t i_pos = 0;
off_t i_pos = 0;
int i_bytes_read;
int i_best_plen;
int i_best_p;
......@@ -948,7 +947,7 @@ int CSSGetKeys( css_t * p_css )
i_pos = p_css->p_title_key[i_title].i;
do
{
i_pos = lseek64( i_fd, i_pos, SEEK_SET );
i_pos = lseek( i_fd, i_pos, SEEK_SET );
i_bytes_read = read( i_fd, pi_buf, 0x800 );
if( pi_buf[0x14] & 0x30 ) // PES_scrambling_control
{
......
......@@ -2,7 +2,7 @@
* dvd_ifo.c: Functions for ifo parsing
*****************************************************************************
* Copyright (C) 1999-2001 VideoLAN
* $Id: dvd_ifo.c,v 1.2 2001/02/08 08:08:03 stef Exp $
* $Id: dvd_ifo.c,v 1.3 2001/02/08 17:44:12 massiot Exp $
*
* Author: Stphane Borel <stef@via.ecp.fr>
*
......@@ -28,7 +28,6 @@
#include <unistd.h>
#include <string.h>
#include <fcntl.h>
#include <malloc.h>
#include "common.h"
......@@ -54,7 +53,7 @@ static int IfoFindVMG( ifo_t* p_ifo )
while( strncmp( psz_test, psz_ifo_start, 12 ) != 0 )
{
/* The start of ifo file is on a sector boundary */
p_ifo->i_pos = lseek64( p_ifo->i_fd,
p_ifo->i_pos = lseek( p_ifo->i_fd,
p_ifo->i_pos + DVD_LB_SIZE,
SEEK_SET );
read( p_ifo->i_fd, psz_test, 12 );
......@@ -79,7 +78,7 @@ static int IfoFindVTS( ifo_t* p_ifo )
while( strncmp( psz_test, psz_ifo_start, 12 ) != 0 )
{
/* The start of ifo file is on a sector boundary */
p_ifo->i_pos = lseek64( p_ifo->i_fd,
p_ifo->i_pos = lseek( p_ifo->i_fd,
p_ifo->i_pos + DVD_LB_SIZE,
SEEK_SET );
read( p_ifo->i_fd, psz_test, 12 );
......@@ -103,7 +102,7 @@ ifo_t IfoInit( int i_fd )
ifo.i_fd = i_fd;
/* No data at the beginning of the disk
* 512000 bytes is just another value :) */
ifo.i_pos = lseek64( ifo.i_fd, 250 *DVD_LB_SIZE, SEEK_SET );
ifo.i_pos = lseek( ifo.i_fd, 250 *DVD_LB_SIZE, SEEK_SET );
/* FIXME : use udf filesystem to find the beginning of the file */
IfoFindVMG( &ifo );
......@@ -223,7 +222,7 @@ void IfoEnd( ifo_t* p_ifo )
#define FLUSH( i_len ) \
{ \
/*fprintf(stderr, "Pos : %lld\n", (long long)(p_ifo->i_pos - i_start));*/ \
p_ifo->i_pos = lseek64( p_ifo->i_fd , \
p_ifo->i_pos = lseek( p_ifo->i_fd , \
p_ifo->i_pos + (i_len), SEEK_SET ); \
}
......@@ -255,7 +254,7 @@ static pgc_t ReadPGC( ifo_t* p_ifo )
{
pgc_t pgc;
int i;
off64_t i_start = p_ifo->i_pos;
off_t i_start = p_ifo->i_pos;
//fprintf( stderr, "PGC\n" );
......@@ -290,7 +289,7 @@ static pgc_t ReadPGC( ifo_t* p_ifo )
/* Parsing of pgc_com_tab_t */
if( pgc.i_com_tab_sbyte )
{
p_ifo->i_pos = lseek64( p_ifo->i_fd, i_start
p_ifo->i_pos = lseek( p_ifo->i_fd, i_start
+ pgc.i_com_tab_sbyte, SEEK_SET );
GETS( &pgc.com_tab.i_pre_com_nb );
GETS( &pgc.com_tab.i_post_com_nb );
......@@ -345,7 +344,7 @@ static pgc_t ReadPGC( ifo_t* p_ifo )
/* Parsing of pgc_prg_map_t */
if( pgc.i_prg_map_sbyte )
{
p_ifo->i_pos = lseek64( p_ifo->i_fd, i_start
p_ifo->i_pos = lseek( p_ifo->i_fd, i_start
+ pgc.i_prg_map_sbyte, SEEK_SET );
pgc.prg_map.pi_entry_cell = malloc( pgc.i_prg_nb *sizeof(u8) );
if( pgc.prg_map.pi_entry_cell == NULL )
......@@ -360,7 +359,7 @@ static pgc_t ReadPGC( ifo_t* p_ifo )
/* Parsing of cell_play_inf_t */
if( pgc.i_cell_play_inf_sbyte )
{
p_ifo->i_pos = lseek64( p_ifo->i_fd, i_start
p_ifo->i_pos = lseek( p_ifo->i_fd, i_start
+ pgc.i_cell_play_inf_sbyte, SEEK_SET );
pgc.p_cell_play_inf = malloc( pgc.i_cell_nb *sizeof(cell_play_inf_t) );
if( pgc.p_cell_play_inf == NULL )
......@@ -384,7 +383,7 @@ static pgc_t ReadPGC( ifo_t* p_ifo )
/* Parsing of cell_pos_inf_map */
if( pgc.i_cell_pos_inf_sbyte )
{
p_ifo->i_pos = lseek64( p_ifo->i_fd, i_start
p_ifo->i_pos = lseek( p_ifo->i_fd, i_start
+ pgc.i_cell_pos_inf_sbyte, SEEK_SET );
pgc.p_cell_pos_inf = malloc( pgc.i_cell_nb *sizeof(cell_pos_inf_t) );
if( pgc.p_cell_play_inf == NULL )
......@@ -411,7 +410,7 @@ static pgci_inf_t ReadUnit( ifo_t* p_ifo )
{
pgci_inf_t inf;
int i;
off64_t i_start = p_ifo->i_pos;
off_t i_start = p_ifo->i_pos;
//fprintf( stderr, "Unit\n" );
......@@ -434,7 +433,7 @@ static pgci_inf_t ReadUnit( ifo_t* p_ifo )
}
for( i=0 ; i<inf.i_srp_nb ; i++ )
{
p_ifo->i_pos = lseek64( p_ifo->i_fd,
p_ifo->i_pos = lseek( p_ifo->i_fd,
i_start + inf.p_srp[i].i_pgci_sbyte,
SEEK_SET );
inf.p_srp[i].pgc = ReadPGC( p_ifo );
......@@ -450,7 +449,7 @@ static pgci_ut_t ReadUnitTable( ifo_t* p_ifo )
{
pgci_ut_t pgci;
int i;
off64_t i_start = p_ifo->i_pos;
off_t i_start = p_ifo->i_pos;
//fprintf( stderr, "Unit Table\n" );
......@@ -480,7 +479,7 @@ static pgci_ut_t ReadUnitTable( ifo_t* p_ifo )
}
for( i=0 ; i<pgci.i_lu_nb ; i++ )
{
p_ifo->i_pos = lseek64( p_ifo->i_fd, i_start +
p_ifo->i_pos = lseek( p_ifo->i_fd, i_start +
pgci.p_lu[i].i_lu_sbyte,
SEEK_SET );
pgci.p_pgci_inf[i] = ReadUnit( p_ifo );
......@@ -496,7 +495,7 @@ static c_adt_t ReadCellInf( ifo_t* p_ifo )
{
c_adt_t c_adt;
int i, i_max;
off64_t i_start = p_ifo->i_pos;
off_t i_start = p_ifo->i_pos;
//fprintf( stderr, "CELL ADD\n" );
......@@ -530,7 +529,7 @@ static vobu_admap_t ReadMap( ifo_t* p_ifo )
{
vobu_admap_t map;
int i, i_max;
off64_t i_start = p_ifo->i_pos;
off_t i_start = p_ifo->i_pos;
//fprintf( stderr, "VOBU ADMAP\n" );
......@@ -557,7 +556,7 @@ static vmgi_mat_t ReadVMGInfMat( ifo_t* p_ifo )
{
vmgi_mat_t mat;
int i;
// off64_t i_start = p_ifo->i_pos;
// off_t i_start = p_ifo->i_pos;
//fprintf( stderr, "VMGI\n" );
......@@ -616,7 +615,7 @@ static vmg_ptt_srpt_t ReadVMGTitlePointer( ifo_t* p_ifo )
{
vmg_ptt_srpt_t ptr;
int i;
// off64_t i_start = p_ifo->i_pos;
// off_t i_start = p_ifo->i_pos;
//fprintf( stderr, "PTR\n" );
......@@ -652,7 +651,7 @@ static vmg_ptl_mait_t ReadParentalInf( ifo_t* p_ifo )
{
vmg_ptl_mait_t par;
int i, j, k;
off64_t i_start = p_ifo->i_pos;
off_t i_start = p_ifo->i_pos;
//fprintf( stderr, "PTL\n" );
......@@ -682,7 +681,7 @@ static vmg_ptl_mait_t ReadParentalInf( ifo_t* p_ifo )
}
for( i=0 ; i<par.i_country_nb ; i++ )
{
p_ifo->i_pos = lseek64( p_ifo->i_fd, i_start +
p_ifo->i_pos = lseek( p_ifo->i_fd, i_start +
par.p_ptl_desc[i].i_ptl_mai_sbyte, SEEK_SET );
for( j=1 ; j<=8 ; j++ )
{
......@@ -711,7 +710,7 @@ static vmg_vts_atrt_t ReadVTSAttr( ifo_t* p_ifo )
{
vmg_vts_atrt_t atrt;
int i, j;
off64_t i_start = p_ifo->i_pos;
off_t i_start = p_ifo->i_pos;
//fprintf( stderr, "VTS ATTR\n" );
......@@ -738,7 +737,7 @@ static vmg_vts_atrt_t ReadVTSAttr( ifo_t* p_ifo )
}
for( i=0 ; i<atrt.i_vts_nb ; i++ )
{
p_ifo->i_pos = lseek64( p_ifo->i_fd, i_start +
p_ifo->i_pos = lseek( p_ifo->i_fd, i_start +
atrt.pi_vts_atrt_sbyte[i],
SEEK_SET );
GETL( &atrt.p_vts_atrt[i].i_ebyte );
......@@ -788,49 +787,49 @@ static vmg_t ReadVMG( ifo_t* p_ifo )
{
vmg_t vmg;
p_ifo->i_pos = lseek64( p_ifo->i_fd, p_ifo->i_off, SEEK_SET);
p_ifo->i_pos = lseek( p_ifo->i_fd, p_ifo->i_off, SEEK_SET);
vmg.mat = ReadVMGInfMat( p_ifo );
p_ifo->i_pos = lseek64( p_ifo->i_fd, p_ifo->i_off +
p_ifo->i_pos = lseek( p_ifo->i_fd, p_ifo->i_off +
vmg.mat.i_fp_pgc_sbyte, SEEK_SET );
vmg.pgc = ReadPGC( p_ifo );
if( vmg.mat.i_ptt_srpt_ssector )
{
p_ifo->i_pos = lseek64( p_ifo->i_fd, p_ifo->i_off +
p_ifo->i_pos = lseek( p_ifo->i_fd, p_ifo->i_off +
vmg.mat.i_ptt_srpt_ssector *DVD_LB_SIZE,
SEEK_SET );
vmg.ptt_srpt = ReadVMGTitlePointer( p_ifo );
}
if( vmg.mat.i_pgci_ut_ssector )
{
p_ifo->i_pos = lseek64( p_ifo->i_fd, p_ifo->i_off +
p_ifo->i_pos = lseek( p_ifo->i_fd, p_ifo->i_off +
vmg.mat.i_pgci_ut_ssector *DVD_LB_SIZE,
SEEK_SET );
vmg.pgci_ut = ReadUnitTable( p_ifo );
}
if( vmg.mat.i_ptl_mait_ssector )
{
p_ifo->i_pos = lseek64( p_ifo->i_fd, p_ifo->i_off +
p_ifo->i_pos = lseek( p_ifo->i_fd, p_ifo->i_off +
vmg.mat.i_ptl_mait_ssector *DVD_LB_SIZE,
SEEK_SET );
vmg.ptl_mait = ReadParentalInf( p_ifo );
}
if( vmg.mat.i_vts_atrt_ssector )
{
p_ifo->i_pos = lseek64( p_ifo->i_fd, p_ifo->i_off +
p_ifo->i_pos = lseek( p_ifo->i_fd, p_ifo->i_off +
vmg.mat.i_vts_atrt_ssector *DVD_LB_SIZE,
SEEK_SET );
vmg.vts_atrt = ReadVTSAttr( p_ifo );
}
if( vmg.mat.i_c_adt_ssector )
{
p_ifo->i_pos = lseek64( p_ifo->i_fd, p_ifo->i_off +
p_ifo->i_pos = lseek( p_ifo->i_fd, p_ifo->i_off +
vmg.mat.i_c_adt_ssector *DVD_LB_SIZE,
SEEK_SET );
vmg.c_adt = ReadCellInf( p_ifo );
}
if( vmg.mat.i_vobu_admap_ssector )
{
p_ifo->i_pos = lseek64( p_ifo->i_fd, p_ifo->i_off +
p_ifo->i_pos = lseek( p_ifo->i_fd, p_ifo->i_off +
vmg.mat.i_vobu_admap_ssector *DVD_LB_SIZE,
SEEK_SET );
vmg.vobu_admap = ReadMap( p_ifo );
......@@ -850,7 +849,7 @@ static vtsi_mat_t ReadVTSInfMat( ifo_t* p_ifo )
{
vtsi_mat_t mat;
int i;
// off64_t i_start = p_ifo->i_pos;
// off_t i_start = p_ifo->i_pos;
//fprintf( stderr, "VTSI\n" );
......@@ -918,7 +917,7 @@ static vts_ptt_srpt_t ReadVTSTitlePointer( ifo_t* p_ifo )
{
vts_ptt_srpt_t ptr;
int i;
off64_t i_start = p_ifo->i_pos;
off_t i_start = p_ifo->i_pos;
//fprintf( stderr, "PTR\n" );
......@@ -946,7 +945,7 @@ static vts_ptt_srpt_t ReadVTSTitlePointer( ifo_t* p_ifo )
}
for( i=0 ; i<ptr.i_ttu_nb ; i++ )
{
p_ifo->i_pos = lseek64( p_ifo->i_fd, i_start +
p_ifo->i_pos = lseek( p_ifo->i_fd, i_start +
ptr.pi_ttu_sbyte[i], SEEK_SET );
GETS( &ptr.p_ttu[i].i_pgc_nb );
GETS( &ptr.p_ttu[i].i_prg_nb );
......@@ -962,7 +961,7 @@ static vts_tmap_ti_t ReadVTSTimeMap( ifo_t* p_ifo )
{
vts_tmap_ti_t tmap;
int i,j;
// off64_t i_start = p_ifo->i_pos;
// off_t i_start = p_ifo->i_pos;
//fprintf( stderr, "TMAP\n" );
......@@ -1022,56 +1021,56 @@ static vts_t ReadVTS( ifo_t* p_ifo )
vts.mat = ReadVTSInfMat( p_ifo );
if( vts.mat.i_ptt_srpt_ssector )
{
p_ifo->i_pos = lseek64( p_ifo->i_fd, p_ifo->i_off +
p_ifo->i_pos = lseek( p_ifo->i_fd, p_ifo->i_off +
vts.mat.i_ptt_srpt_ssector *DVD_LB_SIZE,
SEEK_SET );
vts.ptt_srpt = ReadVTSTitlePointer( p_ifo );
}
if( vts.mat.i_m_pgci_ut_ssector )
{
p_ifo->i_pos = lseek64( p_ifo->i_fd, p_ifo->i_off +
p_ifo->i_pos = lseek( p_ifo->i_fd, p_ifo->i_off +
vts.mat.i_m_pgci_ut_ssector *DVD_LB_SIZE,
SEEK_SET );
vts.pgci_ut = ReadUnitTable( p_ifo );
}
if( vts.mat.i_pgcit_ssector )
{
p_ifo->i_pos = lseek64( p_ifo->i_fd, p_ifo->i_off +
p_ifo->i_pos = lseek( p_ifo->i_fd, p_ifo->i_off +
vts.mat.i_pgcit_ssector *DVD_LB_SIZE,
SEEK_SET );
vts.pgci_ti = ReadUnit( p_ifo );
}
if( vts.mat.i_tmap_ti_ssector )
{
p_ifo->i_pos = lseek64( p_ifo->i_fd, p_ifo->i_off +
p_ifo->i_pos = lseek( p_ifo->i_fd, p_ifo->i_off +
vts.mat.i_tmap_ti_ssector *DVD_LB_SIZE,
SEEK_SET );
vts.tmap_ti = ReadVTSTimeMap( p_ifo );
}
if( vts.mat.i_m_c_adt_ssector )
{
p_ifo->i_pos = lseek64( p_ifo->i_fd, p_ifo->i_off +
p_ifo->i_pos = lseek( p_ifo->i_fd, p_ifo->i_off +
vts.mat.i_m_c_adt_ssector *DVD_LB_SIZE,
SEEK_SET );
vts.m_c_adt = ReadCellInf( p_ifo );
}
if( vts.mat.i_m_vobu_admap_ssector )
{
p_ifo->i_pos = lseek64( p_ifo->i_fd, p_ifo->i_off +
p_ifo->i_pos = lseek( p_ifo->i_fd, p_ifo->i_off +
vts.mat.i_m_vobu_admap_ssector *DVD_LB_SIZE,
SEEK_SET );
vts.m_vobu_admap = ReadMap( p_ifo );
}
if( vts.mat.i_c_adt_ssector )
{
p_ifo->i_pos = lseek64( p_ifo->i_fd, p_ifo->i_off +
p_ifo->i_pos = lseek( p_ifo->i_fd, p_ifo->i_off +
vts.mat.i_c_adt_ssector *DVD_LB_SIZE,
SEEK_SET );
vts.c_adt = ReadCellInf( p_ifo );
}
if( vts.mat.i_vobu_admap_ssector )
{
p_ifo->i_pos = lseek64( p_ifo->i_fd, p_ifo->i_off +
p_ifo->i_pos = lseek( p_ifo->i_fd, p_ifo->i_off +
vts.mat.i_vobu_admap_ssector *DVD_LB_SIZE,
SEEK_SET );
vts.vobu_admap = ReadMap( p_ifo );
......@@ -1091,7 +1090,7 @@ static vts_t ReadVTS( ifo_t* p_ifo )
void IfoRead( ifo_t* p_ifo )
{
int i;
off64_t i_off;
off_t i_off;
p_ifo->vmg = ReadVMG( p_ifo );
p_ifo->p_vts = malloc( p_ifo->vmg.mat.i_tts_nb *sizeof(vts_t) );
......@@ -1107,7 +1106,7 @@ void IfoRead( ifo_t* p_ifo )
intf_WarnMsg( 3, "######### VTS %d #############\n", i+1 );
i_off = p_ifo->vmg.ptt_srpt.p_tts[i].i_ssector *DVD_LB_SIZE;
p_ifo->i_pos = lseek64( p_ifo->i_fd, i_off, SEEK_SET );
p_ifo->i_pos = lseek( p_ifo->i_fd, i_off, SEEK_SET );
/* FIXME : use udf filesystem to avoid this */
IfoFindVTS( p_ifo );
p_ifo->p_vts[i] = ReadVTS( p_ifo );
......
......@@ -2,7 +2,7 @@
* dvd_ifo.h: Structures for ifo parsing
*****************************************************************************
* Copyright (C) 1999-2001 VideoLAN
* $Id: dvd_ifo.h,v 1.1 2001/02/08 04:43:27 sam Exp $
* $Id: dvd_ifo.h,v 1.2 2001/02/08 17:44:12 massiot Exp $
*
* Author: Stphane Borel <stef@via.ecp.fr>
*
......@@ -477,9 +477,9 @@ typedef struct ifo_s
/* File descriptor for the device */
int i_fd;
/* Offset to video_ts.ifo on the device */
off64_t i_off;
off_t i_off;
/* Position of stream pointer */
off64_t i_pos;
off_t i_pos;
/* Error Management */
boolean_t b_error;
/* Structure described in video_ts */
......
......@@ -10,7 +10,7 @@
* -dvd_udf to find files
*****************************************************************************
* Copyright (C) 1998-2001 VideoLAN
* $Id: input_dvd.c,v 1.4 2001/02/08 11:22:41 massiot Exp $
* $Id: input_dvd.c,v 1.5 2001/02/08 17:44:12 massiot Exp $
*
* Author: Stphane Borel <stef@via.ecp.fr>
*
......@@ -83,8 +83,7 @@ static void DVDInit ( struct input_thread_s * );
static void DVDOpen ( struct input_thread_s * );
static void DVDClose ( struct input_thread_s * );
static void DVDEnd ( struct input_thread_s * );
/* FIXME : DVDSeek should be on 64 bits ? Is it possible in input ? */
static int DVDSeek ( struct input_thread_s *, off_t );
static void DVDSeek ( struct input_thread_s *, off_t );
static int DVDRewind ( struct input_thread_s * );
/*****************************************************************************
......@@ -148,7 +147,7 @@ static int DVDCheckCSS( input_thread_t * p_input )
static void DVDInit( input_thread_t * p_input )
{
thread_dvd_data_t * p_method;
off64_t i_start;
off_t i_start;
if( (p_method = malloc( sizeof(thread_dvd_data_t) )) == NULL )
{
......@@ -166,7 +165,7 @@ static void DVDInit( input_thread_t * p_input )
p_method->i_title = 0;
lseek64( p_input->i_handle, 0, SEEK_SET );
lseek( p_input->i_handle, 0, SEEK_SET );
/* Reading structures initialisation */
input_NetlistInit( p_input, 4096, 4096, DVD_LB_SIZE,
......@@ -207,7 +206,7 @@ static void DVDInit( input_thread_t * p_input )
i_start = p_method->ifo.p_vts[0].i_pos +
p_method->ifo.p_vts[0].mat.i_tt_vobs_ssector *DVD_LB_SIZE;
i_start = lseek64( p_input->i_handle, i_start, SEEK_SET );
i_start = lseek( p_input->i_handle, i_start, SEEK_SET );
intf_Msg( "VOB start at : %lld", (long long)i_start );
/* Initialize ES structures */
......@@ -258,7 +257,7 @@ static void DVDInit( input_thread_t * p_input )
break;
}
}
lseek64( p_input->i_handle, i_start, SEEK_SET );
lseek( p_input->i_handle, i_start, SEEK_SET );
vlc_mutex_lock( &p_input->stream.stream_lock );
p_input->stream.i_tell = 0;
if( p_demux_data->b_has_PSM )
......@@ -351,8 +350,7 @@ static void DVDOpen( input_thread_t * p_input )
{
intf_Msg( "input: opening DVD %s", p_input->p_source );
p_input->i_handle = open( p_input->p_source,
O_RDONLY | O_NONBLOCK | O_LARGEFILE );
p_input->i_handle = open( p_input->p_source, O_RDONLY | O_NONBLOCK );
if( p_input->i_handle == -1 )
{
......@@ -519,7 +517,7 @@ static int DVDRewind( input_thread_t * p_input )
* input and translate chronological position from input to logical postion
* on the device
*****************************************************************************/
static int DVDSeek( input_thread_t * p_input, off_t i_off )
static void DVDSeek( input_thread_t * p_input, off_t i_off )
{
return( -1 );
return;
}
......@@ -2,7 +2,7 @@
* input_ps.c: PS demux and packet management
*****************************************************************************
* Copyright (C) 1998, 1999, 2000 VideoLAN
* $Id: input_ps.c,v 1.3 2001/02/08 13:52:35 massiot Exp $
* $Id: input_ps.c,v 1.4 2001/02/08 17:44:12 massiot Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
......@@ -132,7 +132,7 @@ static void PSInit( input_thread_t * p_input )
p_input->b_error = 1;
return;
}
fseek( p_method->stream, 0, SEEK_SET );
rewind( p_method->stream );
/* FIXME : detect if InitStream failed */
input_InitStream( p_input, sizeof( stream_ps_data_t ) );
......@@ -181,7 +181,7 @@ static void PSInit( input_thread_t * p_input )
break;
}
}
fseek( p_method->stream, 0, SEEK_SET );
rewind( p_method->stream );
vlc_mutex_lock( &p_input->stream.stream_lock );
p_input->stream.i_tell = 0;
if( p_demux_data->b_has_PSM )
......@@ -439,7 +439,7 @@ static void PSSeek( input_thread_t * p_input, off_t i_position )
p_method = (thread_ps_data_t *)p_input->p_plugin_data;
/* A little bourrin but should work for a while --Meuuh */
fseek( p_method->stream, i_position, SEEK_SET );
fseeko( p_method->stream, i_position, SEEK_SET );
p_input->stream.i_tell = i_position;
}
......@@ -499,7 +499,7 @@ static pes_packet_t * NewPES( void * p_garbage )
return NULL;
}