Commit c45d7219 authored by Sam Hocevar's avatar Sam Hocevar

* removed CCFLAGS flags which were improperly used.

  * added hints for powerpc build.
  * fixed the input_file exit bug.
  * fixed a Makefile bug which removed the CVS directory.
  * removed the frame statistics output.
parent a9b62c64
...@@ -5,7 +5,12 @@ Thu Aug 18 00:21:33 BST 2000 ...@@ -5,7 +5,12 @@ Thu Aug 18 00:21:33 BST 2000
fullscreen when possible. Disabled by default. fullscreen when possible. Disabled by default.
* added sdlvlc (which probably should start in fullscreen, no ?) * added sdlvlc (which probably should start in fullscreen, no ?)
* removed sdlvlc :) * removed sdlvlc :)
* updated debian directory to build vlc-sdl * updated debian directory to build vlc-sdl.
* removed CCFLAGS flags which were improperly used.
* added hints for powerpc build.
* fixed the input_file exit bug.
* fixed a Makefile bug which removed the CVS directory.
* removed the frame statistics output.
Wed Aug 16 01:07:14 CEST 2000 Wed Aug 16 01:07:14 CEST 2000
0.1.99g : 0.1.99g :
......
...@@ -79,32 +79,32 @@ endif ...@@ -79,32 +79,32 @@ endif
# #
# C compiler flags: compilation # C compiler flags: compilation
# #
CCFLAGS += $(DEFINE) $(INCLUDE) CFLAGS += $(DEFINE) $(INCLUDE)
CCFLAGS += -Wall -Winline CFLAGS += -Wall -Winline
CCFLAGS += -D_REENTRANT CFLAGS += -D_REENTRANT
CCFLAGS += -D_GNU_SOURCE CFLAGS += -D_GNU_SOURCE
# flags needed for clean beos compilation # flags needed for clean beos compilation
ifeq ($(SYS),beos) ifeq ($(SYS),beos)
CCFLAGS += -Wno-multichar -Wno-ctor-dtor-privacy -Woverloaded-virtual CFLAGS += -Wno-multichar -Wno-ctor-dtor-privacy -Woverloaded-virtual
endif endif
# Optimizations : don't compile debug versions with them # Optimizations : don't compile debug versions with them
ifeq ($(DEBUG),0) ifeq ($(DEBUG),0)
CCFLAGS += -O6 CFLAGS += -O6
CCFLAGS += -ffast-math -funroll-loops -fargument-noalias-global CFLAGS += -ffast-math -funroll-loops -fargument-noalias-global
CCFLAGS += -fomit-frame-pointer CFLAGS += -fomit-frame-pointer
# Optimizations for x86 familiy # Optimizations for x86 familiy
ifneq (,$(findstring 86,$(ARCH))) ifneq (,$(findstring 86,$(ARCH)))
CCFLAGS += -malign-double CFLAGS += -malign-double
# Eventual Pentium Pro optimizations # Eventual Pentium Pro optimizations
ifneq (,$(findstring ppro,$(ARCH))) ifneq (,$(findstring ppro,$(ARCH)))
ifneq ($(SYS), BSD) ifneq ($(SYS), BSD)
CCFLAGS += -march=pentiumpro CFLAGS += -march=pentiumpro
endif endif
else else
CCFLAGS += -march=pentium CFLAGS += -march=pentium
endif endif
# Eventual MMX optimizations for x86 # Eventual MMX optimizations for x86
ifneq (,$(findstring mmx,$(ARCH))) ifneq (,$(findstring mmx,$(ARCH)))
...@@ -113,13 +113,18 @@ endif ...@@ -113,13 +113,18 @@ endif
endif endif
# Optimizations for PowerPC # Optimizations for PowerPC
ifneq (,$(findstring ppc,$(ARCH))) ifneq (,$(findstring powerpc,$(ARCH)))
CCFLAGS += -mcpu=604e -mmultiple -mhard-float -mstring # 604e
CFLAGS += -mcpu=604e -mmultiple -mhard-float -mstring
# G3
#CFLAGS += -mcpu=750 -mmultiple -mhard-float -mstring
# G4
#CFLAGS += -mcpu=7400 -mmultiple -mhard-float -mstring
endif endif
# Optimizations for Sparc # Optimizations for Sparc
ifneq (,$(findstring sparc,$(ARCH))) ifneq (,$(findstring sparc,$(ARCH)))
CCFLAGS += -mhard-float CFLAGS += -mhard-float
endif endif
# End of optimizations # End of optimizations
...@@ -359,7 +364,9 @@ distclean: clean ...@@ -359,7 +364,9 @@ distclean: clean
rm -f Makefile include/defs.h include/config.h rm -f Makefile include/defs.h include/config.h
rm -f config.status config.cache config.log rm -f config.status config.cache config.log
rm -f gmon.out core build-stamp rm -f gmon.out core build-stamp
rm -rf .dep debian/tmp rm -rf .dep
rm -rf debian/tmp debian/*.debhelper debian/*.substvars
find debian/* -type d -maxdepth 0 -name 'vlc-*' | xargs rm -rf
install: install:
mkdir -p $(prefix)/bin mkdir -p $(prefix)/bin
...@@ -373,9 +380,9 @@ install: ...@@ -373,9 +380,9 @@ install:
show: show:
@echo CC: $(CC) @echo CC: $(CC)
@echo CCFLAGS: $(CCFLAGS) @echo CFLAGS: $(CFLAGS)
@echo DCFLAGS: $(DCFLAGS) @echo DCFLAGS: $(DCFLAGS)
@echo LCFLAGS: $(CCFLAGS) @echo LCFLAGS: $(LCFLAGS)
# ugliest of all, but I have no time to do it -- sam # ugliest of all, but I have no time to do it -- sam
snapshot: snapshot:
...@@ -402,11 +409,11 @@ FORCE: ...@@ -402,11 +409,11 @@ FORCE:
# #
vlc: $(C_OBJ) $(CPP_OBJ) $(ASM_OBJ) vlc: $(C_OBJ) $(CPP_OBJ) $(ASM_OBJ)
ifeq ($(SYS),beos) ifeq ($(SYS),beos)
$(CC) $(CCFLAGS) $(LCFLAGS) $(CFLAGS) -Xlinker -soname=_APP_ -o $@ $(C_OBJ) $(CPP_OBJ) $(ASM_OBJ) $(CC) $(CFLAGS) $(LCFLAGS) -Xlinker -soname=_APP_ -o $@ $(C_OBJ) $(CPP_OBJ) $(ASM_OBJ)
rm -f ./plugins/_APP_ rm -f ./plugins/_APP_
ln -s ../vlc ./plugins/_APP_ ln -s ../vlc ./plugins/_APP_
else else
$(CC) $(CCFLAGS) $(LCFLAGS) $(CFLAGS) --export-dynamic -rdynamic -o $@ $(C_OBJ) $(CPP_OBJ) $(ASM_OBJ) $(CC) $(CFLAGS) $(LCFLAGS) --export-dynamic -rdynamic -o $@ $(C_OBJ) $(CPP_OBJ) $(ASM_OBJ)
endif endif
# #
...@@ -427,10 +434,10 @@ $(dependancies): %.d: FORCE ...@@ -427,10 +434,10 @@ $(dependancies): %.d: FORCE
$(C_OBJ): %.o: Makefile.dep $(C_OBJ): %.o: Makefile.dep
$(C_OBJ): %.o: .dep/%.d $(C_OBJ): %.o: .dep/%.d
$(C_OBJ): %.o: %.c $(C_OBJ): %.o: %.c
$(CC) $(CCFLAGS) $(CFLAGS) -c -o $@ $< $(CC) $(CFLAGS) -c -o $@ $<
$(CPP_OBJ): %.o: %.cpp $(CPP_OBJ): %.o: %.cpp
$(CC) $(CCFLAGS) $(CFLAGS) -c -o $@ $< $(CC) $(CFLAGS) -c -o $@ $<
$(ASM_OBJ): %.o: Makefile.dep $(ASM_OBJ): %.o: Makefile.dep
$(ASM_OBJ): %.o: %.S $(ASM_OBJ): %.o: %.S
...@@ -440,9 +447,9 @@ $(ASM_OBJ): %.o: %.S ...@@ -440,9 +447,9 @@ $(ASM_OBJ): %.o: %.S
#$(PLUGIN_OBJ): %.so: .dep/%.d #$(PLUGIN_OBJ): %.so: .dep/%.d
lib/beos.so: $(PLUGIN_BEOS) lib/beos.so: $(PLUGIN_BEOS)
$(CC) $(CCFLAGS) $(CFLAGS) $(LCFLAGS) -nostart -Xlinker -soname=$@ -o $@ $^ plugins/_APP_ $(CC) $(CFLAGS) $(LCFLAGS) -nostart -Xlinker -soname=$@ -o $@ $^ plugins/_APP_
$(PLUGIN_BEOS): %.o: %.cpp $(PLUGIN_BEOS): %.o: %.cpp
$(CC) $(CCFLAGS) $(CFLAGS) -c -o $@ $< $(CC) $(CFLAGS) -c -o $@ $<
lib/esd.so: $(PLUGIN_ESD) lib/esd.so: $(PLUGIN_ESD)
ifneq (,$(findstring bsd,$(SYS))) ifneq (,$(findstring bsd,$(SYS)))
...@@ -451,70 +458,70 @@ else ...@@ -451,70 +458,70 @@ else
ld -shared -laudiofile -lesd -o $@ $^ ld -shared -laudiofile -lesd -o $@ $^
endif endif
$(PLUGIN_ESD): %.o: %.c $(PLUGIN_ESD): %.o: %.c
$(CC) $(CCFLAGS) $(CFLAGS) -c -o $@ $< $(CC) $(CFLAGS) -c -o $@ $<
lib/dsp.so: $(PLUGIN_DSP) lib/dsp.so: $(PLUGIN_DSP)
ld -shared -o $@ $^ ld -shared -o $@ $^
$(PLUGIN_DSP): %.o: %.c $(PLUGIN_DSP): %.o: %.c
$(CC) $(CCFLAGS) $(CFLAGS) -c -o $@ $< $(CC) $(CFLAGS) -c -o $@ $<
lib/dummy.so: $(PLUGIN_DUMMY) lib/dummy.so: $(PLUGIN_DUMMY)
ld -shared -o $@ $^ ld -shared -o $@ $^
$(PLUGIN_DUMMY): %.o: %.c $(PLUGIN_DUMMY): %.o: %.c
$(CC) $(CCFLAGS) $(CFLAGS) -c -o $@ $< $(CC) $(CFLAGS) -c -o $@ $<
lib/fb.so: $(PLUGIN_FB) lib/fb.so: $(PLUGIN_FB)
ld -shared -o $@ $^ ld -shared -o $@ $^
$(PLUGIN_FB): %.o: %.c $(PLUGIN_FB): %.o: %.c
$(CC) $(CCFLAGS) $(CFLAGS) -c -o $@ $< $(CC) $(CFLAGS) -c -o $@ $<
lib/x11.so: $(PLUGIN_X11) lib/x11.so: $(PLUGIN_X11)
ld -shared -L/usr/X11R6/lib -lX11 -lXext -o $@ $^ ld -shared -L/usr/X11R6/lib -lX11 -lXext -o $@ $^
$(PLUGIN_X11): %.o: %.c $(PLUGIN_X11): %.o: %.c
$(CC) $(CCFLAGS) $(CFLAGS) -c -o $@ $< $(CC) $(CFLAGS) -c -o $@ $<
lib/mga.so: $(PLUGIN_MGA) lib/mga.so: $(PLUGIN_MGA)
ld -shared -L/usr/X11R6/lib -lX11 -lXext -o $@ $^ ld -shared -L/usr/X11R6/lib -lX11 -lXext -o $@ $^
$(PLUGIN_MGA): %.o: %.c $(PLUGIN_MGA): %.o: %.c
$(CC) $(CCFLAGS) $(CFLAGS) -c -o $@ $< $(CC) $(CFLAGS) -c -o $@ $<
lib/gnome.so: $(PLUGIN_GNOME) lib/gnome.so: $(PLUGIN_GNOME)
ld -shared `gnome-config --libs gnomeui | sed 's,-rdynamic,,'` -o $@ $^ ld -shared `gnome-config --libs gnomeui | sed 's,-rdynamic,,'` -o $@ $^
$(PLUGIN_GNOME): %.o: %.c $(PLUGIN_GNOME): %.o: %.c
$(CC) $(CCFLAGS) $(CFLAGS) `gnome-config --cflags gnomeui` -c -o $@ $< $(CC) $(CFLAGS) `gnome-config --cflags gnomeui` -c -o $@ $<
lib/glide.so: $(PLUGIN_GLIDE) lib/glide.so: $(PLUGIN_GLIDE)
ld -shared -lglide2x -o $@ $^ ld -shared -lglide2x -o $@ $^
$(PLUGIN_GLIDE): %.o: %.c $(PLUGIN_GLIDE): %.o: %.c
$(CC) $(CCFLAGS) $(CFLAGS) -I/usr/include/glide -c -o $@ $< $(CC) $(CFLAGS) -I/usr/include/glide -c -o $@ $<
lib/ggi.so: $(PLUGIN_GGI) lib/ggi.so: $(PLUGIN_GGI)
ld -shared -lggi -o $@ $^ ld -shared -lggi -o $@ $^
$(PLUGIN_GGI): %.o: %.c $(PLUGIN_GGI): %.o: %.c
$(CC) $(CCFLAGS) $(CFLAGS) -c -o $@ $< $(CC) $(CFLAGS) -c -o $@ $<
lib/sdl.so: $(PLUGIN_SDL) lib/sdl.so: $(PLUGIN_SDL)
ld -shared -lSDL -o $@ $^ ld -shared -lSDL -o $@ $^
$(PLUGIN_SDL): %.o: %.c $(PLUGIN_SDL): %.o: %.c
$(CC) $(CCFLAGS) $(CFLAGS) -c -o $@ $< $(CC) $(CFLAGS) -c -o $@ $<
lib/yuv.so: $(PLUGIN_YUV) lib/yuv.so: $(PLUGIN_YUV)
ifeq ($(SYS),beos) ifeq ($(SYS),beos)
$(CC) $(CCFLAGS) $(CFLAGS) -nostart -Xlinker -soname=$@ -o $@ $^ plugins/_APP_ $(CC) $(CFLAGS) -nostart -Xlinker -soname=$@ -o $@ $^ plugins/_APP_
else else
ld -shared -o $@ $^ ld -shared -o $@ $^
endif endif
$(PLUGIN_YUV): %.o: %.c $(PLUGIN_YUV): %.o: %.c
$(CC) $(CCFLAGS) $(CFLAGS) -c -o $@ $< $(CC) $(CFLAGS) -c -o $@ $<
lib/yuvmmx.so: $(PLUGIN_YUVMMX) lib/yuvmmx.so: $(PLUGIN_YUVMMX)
ifeq ($(SYS),beos) ifeq ($(SYS),beos)
$(CC) $(CCFLAGS) $(CFLAGS) -nostart -Xlinker -soname=$@ -o $@ $^ plugins/_APP_ $(CC) $(CFLAGS) -nostart -Xlinker -soname=$@ -o $@ $^ plugins/_APP_
else else
ld -shared -o $@ $^ ld -shared -o $@ $^
endif endif
$(PLUGIN_YUVMMX): %.o: %.c $(PLUGIN_YUVMMX): %.o: %.c
$(CC) $(CCFLAGS) $(CFLAGS) -c -o $@ $< $(CC) $(CFLAGS) -c -o $@ $<
################################################################################ ################################################################################
# Note on generic rules and dependancies # Note on generic rules and dependancies
......
...@@ -250,7 +250,7 @@ Urgency: Critical ...@@ -250,7 +250,7 @@ Urgency: Critical
Description: Fix input_file exit Description: Fix input_file exit
input_file does not exit cleanly when the file is finished, input_file does not exit cleanly when the file is finished,
which makes it impossible to quit the vlc. Fix it. which makes it impossible to quit the vlc. Fix it.
Status: Todo Status: Done 21 Aug 2000 (sam)
Task: 0x14 Task: 0x14
Difficulty: Guru Difficulty: Guru
......
...@@ -66,7 +66,7 @@ int intf_SDLCreate( intf_thread_t *p_intf ) ...@@ -66,7 +66,7 @@ int intf_SDLCreate( intf_thread_t *p_intf )
/* Check that b_video is set */ /* Check that b_video is set */
if( !p_main->b_video ) if( !p_main->b_video )
{ {
intf_ErrMsg("error: SDL interface require a video output thread\n"); intf_ErrMsg( "error: SDL interface requires a video output thread\n" );
return( 1 ); return( 1 );
} }
...@@ -90,7 +90,7 @@ int intf_SDLCreate( intf_thread_t *p_intf ) ...@@ -90,7 +90,7 @@ int intf_SDLCreate( intf_thread_t *p_intf )
if( p_intf->p_vout == NULL ) /* error */ if( p_intf->p_vout == NULL ) /* error */
{ {
intf_ErrMsg("error: can't create video output thread\n" ); intf_ErrMsg( "error: can't create video output thread\n" );
free( p_intf->p_sys ); free( p_intf->p_sys );
return( 1 ); return( 1 );
} }
...@@ -138,8 +138,8 @@ void intf_SDLManage( intf_thread_t *p_intf ) ...@@ -138,8 +138,8 @@ void intf_SDLManage( intf_thread_t *p_intf )
if( intf_ProcessKey( p_intf, (char ) i_key ) ) if( intf_ProcessKey( p_intf, (char ) i_key ) )
{ {
intf_DbgMsg("unhandled key '%c' (%i)\n", intf_DbgMsg( "unhandled key '%c' (%i)\n",
(char) i_key, i_key ); (char) i_key, i_key );
} }
break; break;
case SDL_QUIT: case SDL_QUIT:
...@@ -150,3 +150,4 @@ void intf_SDLManage( intf_thread_t *p_intf ) ...@@ -150,3 +150,4 @@ void intf_SDLManage( intf_thread_t *p_intf )
} }
} }
} }
...@@ -48,8 +48,6 @@ ...@@ -48,8 +48,6 @@
* This structure is part of the video output thread descriptor. * This structure is part of the video output thread descriptor.
* It describes the SDL specific properties of an output thread. * It describes the SDL specific properties of an output thread.
*****************************************************************************/ *****************************************************************************/
typedef struct vout_sys_s typedef struct vout_sys_s
{ {
SDL_Surface * p_display; /* display device */ SDL_Surface * p_display; /* display device */
...@@ -61,9 +59,8 @@ typedef struct vout_sys_s ...@@ -61,9 +59,8 @@ typedef struct vout_sys_s
/***************************************************************************** /*****************************************************************************
* Local prototypes * Local prototypes
*****************************************************************************/ *****************************************************************************/
static int SDLOpenDisplay ( vout_thread_t *p_vout, static int SDLOpenDisplay ( vout_thread_t *p_vout,
char *psz_display, char *psz_display, void *p_data );
void *p_data );
static void SDLCloseDisplay ( vout_thread_t *p_vout ); static void SDLCloseDisplay ( vout_thread_t *p_vout );
/***************************************************************************** /*****************************************************************************
...@@ -73,13 +70,14 @@ static void SDLCloseDisplay ( vout_thread_t *p_vout ); ...@@ -73,13 +70,14 @@ static void SDLCloseDisplay ( vout_thread_t *p_vout );
* vout properties to choose the correct mode, and change them according to the * vout properties to choose the correct mode, and change them according to the
* mode actually used. * mode actually used.
*****************************************************************************/ *****************************************************************************/
int vout_SDLCreate( vout_thread_t *p_vout, char *psz_display, int i_root_window, void *p_data ) int vout_SDLCreate( vout_thread_t *p_vout, char *psz_display,
int i_root_window, void *p_data )
{ {
/* Allocate structure */ /* Allocate structure */
p_vout->p_sys = malloc( sizeof( vout_sys_t ) ); p_vout->p_sys = malloc( sizeof( vout_sys_t ) );
if( p_vout->p_sys == NULL ) if( p_vout->p_sys == NULL )
{ {
intf_ErrMsg("error: %s\n", strerror(ENOMEM) ); intf_ErrMsg( "error: %s\n", strerror(ENOMEM) );
return( 1 ); return( 1 );
} }
...@@ -87,7 +85,7 @@ int vout_SDLCreate( vout_thread_t *p_vout, char *psz_display, int i_root_window, ...@@ -87,7 +85,7 @@ int vout_SDLCreate( vout_thread_t *p_vout, char *psz_display, int i_root_window,
if( SDLOpenDisplay( p_vout, psz_display, p_data ) ) if( SDLOpenDisplay( p_vout, psz_display, p_data ) )
{ {
intf_ErrMsg("error: can't initialize SDL display\n"); intf_ErrMsg( "error: can't initialize SDL display\n" );
free( p_vout->p_sys ); free( p_vout->p_sys );
return( 1 ); return( 1 );
} }
...@@ -181,27 +179,29 @@ static int SDLOpenDisplay( vout_thread_t *p_vout, char *psz_display, void *p_dat ...@@ -181,27 +179,29 @@ static int SDLOpenDisplay( vout_thread_t *p_vout, char *psz_display, void *p_dat
/* Initialize library */ /* Initialize library */
if( SDL_Init(SDL_INIT_VIDEO) < 0 ) if( SDL_Init(SDL_INIT_VIDEO) < 0 )
{ {
intf_ErrMsg("error: can't initialize SDL library: %s\n", SDL_GetError()); intf_ErrMsg( "error: can't initialize SDL library: %s\n",
SDL_GetError() );
return( 1 ); return( 1 );
} }
/* Open display */ /* Open display */
if(psz_display != NULL && strcmp(psz_display,"fullscreen")==0) if( psz_display != NULL && strcmp(psz_display,"fullscreen") == 0 )
{
p_vout->p_sys->p_display =
SDL_SetVideoMode( p_vout->i_width, p_vout->i_height, 15,
SDL_ANYFORMAT | SDL_HWSURFACE | SDL_DOUBLEBUF |
SDL_FULLSCREEN );
}
else
{ {
p_vout->p_sys->p_display = SDL_SetVideoMode(p_vout->i_width, p_vout->p_sys->p_display =
p_vout->i_height, SDL_SetVideoMode( p_vout->i_width, p_vout->i_height, 15,
15, SDL_ANYFORMAT | SDL_HWSURFACE | SDL_DOUBLEBUF );
SDL_ANYFORMAT | SDL_HWSURFACE | SDL_DOUBLEBUF | SDL_FULLSCREEN );
} else {
p_vout->p_sys->p_display = SDL_SetVideoMode(p_vout->i_width,
p_vout->i_height,
15,
SDL_ANYFORMAT | SDL_HWSURFACE | SDL_DOUBLEBUF );
} }
if( p_vout->p_sys->p_display == NULL ) if( p_vout->p_sys->p_display == NULL )
{ {
intf_ErrMsg("error: can't open DISPLAY default display\n"); intf_ErrMsg( "error: can't open DISPLAY default display\n" );
return( 1 ); return( 1 );
} }
SDL_EventState(SDL_KEYUP , SDL_IGNORE); /* ignore keys up */ SDL_EventState(SDL_KEYUP , SDL_IGNORE); /* ignore keys up */
...@@ -220,8 +220,6 @@ static int SDLOpenDisplay( vout_thread_t *p_vout, char *psz_display, void *p_dat ...@@ -220,8 +220,6 @@ static int SDLOpenDisplay( vout_thread_t *p_vout, char *psz_display, void *p_dat
SDL_Flip(p_vout->p_sys->p_display); SDL_Flip(p_vout->p_sys->p_display);
/* Set graphic context colors */ /* Set graphic context colors */
/* /*
...@@ -263,7 +261,8 @@ static int SDLOpenDisplay( vout_thread_t *p_vout, char *psz_display, void *p_dat ...@@ -263,7 +261,8 @@ static int SDLOpenDisplay( vout_thread_t *p_vout, char *psz_display, void *p_dat
/* Set and initialize buffers */ /* Set and initialize buffers */
vout_SetBuffers( p_vout, p_vout->p_sys->p_buffer[ 0 ], p_vout->p_sys->p_buffer[ 1 ]); vout_SetBuffers( p_vout, p_vout->p_sys->p_buffer[ 0 ],
p_vout->p_sys->p_buffer[ 1 ] );
return( 0 ); return( 0 );
} }
......
...@@ -1201,7 +1201,7 @@ static __inline__ int input_ReadPacket( input_thread_t *p_input ) ...@@ -1201,7 +1201,7 @@ static __inline__ int input_ReadPacket( input_thread_t *p_input )
i_base_index = p_input->netlist.i_ts_start; i_base_index = p_input->netlist.i_ts_start;
if( p_input->netlist.i_ts_start + INPUT_TS_READ_ONCE -1 > INPUT_MAX_TS ) if( p_input->netlist.i_ts_start + INPUT_TS_READ_ONCE -1 > INPUT_MAX_TS )
{ {
/* The netlist is splitted in 2 parts. We must gather them to consolidate /* The netlist is split in 2 parts. We must gather them to consolidate
the FIFO (we make the loop easily in having the same iovec at the far the FIFO (we make the loop easily in having the same iovec at the far
end and in the beginning of netlist_free). end and in the beginning of netlist_free).
That's why the netlist is (INPUT_MAX_TS +1) + (INPUT_TS_READ_ONCE -1) That's why the netlist is (INPUT_MAX_TS +1) + (INPUT_TS_READ_ONCE -1)
......
...@@ -285,11 +285,13 @@ int file_next( options_t *options ) ...@@ -285,11 +285,13 @@ int file_next( options_t *options )
/* the check for index == 0 has to be done _before_ */ /* the check for index == 0 has to be done _before_ */
p_playlist->i_index--; p_playlist->i_index--;
/* close the file we just finished */
if( options->in != -1 ) if( options->in != -1 )
{ {
close( options->in ); close( options->in );
} }
/* open the next file */
if( !strcmp( p_playlist->p_list[ p_playlist->i_index ], "-" ) ) if( !strcmp( p_playlist->p_list[ p_playlist->i_index ], "-" ) )
{ {
/* read stdin */ /* read stdin */
...@@ -737,7 +739,9 @@ ssize_t ps_read( options_t *p_options, ps_t * p_ps, void *ts ) ...@@ -737,7 +739,9 @@ ssize_t ps_read( options_t *p_options, ps_t * p_ps, void *ts )
if(readbytes == 0) if(readbytes == 0)
{ {
intf_ErrMsg ( "input: ps read error\n"); input_file.b_die = 1;
vlc_cond_signal( &input_file.in_data.notfull );
vlc_thread_join( input_file.disk_thread );
return -1; return -1;
} }
p_ps->ps_data = p_ps->ps_buffer; p_ps->ps_data = p_ps->ps_buffer;
...@@ -753,17 +757,17 @@ ssize_t ps_read( options_t *p_options, ps_t * p_ps, void *ts ) ...@@ -753,17 +757,17 @@ ssize_t ps_read( options_t *p_options, ps_t * p_ps, void *ts )
return -1; return -1;
} }
p_ps->pes_type = NO_PES; p_ps->pes_type = NO_PES;
p_ps->offset = 0; p_ps->offset = 0;
p_ps->pes_size = (p_ps->ps_data[4] << 8) + p_ps->ps_data[5] + 6; p_ps->pes_size = (p_ps->ps_data[4] << 8) + p_ps->ps_data[5] + 6;
p_ps->has_pts = p_ps->ps_data[7] & 0xc0; p_ps->has_pts = p_ps->ps_data[7] & 0xc0;
} }
/* if the actual data we have in pes_data is not a PES, then /* if the actual data we have in pes_data is not a PES, then
* we read the next one. */ * we read the next one. */
if( (p_ps->pes_type == NO_PES) && !p_ps->to_skip ) if( (p_ps->pes_type == NO_PES) && !p_ps->to_skip )
{ {
p_ps->pes_id = p_ps->ps_data[3]; p_ps->pes_id = p_ps->ps_data[3];
if (p_ps->pes_id == 0xbd) if (p_ps->pes_id == 0xbd)
{ {
...@@ -860,7 +864,7 @@ ssize_t ps_read( options_t *p_options, ps_t * p_ps, void *ts ) ...@@ -860,7 +864,7 @@ ssize_t ps_read( options_t *p_options, ps_t * p_ps, void *ts )
{ {
case VIDEO_PES: case VIDEO_PES:
case AUDIO_PES: case AUDIO_PES:
case SUBTITLE_PES: case SUBTITLE_PES:
case AC3_PES: case AC3_PES:
pid = get_pid (p_ps); pid = get_pid (p_ps);
write_media_ts(p_ps, ts, pid); write_media_ts(p_ps, ts, pid);
...@@ -927,7 +931,6 @@ void ps_fill( input_file_t * p_if, boolean_t wait ) ...@@ -927,7 +931,6 @@ void ps_fill( input_file_t * p_if, boolean_t wait )
if( ps_read( &p_if->options, p_ps, ts = (file_ts_packet *)(p_in_data->buf + p_in_data->end) ) != how_many ) if( ps_read( &p_if->options, p_ps, ts = (file_ts_packet *)(p_in_data->buf + p_in_data->end) ) != how_many )
{ {
msleep( 50000 ); /* XXX we need an INPUT_IDLE */ msleep( 50000 ); /* XXX we need an INPUT_IDLE */
intf_ErrMsg( "input error: read() error\n" );
return; return;
} }
...@@ -1019,7 +1022,8 @@ int input_FileOpen( input_thread_t *p_input ) ...@@ -1019,7 +1022,8 @@ int input_FileOpen( input_thread_t *p_input )
if( file_next( p_options ) < 0 ) if( file_next( p_options ) < 0 )
{ {
intf_ErrMsg( "input error: cannot open the file %s", p_input->p_source ); intf_ErrMsg( "input error: cannot open the file %s",
p_input->p_source );
} }
input_file.b_die = 0; input_file.b_die = 0;
...@@ -1039,8 +1043,7 @@ int input_FileOpen( input_thread_t *p_input ) ...@@ -1039,8 +1043,7 @@ int input_FileOpen( input_thread_t *p_input )
return( 1 ); return( 1 );
} }
return( 0 );
return( 0 );
} }
/***************************************************************************** /*****************************************************************************
...@@ -1063,8 +1066,15 @@ int input_FileRead( input_thread_t *p_input, const struct iovec *p_vector, ...@@ -1063,8 +1066,15 @@ int input_FileRead( input_thread_t *p_input, const struct iovec *p_vector,
vlc_mutex_lock( &p_in_data->lock ); vlc_mutex_lock( &p_in_data->lock );
while( p_in_data->end == p_in_data->start ) while( p_in_data->end == p_in_data->start )
{ {
if( !input_file.b_die ) if( input_file.b_die )
vlc_cond_wait( &p_in_data->notempty, &p_in_data->lock ); {
vlc_mutex_unlock( &p_in_data->lock );
/* wait 1 second, like the network input */
msleep( 1000000 );
return( 0 );
}
vlc_cond_wait( &p_in_data->notempty, &p_in_data->lock );
} }
vlc_mutex_unlock( &p_in_data->lock ); vlc_mutex_unlock( &p_in_data->lock );
...@@ -1093,7 +1103,7 @@ int input_FileRead( input_thread_t *p_input, const struct iovec *p_vector, ...@@ -1093,7 +1103,7 @@ int input_FileRead( input_thread_t *p_input, const struct iovec *p_vector,
vlc_cond_signal(&p_in_data->notfull); vlc_cond_signal(&p_in_data->notfull);
vlc_mutex_unlock(&p_in_data->lock); vlc_mutex_unlock(&p_in_data->lock);
return( 188*howmany ); return( 188 * howmany );
} }
/***************************************************************************** /*****************************************************************************
...@@ -1107,3 +1117,4 @@ void input_FileClose( input_thread_t *p_input ) ...@@ -1107,3 +1117,4 @@ void input_FileClose( input_thread_t *p_input )
close( input_file.options.in ); close( input_file.options.in );
} }
...@@ -158,7 +158,7 @@ void vpar_SynchroUpdateStructures( vpar_thread_t * p_vpar, ...@@ -158,7 +158,7 @@ void vpar_SynchroUpdateStructures( vpar_thread_t * p_vpar,
} }
} }
#if 1 #if 0
if( p_vpar->synchro.b_all_I ) if( p_vpar->synchro.b_all_I )
intf_ErrMsg( " I: 1024/1024 " ); intf_ErrMsg( " I: 1024/1024 " );
......
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