Commit 7689bc92 authored by Sam Hocevar's avatar Sam Hocevar

* ./modules/audio_output/oss.c: compilation fixes.

  * ALL: lots of -ansi -pedantic fixes.
parent 123b3214
...@@ -148,7 +148,7 @@ mozilla-clean: ...@@ -148,7 +148,7 @@ mozilla-clean:
distclean: clean distclean: clean
-cd po && $(MAKE) maintainer-clean -cd po && $(MAKE) maintainer-clean
rm -f **/*.o **/*~ *.log rm -f **/*.o **/*~ *.log
rm -f Makefile.opts Makefile.config rm -f Makefile.opts Makefile.config vlc-config
rm -f include/defs.h include/modules_builtin.h rm -f include/defs.h include/modules_builtin.h
rm -f src/misc/modules_builtin.h rm -f src/misc/modules_builtin.h
rm -f config*status config*cache config*log conftest* rm -f config*status config*cache config*log conftest*
......
...@@ -55,7 +55,7 @@ all: ...@@ -55,7 +55,7 @@ all:
clean: clean:
# rm -f $(PLUGIN_ALL) $(BUILTIN_ALL) # rm -f $(PLUGIN_ALL) $(BUILTIN_ALL)
rm -f *.o *.o.* *.lo *.lo.* *.obj *.moc *.moc.* *.bak rm -f *.a *.so *.o *.o.* *.lo.* *.obj *.moc *.moc.* *.bak
rm -Rf .dep rm -Rf .dep
FORCE: FORCE:
......
...@@ -97,7 +97,6 @@ arts_LDFLAGS = @arts_LDFLAGS@ ...@@ -97,7 +97,6 @@ arts_LDFLAGS = @arts_LDFLAGS@
beos_LDFLAGS = @beos_LDFLAGS@ beos_LDFLAGS = @beos_LDFLAGS@
i420_rgb_LDFLAGS = @i420_rgb_LDFLAGS@ i420_rgb_LDFLAGS = @i420_rgb_LDFLAGS@
directx_LDFLAGS = @directx_LDFLAGS@ directx_LDFLAGS = @directx_LDFLAGS@
dsp_LDFLAGS = @dsp_LDFLAGS@
dv_LDFLAGS = @dv_LDFLAGS@ dv_LDFLAGS = @dv_LDFLAGS@
dvd_LDFLAGS = @dvd_LDFLAGS@ dvd_LDFLAGS = @dvd_LDFLAGS@
dvdread_LDFLAGS = @dvdread_LDFLAGS@ dvdread_LDFLAGS = @dvdread_LDFLAGS@
...@@ -124,12 +123,13 @@ macosx_LDFLAGS = @macosx_LDFLAGS@ ...@@ -124,12 +123,13 @@ macosx_LDFLAGS = @macosx_LDFLAGS@
mad_LDFLAGS = @mad_LDFLAGS@ mad_LDFLAGS = @mad_LDFLAGS@
memcpyaltivec_LDFLAGS = @memcpyaltivec_LDFLAGS@ memcpyaltivec_LDFLAGS = @memcpyaltivec_LDFLAGS@
motionaltivec_LDFLAGS = @motionaltivec_LDFLAGS@ motionaltivec_LDFLAGS = @motionaltivec_LDFLAGS@
ts_dvbpsi_LDFLAGS = @ts_dvbpsi_LDFLAGS@
ncurses_LDFLAGS = @ncurses_LDFLAGS@ ncurses_LDFLAGS = @ncurses_LDFLAGS@
oss_LDFLAGS = @oss_LDFLAGS@
qnx_LDFLAGS = @qnx_LDFLAGS@ qnx_LDFLAGS = @qnx_LDFLAGS@
qt_LDFLAGS = @qt_LDFLAGS@ qt_LDFLAGS = @qt_LDFLAGS@
rc_LDFLAGS = @rc_LDFLAGS@ rc_LDFLAGS = @rc_LDFLAGS@
sdl_LDFLAGS = @sdl_LDFLAGS@ sdl_LDFLAGS = @sdl_LDFLAGS@
ts_dvbpsi_LDFLAGS = @ts_dvbpsi_LDFLAGS@
vcd_LDFLAGS = @vcd_LDFLAGS@ vcd_LDFLAGS = @vcd_LDFLAGS@
vorbis_LDFLAGS = @vorbis_LDFLAGS@ vorbis_LDFLAGS = @vorbis_LDFLAGS@
waveout_LDFLAGS = @waveout_LDFLAGS@ waveout_LDFLAGS = @waveout_LDFLAGS@
......
...@@ -8040,7 +8040,7 @@ if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then ...@@ -8040,7 +8040,7 @@ if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
#define $ac_tr_hdr 1 #define $ac_tr_hdr 1
EOF EOF
#PLUGINS="${PLUGINS} audio_output/oss" PLUGINS="${PLUGINS} audio_output/oss"
echo $ac_n "checking for main in -lossaudio""... $ac_c" 1>&6 echo $ac_n "checking for main in -lossaudio""... $ac_c" 1>&6
echo "configure:8046: checking for main in -lossaudio" >&5 echo "configure:8046: checking for main in -lossaudio" >&5
ac_lib_var=`echo ossaudio'_'main | sed 'y%./+-%__p_%'` ac_lib_var=`echo ossaudio'_'main | sed 'y%./+-%__p_%'`
...@@ -8072,7 +8072,7 @@ LIBS="$ac_save_LIBS" ...@@ -8072,7 +8072,7 @@ LIBS="$ac_save_LIBS"
fi fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
echo "$ac_t""yes" 1>&6 echo "$ac_t""yes" 1>&6
dsp_LDFLAGS="${dsp_LDFLAGS} -lossaudio" oss_LDFLAGS="${oss_LDFLAGS} -lossaudio"
else else
echo "$ac_t""no" 1>&6 echo "$ac_t""no" 1>&6
fi fi
...@@ -9421,7 +9421,7 @@ CFLAGS="${save_CFLAGS}" ...@@ -9421,7 +9421,7 @@ CFLAGS="${save_CFLAGS}"
LDFLAGS="${save_LDFLAGS}" LDFLAGS="${save_LDFLAGS}"
libvlc_LDFLAGS="${vlc_LDFLAGS} ${builtins_LDFLAGS}" libvlc_LDFLAGS="${vlc_LDFLAGS} ${builtins_LDFLAGS}"
for i in ${BUILTINS} ; do libvlc_LDFLAGS="${libvlc_LDFLAGS} ${libdir}/vlc/${i}.a `eval echo '$'{${i}_LDFLAGS}`" ; done for i in `echo ${BUILTINS} | sed -e 's#[^ ]*/##g'` ; do libvlc_LDFLAGS="${libvlc_LDFLAGS} ${libdir}/vlc/${i}.a `eval echo '$'{${i}_LDFLAGS}`" ; done
...@@ -9781,7 +9781,6 @@ s%@arts_LDFLAGS@%$arts_LDFLAGS%g ...@@ -9781,7 +9781,6 @@ s%@arts_LDFLAGS@%$arts_LDFLAGS%g
s%@beos_LDFLAGS@%$beos_LDFLAGS%g s%@beos_LDFLAGS@%$beos_LDFLAGS%g
s%@i420_rgb_LDFLAGS@%$i420_rgb_LDFLAGS%g s%@i420_rgb_LDFLAGS@%$i420_rgb_LDFLAGS%g
s%@directx_LDFLAGS@%$directx_LDFLAGS%g s%@directx_LDFLAGS@%$directx_LDFLAGS%g
s%@dsp_LDFLAGS@%$dsp_LDFLAGS%g
s%@dv_LDFLAGS@%$dv_LDFLAGS%g s%@dv_LDFLAGS@%$dv_LDFLAGS%g
s%@dvd_LDFLAGS@%$dvd_LDFLAGS%g s%@dvd_LDFLAGS@%$dvd_LDFLAGS%g
s%@dvdread_LDFLAGS@%$dvdread_LDFLAGS%g s%@dvdread_LDFLAGS@%$dvdread_LDFLAGS%g
...@@ -9810,6 +9809,7 @@ s%@mad_LDFLAGS@%$mad_LDFLAGS%g ...@@ -9810,6 +9809,7 @@ s%@mad_LDFLAGS@%$mad_LDFLAGS%g
s%@memcpyaltivec_LDFLAGS@%$memcpyaltivec_LDFLAGS%g s%@memcpyaltivec_LDFLAGS@%$memcpyaltivec_LDFLAGS%g
s%@motionaltivec_LDFLAGS@%$motionaltivec_LDFLAGS%g s%@motionaltivec_LDFLAGS@%$motionaltivec_LDFLAGS%g
s%@ncurses_LDFLAGS@%$ncurses_LDFLAGS%g s%@ncurses_LDFLAGS@%$ncurses_LDFLAGS%g
s%@oss_LDFLAGS@%$oss_LDFLAGS%g
s%@qnx_LDFLAGS@%$qnx_LDFLAGS%g s%@qnx_LDFLAGS@%$qnx_LDFLAGS%g
s%@qt_LDFLAGS@%$qt_LDFLAGS%g s%@qt_LDFLAGS@%$qt_LDFLAGS%g
s%@rc_LDFLAGS@%$rc_LDFLAGS%g s%@rc_LDFLAGS@%$rc_LDFLAGS%g
......
...@@ -1408,8 +1408,8 @@ if test "x${enable_oss}" != "xno" && ...@@ -1408,8 +1408,8 @@ if test "x${enable_oss}" != "xno" &&
(test "x${SYS}" != "xmingw32" || test "x${enable_oss}" = "xyes") (test "x${SYS}" != "xmingw32" || test "x${enable_oss}" = "xyes")
then then
AC_CHECK_HEADERS(soundcard.h sys/soundcard.h machine/soundcard.h, [ AC_CHECK_HEADERS(soundcard.h sys/soundcard.h machine/soundcard.h, [
#PLUGINS="${PLUGINS} audio_output/oss" PLUGINS="${PLUGINS} audio_output/oss"
AC_CHECK_LIB(ossaudio,main,dsp_LDFLAGS="${dsp_LDFLAGS} -lossaudio") AC_CHECK_LIB(ossaudio,main,oss_LDFLAGS="${oss_LDFLAGS} -lossaudio")
]) ])
fi fi
...@@ -1909,7 +1909,7 @@ dnl ...@@ -1909,7 +1909,7 @@ dnl
dnl Create the vlc-config script dnl Create the vlc-config script
dnl dnl
libvlc_LDFLAGS="${vlc_LDFLAGS} ${builtins_LDFLAGS}" libvlc_LDFLAGS="${vlc_LDFLAGS} ${builtins_LDFLAGS}"
for i in ${BUILTINS} ; do libvlc_LDFLAGS="${libvlc_LDFLAGS} ${libdir}/vlc/${i}.a `eval echo '$'{${i}_LDFLAGS}`" ; done for i in `echo ${BUILTINS} | sed -e 's#[^ ]*/##g'` ; do libvlc_LDFLAGS="${libvlc_LDFLAGS} ${libdir}/vlc/${i}.a `eval echo '$'{${i}_LDFLAGS}`" ; done
AC_SUBST(libvlc_LDFLAGS) AC_SUBST(libvlc_LDFLAGS)
dnl dnl
...@@ -1981,7 +1981,6 @@ AC_SUBST(arts_LDFLAGS) ...@@ -1981,7 +1981,6 @@ AC_SUBST(arts_LDFLAGS)
AC_SUBST(beos_LDFLAGS) AC_SUBST(beos_LDFLAGS)
AC_SUBST(i420_rgb_LDFLAGS) AC_SUBST(i420_rgb_LDFLAGS)
AC_SUBST(directx_LDFLAGS) AC_SUBST(directx_LDFLAGS)
AC_SUBST(dsp_LDFLAGS)
AC_SUBST(dv_LDFLAGS) AC_SUBST(dv_LDFLAGS)
AC_SUBST(dvd_LDFLAGS) AC_SUBST(dvd_LDFLAGS)
AC_SUBST(dvdread_LDFLAGS) AC_SUBST(dvdread_LDFLAGS)
...@@ -2010,6 +2009,7 @@ AC_SUBST(mad_LDFLAGS) ...@@ -2010,6 +2009,7 @@ AC_SUBST(mad_LDFLAGS)
AC_SUBST(memcpyaltivec_LDFLAGS) AC_SUBST(memcpyaltivec_LDFLAGS)
AC_SUBST(motionaltivec_LDFLAGS) AC_SUBST(motionaltivec_LDFLAGS)
AC_SUBST(ncurses_LDFLAGS) AC_SUBST(ncurses_LDFLAGS)
AC_SUBST(oss_LDFLAGS)
AC_SUBST(qnx_LDFLAGS) AC_SUBST(qnx_LDFLAGS)
AC_SUBST(qt_LDFLAGS) AC_SUBST(qt_LDFLAGS)
AC_SUBST(rc_LDFLAGS) AC_SUBST(rc_LDFLAGS)
......
...@@ -2,7 +2,7 @@ Source: vlc ...@@ -2,7 +2,7 @@ Source: vlc
Section: graphics Section: graphics
Priority: optional Priority: optional
Maintainer: Samuel Hocevar <sam@zoy.org> Maintainer: Samuel Hocevar <sam@zoy.org>
Build-Depends: debhelper (>=2.2.0), xlibs-dev, xlibs-pic, libgnome-dev, libggi2-dev, libglide2-dev [i386], libesd0-dev, libsdl1.2-dev (>=1.2.2-3.1), libqt-dev, libasound2-dev (>=0.9.0beta10a), libarts-dev, libmad0-dev, liblircclient-dev, a52dec-dev, aalib1-dev, libdvbpsi1-dev, mozilla-dev, kdelibs-dev Build-Depends: debhelper (>=2.2.0), xlibs-dev, xlibs-pic, libgnome-dev, libggi2-dev, libglide2-dev [i386], libesd0-dev, libsdl1.2-dev (>=1.2.2-3.1), libqt-dev, libasound2-dev (>=0.9.0beta10a), libarts-dev, libmad0-dev, liblircclient-dev, a52dec-dev, aalib1-dev, libdvbpsi1-dev, mozilla-dev, kdelibs-dev, dvb-dev, libdv-dev
Standards-Version: 3.5.6 Standards-Version: 3.5.6
Package: vlc Package: vlc
...@@ -23,7 +23,7 @@ Description: development files for the VideoLAN Client ...@@ -23,7 +23,7 @@ Description: development files for the VideoLAN Client
VideoLAN is a free MPEG, MPEG2, DVD and DivX software solution. VideoLAN is a free MPEG, MPEG2, DVD and DivX software solution.
. .
This package contains headers and a static library required to build plugins This package contains headers and a static library required to build plugins
for the Videolan Client, or standalone applications using VideoLAN Client. for the VideoLAN Client, or standalone applications using VideoLAN Client.
Package: gnome-vlc Package: gnome-vlc
Architecture: any Architecture: any
......
...@@ -10,7 +10,7 @@ export DH_COMPAT=3 ...@@ -10,7 +10,7 @@ export DH_COMPAT=3
# Compilation options # Compilation options
export FFMPEG_VERSION=cvs export FFMPEG_VERSION=cvs
export CONFIG_FLAGS="--enable-release --prefix=/usr --enable-gnome --enable-gtk --enable-fb --enable-ggi --enable-sdl --enable-esd --enable-qt --enable-mad --enable-arts --enable-alsa --enable-lirc --enable-a52 --enable-aa --enable-dvbpsi --enable-xosd --enable-mozilla --enable-kde --enable-ffmpeg --with-ffmpeg-tree=ffmpeg-$(FFMPEG_VERSION) --enable-mp4" export CONFIG_FLAGS="--enable-release --prefix=/usr --enable-gnome --enable-gtk --enable-fb --enable-ggi --enable-sdl --enable-esd --enable-qt --enable-mad --enable-arts --enable-alsa --enable-lirc --enable-a52 --enable-aa --enable-dvbpsi --enable-xosd --enable-mozilla --enable-kde --enable-ffmpeg --with-ffmpeg-tree=ffmpeg-$(FFMPEG_VERSION) --enable-mp4 --enable-dvb --enable-dv"
# Remove --without-dvdcss here in non-totalitarian countries # Remove --without-dvdcss here in non-totalitarian countries
export DVDCSS_FLAGS="--enable-dvd --without-dvdcss" export DVDCSS_FLAGS="--enable-dvd --without-dvdcss"
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* aout_internal.h : internal defines for audio output * aout_internal.h : internal defines for audio output
***************************************************************************** *****************************************************************************
* Copyright (C) 2002 VideoLAN * Copyright (C) 2002 VideoLAN
* $Id: aout_internal.h,v 1.1 2002/08/07 21:36:55 massiot Exp $ * $Id: aout_internal.h,v 1.2 2002/08/08 00:35:10 sam Exp $
* *
* Authors: Christophe Massiot <massiot@via.ecp.fr> * Authors: Christophe Massiot <massiot@via.ecp.fr>
* *
...@@ -57,7 +57,7 @@ typedef struct aout_alloc_t ...@@ -57,7 +57,7 @@ typedef struct aout_alloc_t
(p_new_buffer)->i_alloc_type = (p_alloc)->i_alloc_type; \ (p_new_buffer)->i_alloc_type = (p_alloc)->i_alloc_type; \
(p_new_buffer)->i_size = (u64)(p_alloc)->i_bytes_per_sec \ (p_new_buffer)->i_size = (u64)(p_alloc)->i_bytes_per_sec \
* i_nb_usec / 1000000 + 1; \ * i_nb_usec / 1000000 + 1; \
(p_new_buffer)->p_buffer = (void *)(p_new_buffer) \ (p_new_buffer)->p_buffer = (byte_t *)(p_new_buffer) \
+ sizeof(aout_buffer_t); \ + sizeof(aout_buffer_t); \
if ( (p_previous_buffer) != NULL ) \ if ( (p_previous_buffer) != NULL ) \
{ \ { \
...@@ -184,7 +184,7 @@ struct aout_input_t ...@@ -184,7 +184,7 @@ struct aout_input_t
aout_fifo_t fifo; aout_fifo_t fifo;
char * p_first_byte_to_mix; byte_t * p_first_byte_to_mix;
}; };
/***************************************************************************** /*****************************************************************************
...@@ -263,4 +263,3 @@ int aout_OutputNew( aout_instance_t * p_aout, ...@@ -263,4 +263,3 @@ int aout_OutputNew( aout_instance_t * p_aout,
void aout_OutputPlay( aout_instance_t * p_aout, aout_buffer_t * p_buffer ); void aout_OutputPlay( aout_instance_t * p_aout, aout_buffer_t * p_buffer );
void aout_OutputDelete( aout_instance_t * p_aout ); void aout_OutputDelete( aout_instance_t * p_aout );
int aout_FormatToBytes( audio_sample_format_t * p_format );
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* audio_output.h : audio output interface * audio_output.h : audio output interface
***************************************************************************** *****************************************************************************
* Copyright (C) 2002 VideoLAN * Copyright (C) 2002 VideoLAN
* $Id: audio_output.h,v 1.52 2002/08/07 21:36:55 massiot Exp $ * $Id: audio_output.h,v 1.53 2002/08/08 00:35:10 sam Exp $
* *
* Authors: Christophe Massiot <massiot@via.ecp.fr> * Authors: Christophe Massiot <massiot@via.ecp.fr>
* *
...@@ -65,7 +65,7 @@ struct audio_sample_format_t ...@@ -65,7 +65,7 @@ struct audio_sample_format_t
*****************************************************************************/ *****************************************************************************/
struct aout_buffer_t struct aout_buffer_t
{ {
char * p_buffer; byte_t * p_buffer;
int i_alloc_type; int i_alloc_type;
size_t i_size; size_t i_size;
int i_nb_samples; int i_nb_samples;
...@@ -84,6 +84,7 @@ VLC_EXPORT( void, aout_DeleteInstance, ( aout_instance_t * ) ); ...@@ -84,6 +84,7 @@ VLC_EXPORT( void, aout_DeleteInstance, ( aout_instance_t * ) );
VLC_EXPORT( aout_buffer_t *, aout_BufferNew, ( aout_instance_t *, aout_input_t *, size_t ) ); VLC_EXPORT( aout_buffer_t *, aout_BufferNew, ( aout_instance_t *, aout_input_t *, size_t ) );
VLC_EXPORT( void, aout_BufferDelete, ( aout_instance_t *, aout_input_t *, aout_buffer_t * ) ); VLC_EXPORT( void, aout_BufferDelete, ( aout_instance_t *, aout_input_t *, aout_buffer_t * ) );
VLC_EXPORT( void, aout_BufferPlay, ( aout_instance_t *, aout_input_t *, aout_buffer_t * ) ); VLC_EXPORT( void, aout_BufferPlay, ( aout_instance_t *, aout_input_t *, aout_buffer_t * ) );
VLC_EXPORT( int, aout_FormatToBytes, ( audio_sample_format_t * p_format ) );
/* From input.c : */ /* From input.c : */
#define aout_InputNew(a,b,c) __aout_InputNew(VLC_OBJECT(a),b,c) #define aout_InputNew(a,b,c) __aout_InputNew(VLC_OBJECT(a),b,c)
......
This diff is collapsed.
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* input_ext-dec.h: structures exported to the VideoLAN decoders * input_ext-dec.h: structures exported to the VideoLAN decoders
***************************************************************************** *****************************************************************************
* Copyright (C) 1999-2001 VideoLAN * Copyright (C) 1999-2001 VideoLAN
* $Id: input_ext-dec.h,v 1.67 2002/08/07 00:29:36 sam Exp $ * $Id: input_ext-dec.h,v 1.68 2002/08/08 00:35:10 sam Exp $
* *
* Authors: Christophe Massiot <massiot@via.ecp.fr> * Authors: Christophe Massiot <massiot@via.ecp.fr>
* Michel Kaempf <maxx@via.ecp.fr> * Michel Kaempf <maxx@via.ecp.fr>
...@@ -312,7 +312,8 @@ static inline void RemoveBits( bit_stream_t * p_bit_stream, ...@@ -312,7 +312,8 @@ static inline void RemoveBits( bit_stream_t * p_bit_stream,
{ {
p_bit_stream->fifo.buffer = WORD_AT( p_bit_stream->p_byte ) p_bit_stream->fifo.buffer = WORD_AT( p_bit_stream->p_byte )
<< ( -p_bit_stream->fifo.i_available ); << ( -p_bit_stream->fifo.i_available );
((WORD_TYPE *)p_bit_stream->p_byte)++; p_bit_stream->p_byte =
(byte_t *) ( ((WORD_TYPE *)p_bit_stream->p_byte) + 1 );
p_bit_stream->fifo.i_available += sizeof(WORD_TYPE) * 8; p_bit_stream->fifo.i_available += sizeof(WORD_TYPE) * 8;
return; return;
} }
...@@ -333,11 +334,13 @@ static inline void RemoveBits32( bit_stream_t * p_bit_stream ) ...@@ -333,11 +334,13 @@ static inline void RemoveBits32( bit_stream_t * p_bit_stream )
{ {
p_bit_stream->fifo.buffer = WORD_AT( p_bit_stream->p_byte ) p_bit_stream->fifo.buffer = WORD_AT( p_bit_stream->p_byte )
<< (32 - p_bit_stream->fifo.i_available); << (32 - p_bit_stream->fifo.i_available);
((WORD_TYPE *)p_bit_stream->p_byte)++; p_bit_stream->p_byte =
(byte_t *) ( ((WORD_TYPE *)p_bit_stream->p_byte) + 1 );
return; return;
} }
((WORD_TYPE *)p_bit_stream->p_byte)++; p_bit_stream->p_byte =
(byte_t *) ( ((WORD_TYPE *)p_bit_stream->p_byte) + 1 );
return; return;
} }
...@@ -371,7 +374,8 @@ static inline u32 GetBits( bit_stream_t * p_bit_stream, unsigned int i_bits ) ...@@ -371,7 +374,8 @@ static inline u32 GetBits( bit_stream_t * p_bit_stream, unsigned int i_bits )
i_result = p_bit_stream->fifo.buffer i_result = p_bit_stream->fifo.buffer
>> (8 * sizeof(WORD_TYPE) - i_bits); >> (8 * sizeof(WORD_TYPE) - i_bits);
p_bit_stream->fifo.buffer = WORD_AT( p_bit_stream->p_byte ); p_bit_stream->fifo.buffer = WORD_AT( p_bit_stream->p_byte );
((WORD_TYPE *)p_bit_stream->p_byte)++; p_bit_stream->p_byte =
(byte_t *) ( ((WORD_TYPE *)p_bit_stream->p_byte) + 1 );
i_result |= p_bit_stream->fifo.buffer i_result |= p_bit_stream->fifo.buffer
>> (8 * sizeof(WORD_TYPE) >> (8 * sizeof(WORD_TYPE)
+ p_bit_stream->fifo.i_available); + p_bit_stream->fifo.i_available);
...@@ -429,7 +433,8 @@ static inline u32 GetBits32( bit_stream_t * p_bit_stream ) ...@@ -429,7 +433,8 @@ static inline u32 GetBits32( bit_stream_t * p_bit_stream )
{ {
i_result = p_bit_stream->fifo.buffer; i_result = p_bit_stream->fifo.buffer;
p_bit_stream->fifo.buffer = WORD_AT( p_bit_stream->p_byte ); p_bit_stream->fifo.buffer = WORD_AT( p_bit_stream->p_byte );
((WORD_TYPE *)p_bit_stream->p_byte)++; p_bit_stream->p_byte =
(byte_t *) ( ((WORD_TYPE *)p_bit_stream->p_byte) + 1 );
i_result |= p_bit_stream->fifo.buffer i_result |= p_bit_stream->fifo.buffer
>> (p_bit_stream->fifo.i_available); >> (p_bit_stream->fifo.i_available);
p_bit_stream->fifo.buffer <<= (32 - p_bit_stream->fifo.i_available); p_bit_stream->fifo.buffer <<= (32 - p_bit_stream->fifo.i_available);
...@@ -437,7 +442,8 @@ static inline u32 GetBits32( bit_stream_t * p_bit_stream ) ...@@ -437,7 +442,8 @@ static inline u32 GetBits32( bit_stream_t * p_bit_stream )
} }
i_result = WORD_AT( p_bit_stream->p_byte ); i_result = WORD_AT( p_bit_stream->p_byte );
((WORD_TYPE *)p_bit_stream->p_byte)++; p_bit_stream->p_byte =
(byte_t *) ( ((WORD_TYPE *)p_bit_stream->p_byte) + 1 );
return( i_result ); return( i_result );
} }
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
* but exported to plug-ins * but exported to plug-ins
***************************************************************************** *****************************************************************************
* Copyright (C) 1999-2002 VideoLAN * Copyright (C) 1999-2002 VideoLAN
* $Id: input_ext-plugins.h,v 1.34 2002/08/07 00:29:36 sam Exp $ * $Id: input_ext-plugins.h,v 1.35 2002/08/08 00:35:10 sam Exp $
* *
* Authors: Christophe Massiot <massiot@via.ecp.fr> * Authors: Christophe Massiot <massiot@via.ecp.fr>
* *
...@@ -55,7 +55,6 @@ VLC_EXPORT( int, input_UnselectES,( input_thread_t *, es_descriptor_t * ) ); ...@@ -55,7 +55,6 @@ VLC_EXPORT( int, input_UnselectES,( input_thread_t *, es_descriptor_t * ) );
/***************************************************************************** /*****************************************************************************
* Prototypes from input_dec.c * Prototypes from input_dec.c
*****************************************************************************/ *****************************************************************************/
//decoder_capabilities_t * input_ProbeDecoder( void );
decoder_fifo_t * input_RunDecoder( input_thread_t *, es_descriptor_t * ); decoder_fifo_t * input_RunDecoder( input_thread_t *, es_descriptor_t * );
void input_EndDecoder( input_thread_t *, es_descriptor_t * ); void input_EndDecoder( input_thread_t *, es_descriptor_t * );
VLC_EXPORT( void, input_DecodePES, ( decoder_fifo_t *, pes_packet_t * ) ); VLC_EXPORT( void, input_DecodePES, ( decoder_fifo_t *, pes_packet_t * ) );
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* modules_inner.h : Macros used from within a module. * modules_inner.h : Macros used from within a module.
***************************************************************************** *****************************************************************************
* Copyright (C) 2001 VideoLAN * Copyright (C) 2001 VideoLAN
* $Id: modules_inner.h,v 1.27 2002/08/04 08:45:35 sam Exp $ * $Id: modules_inner.h,v 1.28 2002/08/08 00:35:10 sam Exp $
* *
* Authors: Samuel Hocevar <sam@zoy.org> * Authors: Samuel Hocevar <sam@zoy.org>
* *
...@@ -55,13 +55,13 @@ ...@@ -55,13 +55,13 @@
#if defined( __BUILTIN__ ) #if defined( __BUILTIN__ )
# define E_( function ) CONCATENATE( function, MODULE_NAME ) # define E_( function ) CONCATENATE( function, MODULE_NAME )
# define __VLC_SYMBOL( symbol ) CONCATENATE( symbol, MODULE_NAME ) # define __VLC_SYMBOL( symbol ) CONCATENATE( symbol, MODULE_NAME )
# define DECLARE_SYMBOLS ; # define DECLARE_SYMBOLS struct _u_n_u_s_e_d_
# define STORE_SYMBOLS ; # define STORE_SYMBOLS struct _u_n_u_s_e_d_
#elif defined( __PLUGIN__ ) #elif defined( __PLUGIN__ )
# define E_( function ) function # define E_( function ) function
# define __VLC_SYMBOL( symbol ) CONCATENATE( symbol, MODULE_SYMBOL ) # define __VLC_SYMBOL( symbol ) CONCATENATE( symbol, MODULE_SYMBOL )
# define DECLARE_SYMBOLS module_symbols_t* p_symbols; # define DECLARE_SYMBOLS module_symbols_t* p_symbols
# define STORE_SYMBOLS p_symbols = p_module->p_symbols; # define STORE_SYMBOLS p_symbols = p_module->p_symbols
#endif #endif
#if defined( __cplusplus ) #if defined( __cplusplus )
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
* thread, and destroy a previously opened video output thread. * thread, and destroy a previously opened video output thread.
***************************************************************************** *****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN * Copyright (C) 1999, 2000 VideoLAN
* $Id: video_output.h,v 1.82 2002/07/31 20:56:50 sam Exp $ * $Id: video_output.h,v 1.83 2002/08/08 00:35:10 sam Exp $
* *
* Authors: Vincent Seguin <seguin@via.ecp.fr> * Authors: Vincent Seguin <seguin@via.ecp.fr>
* Samuel Hocevar <sam@via.ecp.fr> * Samuel Hocevar <sam@via.ecp.fr>
...@@ -158,9 +158,6 @@ struct vout_thread_t ...@@ -158,9 +158,6 @@ struct vout_thread_t
#define VOUT_DEPTH_CHANGE 0x0400 /* depth changed */ #define VOUT_DEPTH_CHANGE 0x0400 /* depth changed */
#define VOUT_CHROMA_CHANGE 0x0800 /* change chroma tables */ #define VOUT_CHROMA_CHANGE 0x0800 /* change chroma tables */
/* Disabled for thread deadlocks issues --Meuuh */
//#define VOUT_NODISPLAY_CHANGE 0xff00 /* changes which forbidden display */
#define MAX_JITTER_SAMPLES 20 #define MAX_JITTER_SAMPLES 20
/***************************************************************************** /*****************************************************************************
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* vlc.h: global header for vlc * vlc.h: global header for vlc
***************************************************************************** *****************************************************************************
* Copyright (C) 1998, 1999, 2000 VideoLAN * Copyright (C) 1998, 1999, 2000 VideoLAN
* $Id: vlc.h,v 1.6 2002/07/20 18:01:42 sam Exp $ * $Id: vlc.h,v 1.7 2002/08/08 00:35:10 sam Exp $
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
...@@ -29,10 +29,11 @@ extern "C" { ...@@ -29,10 +29,11 @@ extern "C" {
/***************************************************************************** /*****************************************************************************
* Our custom types * Our custom types
*****************************************************************************/ *****************************************************************************/
#define VLC_DECLARE_STRUCT( name ) struct name; typedef struct name name; struct vlc_t;
struct vlc_object_t;
VLC_DECLARE_STRUCT(vlc_t) typedef struct vlc_t vlc_t;
VLC_DECLARE_STRUCT(vlc_object_t) typedef struct vlc_object_t vlc_object_t;
typedef signed int vlc_error_t; typedef signed int vlc_error_t;
typedef int vlc_bool_t; typedef int vlc_bool_t;
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
* Collection of useful common types and macros definitions * Collection of useful common types and macros definitions
***************************************************************************** *****************************************************************************
* Copyright (C) 1998, 1999, 2000 VideoLAN * Copyright (C) 1998, 1999, 2000 VideoLAN
* $Id: vlc_common.h,v 1.15 2002/08/07 21:36:55 massiot Exp $ * $Id: vlc_common.h,v 1.16 2002/08/08 00:35:10 sam Exp $
* *
* Authors: Samuel Hocevar <sam@via.ecp.fr> * Authors: Samuel Hocevar <sam@via.ecp.fr>
* Vincent Seguin <seguin@via.ecp.fr> * Vincent Seguin <seguin@via.ecp.fr>
...@@ -135,80 +135,81 @@ typedef u32 vlc_fourcc_t; ...@@ -135,80 +135,81 @@ typedef u32 vlc_fourcc_t;
*****************************************************************************/ *****************************************************************************/
/* Messages */ /* Messages */
VLC_DECLARE_STRUCT(msg_bank_t) typedef struct msg_bank_t msg_bank_t;
VLC_DECLARE_STRUCT(msg_subscription_t) typedef struct msg_subscription_t msg_subscription_t;
/* Playlist */ /* Playlist */
VLC_DECLARE_STRUCT(playlist_t) typedef struct playlist_t playlist_t;
VLC_DECLARE_STRUCT(playlist_item_t) typedef struct playlist_item_t playlist_item_t;
/* Modules */ /* Modules */
VLC_DECLARE_STRUCT(module_bank_t) typedef struct module_bank_t module_bank_t;
VLC_DECLARE_STRUCT(module_t) typedef struct module_t module_t;
VLC_DECLARE_STRUCT(module_config_t) typedef struct module_config_t module_config_t;
VLC_DECLARE_STRUCT(module_symbols_t) typedef struct module_symbols_t module_symbols_t;
/* Interface */ /* Interface */
VLC_DECLARE_STRUCT(intf_thread_t) typedef struct intf_thread_t intf_thread_t;
VLC_DECLARE_STRUCT(intf_sys_t) typedef struct intf_sys_t intf_sys_t;
VLC_DECLARE_STRUCT(intf_console_t) typedef struct intf_console_t intf_console_t;
VLC_DECLARE_STRUCT(intf_msg_t) typedef struct intf_msg_t intf_msg_t;
VLC_DECLARE_STRUCT(intf_channel_t) typedef struct intf_channel_t intf_channel_t;
/* Input */ /* Input */
VLC_DECLARE_STRUCT(input_thread_t) typedef struct input_thread_t input_thread_t;
VLC_DECLARE_STRUCT(input_channel_t) typedef struct input_channel_t input_channel_t;
VLC_DECLARE_STRUCT(input_area_t) typedef struct input_area_t input_area_t;
VLC_DECLARE_STRUCT(input_buffers_t) typedef struct input_buffers_t input_buffers_t;
VLC_DECLARE_STRUCT(input_socket_t) typedef struct input_socket_t input_socket_t;
VLC_DECLARE_STRUCT(input_info_t) typedef struct input_info_t input_info_t;
VLC_DECLARE_STRUCT(input_info_category_t) typedef struct input_info_category_t input_info_category_t;
VLC_DECLARE_STRUCT(access_sys_t) typedef struct access_sys_t access_sys_t;
VLC_DECLARE_STRUCT(demux_sys_t) typedef struct demux_sys_t demux_sys_t;
VLC_DECLARE_STRUCT(es_descriptor_t) typedef struct es_descriptor_t es_descriptor_t;
VLC_DECLARE_STRUCT(es_sys_t) typedef struct es_sys_t es_sys_t;
VLC_DECLARE_STRUCT(pgrm_descriptor_t) typedef struct pgrm_descriptor_t pgrm_descriptor_t;
VLC_DECLARE_STRUCT(pgrm_sys_t) typedef struct pgrm_sys_t pgrm_sys_t;
VLC_DECLARE_STRUCT(stream_descriptor_t) typedef struct stream_descriptor_t stream_descriptor_t;
VLC_DECLARE_STRUCT(stream_sys_t) typedef struct stream_sys_t stream_sys_t;
/* Audio */ /* Audio */
VLC_DECLARE_STRUCT(aout_instance_t) typedef struct aout_instance_t aout_instance_t;
VLC_DECLARE_STRUCT(aout_input_t) typedef struct aout_sys_t aout_sys_t;
VLC_DECLARE_STRUCT(aout_buffer_t) typedef struct aout_input_t aout_input_t;
VLC_DECLARE_STRUCT(audio_sample_format_t) typedef struct aout_buffer_t aout_buffer_t;
typedef struct audio_sample_format_t audio_sample_format_t;
/* Video */ /* Video */
VLC_DECLARE_STRUCT(vout_thread_t) typedef struct vout_thread_t vout_thread_t;
VLC_DECLARE_STRUCT(vout_font_t) typedef struct vout_font_t vout_font_t;
VLC_DECLARE_STRUCT(vout_sys_t) typedef struct vout_sys_t vout_sys_t;
VLC_DECLARE_STRUCT(chroma_sys_t) typedef struct chroma_sys_t chroma_sys_t;
VLC_DECLARE_STRUCT(picture_t) typedef struct picture_t picture_t;
VLC_DECLARE_STRUCT(picture_sys_t) typedef struct picture_sys_t picture_sys_t;
VLC_DECLARE_STRUCT(picture_heap_t) typedef struct picture_heap_t picture_heap_t;
VLC_DECLARE_STRUCT(subpicture_t) typedef struct subpicture_t subpicture_t;
VLC_DECLARE_STRUCT(subpicture_sys_t) typedef struct subpicture_sys_t subpicture_sys_t;
/* Decoders */ /* Decoders */
VLC_DECLARE_STRUCT(decoder_fifo_t) typedef struct decoder_fifo_t decoder_fifo_t;
/* Misc */ /* Misc */
VLC_DECLARE_STRUCT(data_packet_t) typedef struct data_packet_t data_packet_t;
VLC_DECLARE_STRUCT(data_buffer_t) typedef struct data_buffer_t data_buffer_t;
VLC_DECLARE_STRUCT(stream_position_t) typedef struct stream_position_t stream_position_t;
VLC_DECLARE_STRUCT(stream_ctrl_t) typedef struct stream_ctrl_t stream_ctrl_t;
VLC_DECLARE_STRUCT(pes_packet_t) typedef struct pes_packet_t pes_packet_t;
VLC_DECLARE_STRUCT(bit_stream_t) typedef struct bit_stream_t bit_stream_t;
VLC_DECLARE_STRUCT(network_socket_t) typedef struct network_socket_t network_socket_t;
VLC_DECLARE_STRUCT(iso639_lang_t) typedef struct iso639_lang_t iso639_lang_t;
/***************************************************************************** /*****************************************************************************
* Plug-in stuff * Plug-in stuff
*****************************************************************************/ *****************************************************************************/
#ifndef __PLUGIN__ #ifndef __PLUGIN__
# define VLC_EXPORT( type, name, args ) type name args; # define VLC_EXPORT( type, name, args ) type name args
#else #else
# define VLC_EXPORT( type, name, args ) ; # define VLC_EXPORT( type, name, args ) struct _u_n_u_s_e_d_
extern module_symbols_t* p_symbols; extern module_symbols_t* p_symbols;
#endif #endif
......
...@@ -36,6 +36,7 @@ struct module_symbols_t ...@@ -36,6 +36,7 @@ struct module_symbols_t
int (* __vlc_thread_create_inner) ( vlc_object_t *, char *, int, char *, void * ( * ) ( void * ), vlc_bool_t ) ; int (* __vlc_thread_create_inner) ( vlc_object_t *, char *, int, char *, void * ( * ) ( void * ), vlc_bool_t ) ;
int (* __vlc_threads_end_inner) ( vlc_object_t * ) ; int (* __vlc_threads_end_inner) ( vlc_object_t * ) ;
int (* __vlc_threads_init_inner) ( vlc_object_t * ) ; int (* __vlc_threads_init_inner) ( vlc_object_t * ) ;
int (* aout_FormatToBytes_inner) ( audio_sample_format_t * p_format ) ;
int (* input_AccessInit_inner) ( input_thread_t * ) ; int (* input_AccessInit_inner) ( input_thread_t * ) ;
int (* input_AddInfo_inner) ( input_info_category_t *, char *, char *, ... ) ; int (* input_AddInfo_inner) ( input_info_category_t *, char *, char *, ... ) ;
int (* input_ChangeArea_inner) ( input_thread_t *, input_area_t * ) ; int (* input_ChangeArea_inner) ( input_thread_t *, input_area_t * ) ;
...@@ -204,6 +205,7 @@ struct module_symbols_t ...@@ -204,6 +205,7 @@ struct module_symbols_t
# define aout_BufferNew p_symbols->aout_BufferNew_inner # define aout_BufferNew p_symbols->aout_BufferNew_inner
# define aout_BufferPlay p_symbols->aout_BufferPlay_inner # define aout_BufferPlay p_symbols->aout_BufferPlay_inner
# define aout_DeleteInstance p_symbols->aout_DeleteInstance_inner # define aout_DeleteInstance p_symbols->aout_DeleteInstance_inner
# define aout_FormatToBytes p_symbols->aout_FormatToBytes_inner
# define aout_InputDelete p_symbols->aout_InputDelete_inner # define aout_InputDelete p_symbols->aout_InputDelete_inner
# define aout_OutputNextBuffer p_symbols->aout_OutputNextBuffer_inner # define aout_OutputNextBuffer p_symbols->aout_OutputNextBuffer_inner
# define config_Duplicate p_symbols->config_Duplicate_inner # define config_Duplicate p_symbols->config_Duplicate_inner
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
* This header provides a portable threads implementation. * This header provides a portable threads implementation.
***************************************************************************** *****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN * Copyright (C) 1999, 2000 VideoLAN
* $Id: vlc_threads.h,v 1.8 2002/07/31 20:56:50 sam Exp $ * $Id: vlc_threads.h,v 1.9 2002/08/08 00:35:10 sam Exp $
* *
* Authors: Jean-Marc Dressler <polux@via.ecp.fr> * Authors: Jean-Marc Dressler <polux@via.ecp.fr>
* Samuel Hocevar <sam@via.ecp.fr> * Samuel Hocevar <sam@via.ecp.fr>
...@@ -240,8 +240,10 @@ static inline int __vlc_mutex_lock( char * psz_file, int i_line, ...@@ -240,8 +240,10 @@ static inline int __vlc_mutex_lock( char * psz_file, int i_line,
int i_return = pthread_mutex_lock( p_mutex ); int i_return = pthread_mutex_lock( p_mutex );
if( i_return ) if( i_return )
{ {
// msg_Err( "thread %d: mutex_lock failed at %s:%d (%s)", #if 0
// pthread_self(), psz_file, i_line, strerror(i_return) ); msg_Err( "thread %d: mutex_lock failed at %s:%d (%s)",
pthread_self(), psz_file, i_line, strerror(i_return) );
#endif
} }
return i_return; return i_return;
...@@ -303,8 +305,10 @@ static inline int __vlc_mutex_unlock( char * psz_file, int i_line, ...@@ -303,8 +305,10 @@ static inline int __vlc_mutex_unlock( char * psz_file, int i_line,
int i_return = pthread_mutex_unlock( p_mutex ); int i_return = pthread_mutex_unlock( p_mutex );
if( i_return ) if( i_return )
{ {
// msg_Err( "thread %d: mutex_unlock failed at %s:%d (%s)", #if 0
// pthread_self(), psz_file, i_line, strerror(i_return) ); msg_Err( "thread %d: mutex_unlock failed at %s:%d (%s)",
pthread_self(), psz_file, i_line, strerror(i_return) );
#endif
} }
return i_return; return i_return;
...@@ -665,16 +669,20 @@ static inline int __vlc_cond_wait( char * psz_file, int i_line, ...@@ -665,16 +669,20 @@ static inline int __vlc_cond_wait( char * psz_file, int i_line,
if( i_result == ETIMEDOUT ) if( i_result == ETIMEDOUT )
{ {
//X msg_Warn( "thread %d: possible deadlock detected " #if 0
//X "in cond_wait at %s:%d (%s)", pthread_self(), msg_Warn( "thread %d: possible deadlock detected "
//X psz_file, i_line, strerror(i_result) ); "in cond_wait at %s:%d (%s)", pthread_self(),
psz_file, i_line, strerror(i_result) );
#endif
continue; continue;
} }
if( i_result ) if( i_result )
{ {
//X msg_Err( "thread %d: cond_wait failed at %s:%d (%s)", #if 0
//X pthread_self(), psz_file, i_line, strerror(i_result) ); msg_Err( "thread %d: cond_wait failed at %s:%d (%s)",
pthread_self(), psz_file, i_line, strerror(i_result) );
#endif
} }
return( i_result ); return( i_result );
} }
......
This diff is collapsed.
This diff is collapsed.
/* seek.c: functions to navigate through DVD. /* seek.c: functions to navigate through DVD.
***************************************************************************** *****************************************************************************
* Copyright (C) 1998-2001 VideoLAN * Copyright (C) 1998-2001 VideoLAN
* $Id: seek.c,v 1.1 2002/08/04 17:23:41 sam Exp $ * $Id: seek.c,v 1.2 2002/08/08 00:35:10 sam Exp $
* *
* Author: Stphane Borel <stef@via.ecp.fr> * Author: Stphane Borel <stef@via.ecp.fr>
* *
...@@ -223,8 +223,10 @@ int LbMaxOnce( thread_dvd_data_t * p_dvd ) ...@@ -223,8 +223,10 @@ int LbMaxOnce( thread_dvd_data_t * p_dvd )
p_dvd->i_vts_start + p_dvd->i_vts_lb, p_dvd->i_vts_start + p_dvd->i_vts_lb,
DVDCSS_SEEK_MPEG ) < 0 ) DVDCSS_SEEK_MPEG ) < 0 )
{ {
//X intf_ErrMsg( "dvd error: %s", #if 0
//X dvdcss_error( p_dvd->dvdhandle ) ); intf_ErrMsg( "dvd error: %s",
dvdcss_error( p_dvd->dvdhandle ) );
#endif
return 0; return 0;
} }
...@@ -308,12 +310,16 @@ int DVDSetChapter( thread_dvd_data_t * p_dvd, int i_chapter ) ...@@ -308,12 +310,16 @@ int DVDSetChapter( thread_dvd_data_t * p_dvd, int i_chapter )
p_dvd->i_vts_start + p_dvd->i_vts_lb, p_dvd->i_vts_start + p_dvd->i_vts_lb,
DVDCSS_SEEK_MPEG ) < 0 ) DVDCSS_SEEK_MPEG ) < 0 )
{ {
//X intf_ErrMsg( "dvd error: %s", dvdcss_error( p_dvd->dvdhandle ) ); #if 0
intf_ErrMsg( "dvd error: %s", dvdcss_error( p_dvd->dvdhandle ) );
#endif
return -1; return -1;
} }
//X intf_WarnMsg( 4, "dvd info: chapter %d prg_cell %d map_cell %d", #if 0
//X i_chapter, p_dvd->i_prg_cell, p_dvd->i_map_cell ); 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; return i_chapter;
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
* found in .ifo. * found in .ifo.
***************************************************************************** *****************************************************************************
* Copyright (C) 1998-2001 VideoLAN * Copyright (C) 1998-2001 VideoLAN
* $Id: summary.c,v 1.1 2002/08/04 17:23:41 sam Exp $ * $Id: summary.c,v 1.2 2002/08/08 00:35:10 sam Exp $
* *
* Author: Stphane Borel <stef@via.ecp.fr> * Author: Stphane Borel <stef@via.ecp.fr>
* *
...@@ -66,11 +66,13 @@ ...@@ -66,11 +66,13 @@
****************************************************************************/ ****************************************************************************/
void IfoPrintTitle( thread_dvd_data_t * p_dvd ) void IfoPrintTitle( thread_dvd_data_t * p_dvd )
{ {
//X intf_WarnMsg( 5, "dvd info: title %d, %d chapter%s, %d angle%s", #if 0
//X p_dvd->i_title, p_dvd->i_chapter_nb, intf_WarnMsg( 5, "dvd info: title %d, %d chapter%s, %d angle%s",
//X (p_dvd->i_chapter_nb == 1) ? "" : "s", p_dvd->i_title, p_dvd->i_chapter_nb,
//X p_dvd->i_angle_nb, (p_dvd->i_chapter_nb == 1) ? "" : "s",
//X (p_dvd->i_angle_nb == 1) ? "" : "s" ); p_dvd->i_angle_nb,
(p_dvd->i_angle_nb == 1) ? "" : "s" );
#endif
} }
/**************************************************************************** /****************************************************************************
...@@ -79,39 +81,41 @@ void IfoPrintTitle( thread_dvd_data_t * p_dvd ) ...@@ -79,39 +81,41 @@ void IfoPrintTitle( thread_dvd_data_t * p_dvd )
#define video p_dvd->p_ifo->vts.manager_inf.video_attr #define video p_dvd->p_ifo->vts.manager_inf.video_attr
void IfoPrintVideo( thread_dvd_data_t * p_dvd ) void IfoPrintVideo( thread_dvd_data_t * p_dvd )
{ {
//X char* psz_perm_displ[4] = #if 0
//X { char* psz_perm_displ[4] =
//X "pan-scan & letterboxed", {
//X "pan-scan", "pan-scan & letterboxed",
//X "letterboxed", "pan-scan",
//X "not specified" "letterboxed",
//X }; "not specified"
//X char* psz_source_res[4] = };
//X { char* psz_source_res[4] =
//X "720x480 ntsc or 720x576 pal", {
//X "704x480 ntsc or 704x576 pal", "720x480 ntsc or 720x576 pal",
//X "352x480 ntsc or 352x576 pal", "704x480 ntsc or 704x576 pal",
//X "352x240 ntsc or 352x288 pal" "352x480 ntsc or 352x576 pal",
//X }; "352x240 ntsc or 352x288 pal"
};
//X intf_WarnMsg( 5, "dvd info: MPEG-%d video, %sHz, aspect ratio %s",
//X video.i_compression + 1, intf_WarnMsg( 5, "dvd info: MPEG-%d video, %sHz, aspect ratio %s",
//X video.i_system ? "pal 625 @50" : "ntsc 525 @60", video.i_compression + 1,
//X video.i_ratio ? (video.i_ratio == 3) ? "16:9" video.i_system ? "pal 625 @50" : "ntsc 525 @60",
//X : "unknown" video.i_ratio ? (video.i_ratio == 3) ? "16:9"
//X : "4:3" ); : "unknown"
: "4:3" );
//X intf_WarnMsg( 5, "dvd info: display mode %s, %s, %s",
//X psz_perm_displ[video.i_perm_displ], intf_WarnMsg( 5, "dvd info: display mode %s, %s, %s",
//X video.i_line21_1 ? "line21-1 data in GOP" psz_perm_displ[video.i_perm_displ],
//X : "no line21-1 data", video.i_line21_1 ? "line21-1 data in GOP"
//X video.i_line21_2 ? "line21-2 data in GOP" : "no line21-1 data",
//X : "no line21-2 data" ); video.i_line21_2 ? "line21-2 data in GOP"
: "no line21-2 data" );
//X intf_WarnMsg( 5, "dvd info: source is %s, %sletterboxed, %s mode",
//X psz_source_res[video.i_source_res], intf_WarnMsg( 5, "dvd info: source is %s, %sletterboxed, %s mode",
//X video.i_letterboxed ? "" : "not ", psz_source_res[video.i_source_res],
//X video.i_mode ? "film (625/50 only)" : "camera" ); video.i_letterboxed ? "" : "not ",
video.i_mode ? "film (625/50 only)" : "camera" );
#endif
} }
#undef video #undef video
...@@ -125,29 +129,31 @@ void IfoPrintAudio( thread_dvd_data_t * p_dvd, int i ) ...@@ -125,29 +129,31 @@ void IfoPrintAudio( thread_dvd_data_t * p_dvd, int i )
{ {
if( audio_status.i_available ) if( audio_status.i_available )
{ {
//X char* ppsz_mode[8] = #if 0
//X { "A52", "unknown", "MPEG", "MPEG-2", "LPCM", "SDDS", "DTS", "" }; char* ppsz_mode[8] =
//X char* ppsz_appl_mode[4] = { "A52", "unknown", "MPEG", "MPEG-2", "LPCM", "SDDS", "DTS", "" };
//X { "no application specified", "karaoke", "surround sound", "" }; char* ppsz_appl_mode[4] =
//X char* ppsz_quant[4] = { "no application specified", "karaoke", "surround sound", "" };
//X { "16 bits", "20 bits", "24 bits", "drc" }; char* ppsz_quant[4] =
{ "16 bits", "20 bits", "24 bits", "drc" };
//X intf_WarnMsg( 5, "dvd info: audio %d (%s) is %s, "
//X "%d%s channel%s, %dHz, %s", i, intf_WarnMsg( 5, "dvd info: audio %d (%s) is %s, "
//X DecodeLanguage( audio.i_lang_code ), "%d%s channel%s, %dHz, %s", i,
//X ppsz_mode[audio.i_coding_mode & 0x7], DecodeLanguage( audio.i_lang_code ),
//X audio.i_num_channels + 1, ppsz_mode[audio.i_coding_mode & 0x7],
//X audio.i_multichannel_extension ? " ext." : "", audio.i_num_channels + 1,
//X audio.i_num_channels ? "s" : "", audio.i_multichannel_extension ? " ext." : "",
//X audio.i_sample_freq ? 96000 : 48000, audio.i_num_channels ? "s" : "",
//X ppsz_appl_mode[audio.i_appl_mode & 0x3] ); audio.i_sample_freq ? 96000 : 48000,
ppsz_appl_mode[audio.i_appl_mode & 0x3] );
//X intf_WarnMsg( 5, "dvd info: %s, quantization %s, status %x",
//X (audio.i_caption == 1) ? "normal caption" intf_WarnMsg( 5, "dvd info: %s, quantization %s, status %x",
//X : (audio.i_caption == 3) ? "directors comments" (audio.i_caption == 1) ? "normal caption"
//X : "unknown caption", : (audio.i_caption == 3) ? "directors comments"
//X ppsz_quant[audio.i_quantization & 0x3], : "unknown caption",
//X audio_status.i_position ); ppsz_quant[audio.i_quantization & 0x3],
audio_status.i_position );
#endif
} }
} }
#undef audio_status #undef audio_status
...@@ -164,14 +170,16 @@ void IfoPrintSpu( thread_dvd_data_t * p_dvd, int i ) ...@@ -164,14 +170,16 @@ void IfoPrintSpu( thread_dvd_data_t * p_dvd, int i )
{ {
if( spu_status.i_available ) if( spu_status.i_available )
{ {
//X intf_WarnMsg( 5, "dvd info: spu %d (%s), caption %d " #if 0
//X "prefix %x, modes [%s%s%s%s ]", i, intf_WarnMsg( 5, "dvd info: spu %d (%s), caption %d "
//X DecodeLanguage( spu.i_lang_code ), "prefix %x, modes [%s%s%s%s ]", i,
//X spu.i_caption, spu.i_prefix, DecodeLanguage( spu.i_lang_code ),
//X spu_status.i_position_43 ? " 4:3" : "", spu.i_caption, spu.i_prefix,
//X spu_status.i_position_wide ? " wide" : "", spu_status.i_position_43 ? " 4:3" : "",
//X spu_status.i_position_letter ? " letter" : "", spu_status.i_position_wide ? " wide" : "",
//X spu_status.i_position_pan ? " pan" : "" ); spu_status.i_position_letter ? " letter" : "",
spu_status.i_position_pan ? " pan" : "" );
#endif
} }
} }
#undef spu_status #undef spu_status
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
* contains the basic udf handling functions * contains the basic udf handling functions
***************************************************************************** *****************************************************************************
* Copyright (C) 1998-2001 VideoLAN * Copyright (C) 1998-2001 VideoLAN
* $Id: udf.c,v 1.1 2002/08/04 17:23:41 sam Exp $ * $Id: udf.c,v 1.2 2002/08/08 00:35:10 sam Exp $
* *
* Author: Stphane Borel <stef@via.ecp.fr> * Author: Stphane Borel <stef@via.ecp.fr>
* *
...@@ -98,7 +98,9 @@ static int UDFReadLB( dvdcss_handle dvdhandle, off_t i_lba, ...@@ -98,7 +98,9 @@ static int UDFReadLB( dvdcss_handle dvdhandle, off_t i_lba,
{ {
if( dvdcss_seek( dvdhandle, i_lba, DVDCSS_NOFLAGS ) < 0 ) if( dvdcss_seek( dvdhandle, i_lba, DVDCSS_NOFLAGS ) < 0 )
{ {
//X intf_ErrMsg( "dvd error: block %i not found", i_lba ); #if 0
intf_ErrMsg( "dvd error: block %i not found", i_lba );
#endif
return 0; return 0;
} }
...@@ -256,13 +258,15 @@ static int UDFLogVolume(u8 * pi_data, char * p_volume_descriptor ) ...@@ -256,13 +258,15 @@ static int UDFLogVolume(u8 * pi_data, char * p_volume_descriptor )
UDFDecode( &pi_data[84], 128, p_volume_descriptor ); UDFDecode( &pi_data[84], 128, p_volume_descriptor );
i_lb_size = GETN4( 212 ); // should be 2048 i_lb_size = GETN4( 212 ); /* should be 2048 */
i_MT_L = GETN4( 264 ); // should be 6 i_MT_L = GETN4( 264 ); /* should be 6 */
i_N_PM = GETN4( 268 ); // should be 1 i_N_PM = GETN4( 268 ); /* should be 1 */
if( i_lb_size != DVD_LB_SIZE ) if( i_lb_size != DVD_LB_SIZE )
{ {
//X intf_ErrMsg( "dvd error: invalid UDF sector size (%d)", i_lb_size ); #if 0
intf_ErrMsg( "dvd error: invalid UDF sector size (%d)", i_lb_size );
#endif
return 1; return 1;
} }
...@@ -664,7 +668,9 @@ u32 DVDUDFFindFile( dvdcss_handle dvdhandle, char * psz_path ) ...@@ -664,7 +668,9 @@ u32 DVDUDFFindFile( dvdcss_handle dvdhandle, char * psz_path )
i_partition = 0; i_partition = 0;
if( !UDFFindPartition( i_partition, &partition ) ) if( !UDFFindPartition( i_partition, &partition ) )
{ {
//X intf_ErrMsg( "dvd error: partition 0 not found" ); #if 0
intf_ErrMsg( "dvd error: partition 0 not found" );
#endif
return 0; return 0;
} }
...@@ -693,26 +699,34 @@ u32 DVDUDFFindFile( dvdcss_handle dvdhandle, char * psz_path ) ...@@ -693,26 +699,34 @@ u32 DVDUDFFindFile( dvdcss_handle dvdhandle, char * psz_path )
if( i_tag_id != 256 ) if( i_tag_id != 256 )
{ {
//X intf_ErrMsg( "dvd error: bad UDF descriptor" ); #if 0
intf_ErrMsg( "dvd error: bad UDF descriptor" );
#endif
return 0; return 0;
} }
if( root_icb.i_partition != i_partition ) if( root_icb.i_partition != i_partition )
{ {
//X intf_ErrMsg( "dvd error: bad UDF partition" ); #if 0
intf_ErrMsg( "dvd error: bad UDF partition" );
#endif
return 0; return 0;
} }
/* Find root dir */ /* Find root dir */
if( !UDFMapICB( root_icb, &i_file_type, &file, partition ) ) if( !UDFMapICB( root_icb, &i_file_type, &file, partition ) )
{ {
//X intf_ErrMsg( "dvd error: can't find root dir" ); #if 0
intf_ErrMsg( "dvd error: can't find root dir" );
#endif
return 0; return 0;
} }
/* root dir should be dir */ /* root dir should be dir */
if( i_file_type != 4 ) if( i_file_type != 4 )
{ {
//X intf_ErrMsg( "dvd error: root dir error" ); #if 0
intf_ErrMsg( "dvd error: root dir error" );
#endif
return 0; return 0;
} }
...@@ -722,13 +736,17 @@ u32 DVDUDFFindFile( dvdcss_handle dvdhandle, char * psz_path ) ...@@ -722,13 +736,17 @@ u32 DVDUDFFindFile( dvdcss_handle dvdhandle, char * psz_path )
{ {
if( !UDFScanDir( file, psz_token, &icb, partition ) ) if( !UDFScanDir( file, psz_token, &icb, partition ) )
{ {
//X intf_ErrMsg( "dvd error: scan dir error" ); #if 0
intf_ErrMsg( "dvd error: scan dir error" );
#endif
return 0; return 0;
} }
if( !UDFMapICB ( icb, &i_file_type, &file, partition ) ) if( !UDFMapICB ( icb, &i_file_type, &file, partition ) )
{ {
//X intf_ErrMsg( "dvd error: ICB error" ); #if 0
intf_ErrMsg( "dvd error: ICB error" );
#endif
return 0; return 0;
} }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* http.c: HTTP access plug-in * http.c: HTTP access plug-in
***************************************************************************** *****************************************************************************
* Copyright (C) 2001, 2002 VideoLAN * Copyright (C) 2001, 2002 VideoLAN
* $Id: http.c,v 1.2 2002/08/07 00:29:36 sam Exp $ * $Id: http.c,v 1.3 2002/08/08 00:35:10 sam Exp $
* *
* Authors: Christophe Massiot <massiot@via.ecp.fr> * Authors: Christophe Massiot <massiot@via.ecp.fr>
* *
...@@ -117,9 +117,10 @@ static int HTTPConnect( input_thread_t * p_input, off_t i_tell ) ...@@ -117,9 +117,10 @@ static int HTTPConnect( input_thread_t * p_input, off_t i_tell )
{ {
snprintf( psz_buffer, sizeof(psz_buffer), snprintf( psz_buffer, sizeof(psz_buffer),
"%s" "%s"
"Range: bytes=%lld-\r\n" "Range: bytes=%d%d-\r\n"
HTTP_USERAGENT HTTP_END, HTTP_USERAGENT HTTP_END,
p_access_data->psz_buffer, i_tell ); p_access_data->psz_buffer,
(u32)(i_tell>>32), (u32)i_tell );
} }
else else
{ {
...@@ -170,7 +171,7 @@ static int HTTPConnect( input_thread_t * p_input, off_t i_tell ) ...@@ -170,7 +171,7 @@ static int HTTPConnect( input_thread_t * p_input, off_t i_tell )
strlen("HTTP/1.") ) ) strlen("HTTP/1.") ) )
{ {
psz_parser += strlen("HTTP 1.") + 2; psz_parser += strlen("HTTP 1.") + 2;
i_returncode = atoi( psz_parser ); i_returncode = atoi( (char*)psz_parser );
msg_Dbg( p_input, "HTTP server replied: %i", i_returncode ); msg_Dbg( p_input, "HTTP server replied: %i", i_returncode );
psz_parser += 4; psz_parser += 4;
for ( i = 0; psz_parser[i] != '\r' || psz_parser[i+1] != '\n'; i++ ) for ( i = 0; psz_parser[i] != '\r' || psz_parser[i+1] != '\n'; i++ )
...@@ -216,11 +217,11 @@ static int HTTPConnect( input_thread_t * p_input, off_t i_tell ) ...@@ -216,11 +217,11 @@ static int HTTPConnect( input_thread_t * p_input, off_t i_tell )
psz_parser += strlen("Content-Length: "); psz_parser += strlen("Content-Length: ");
vlc_mutex_lock( &p_input->stream.stream_lock ); vlc_mutex_lock( &p_input->stream.stream_lock );
#ifdef HAVE_ATOLL #ifdef HAVE_ATOLL
p_input->stream.p_selected_area->i_size = atoll( psz_parser ) p_input->stream.p_selected_area->i_size = atoll( (char*)psz_parser )
+ i_tell; + i_tell;
#else #else
/* FIXME : this won't work for 64-bit lengths */ /* FIXME : this won't work for 64-bit lengths */
p_input->stream.p_selected_area->i_size = atoi( psz_parser ) p_input->stream.p_selected_area->i_size = atoi( (char*)psz_parser )
+ i_tell; + i_tell;
#endif #endif
vlc_mutex_unlock( &p_input->stream.stream_lock ); vlc_mutex_unlock( &p_input->stream.stream_lock );
......
.dep
*.lo
*.o.*
*.lo.*
/*****************************************************************************
* v4l.c : Video4Linux input module for vlc
*****************************************************************************
* Copyright (C) 2002 VideoLAN
* $Id: v4l.c,v 1.1 2002/08/08 00:35:10 sam Exp $
*
* Author: Samuel Hocevar <sam@zoy.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
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
*****************************************************************************/
/*****************************************************************************
* Preamble
*****************************************************************************/
#include <vlc/vlc.h>
#include <vlc/input.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
/*****************************************************************************
* Local prototypes
*****************************************************************************/
static int V4lOpen ( vlc_object_t * );
static void V4lClose ( vlc_object_t * );
static int V4lRead ( input_thread_t *, byte_t *, size_t );
/*****************************************************************************
* Module descriptior
*****************************************************************************/
vlc_module_begin();
set_description( _("Video4Linux input module") );
set_capability( "access", 80 );
set_callbacks( V4lOpen, V4lClose );
vlc_module_end();
static int i_fd;
/*****************************************************************************
* V4lOpen: open device
*****************************************************************************/
static int V4lOpen( vlc_object_t *p_this )
{
input_thread_t * p_input = (input_thread_t *)p_this;
p_input->pf_read = V4lRead;
p_input->pf_seek = NULL;
p_input->pf_set_area = NULL;
p_input->pf_set_program = NULL;
vlc_mutex_lock( &p_input->stream.stream_lock );
p_input->stream.b_pace_control = 0;
p_input->stream.b_seekable = 0;
p_input->stream.p_selected_area->i_size = 0;
p_input->stream.p_selected_area->i_tell = 0;
p_input->stream.i_method = INPUT_METHOD_FILE;
vlc_mutex_unlock( &p_input->stream.stream_lock );
i_fd = open( "/dev/v4l/video0", O_RDWR );
return 0;
}
/*****************************************************************************
* V4lClose: close device
*****************************************************************************/
static void V4lClose( vlc_object_t *p_this )
{
input_thread_t * p_input = (input_thread_t *)p_this;
//thread_data_t *p_data = (thread_data_t *)p_input->p_access_data;
//close( p_data->i_handle );
close( i_fd );
//free( p_data );
}
/*****************************************************************************
* V4lRead: reads from the device into PES packets.
*****************************************************************************
* Returns -1 in case of error, 0 in case of EOF, otherwise the number of
* bytes.
*****************************************************************************/
#define WIDTH 640
#define HEIGHT 480
static int V4lRead( input_thread_t * p_input, byte_t * p_buffer,
size_t i_len )
{
struct video_capability vid_caps;
struct video_mbuf vid_buf;
struct video_mmap vid_mmap;
char *map = NULL;
//thread_data_t * p_data;
int i_read = 0;
if( ioctl( i_fd, VIDIOCGCAP, &vid_caps ) == -1 )
{
printf("ioctl (VIDIOCGCAP) failed\n");
return 0;
}
if( ioctl( i_fd, VIDIOCGMBUF, &vid_buf ) == -1 )
{
// to do a normal read()
map = malloc (WIDTH * HEIGHT * 3);
len = read (fd_webcam, map, WIDTH * HEIGHT * 3);
if (len <= 0)
{
free (map);
return (NULL);
}
*size = 0;
return (map);
}
//p_data = (thread_data_t *)p_input->p_access_data;
return i_read;
}
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* vcd.c : VCD input module for vlc * vcd.c : VCD input module for vlc
***************************************************************************** *****************************************************************************
* Copyright (C) 2000 VideoLAN * Copyright (C) 2000 VideoLAN
* $Id: vcd.c,v 1.2 2002/08/07 00:29:36 sam Exp $ * $Id: vcd.c,v 1.3 2002/08/08 00:35:10 sam Exp $
* *
* Author: Johan Bilien <jobi@via.ecp.fr> * Author: Johan Bilien <jobi@via.ecp.fr>
* *
...@@ -243,7 +243,7 @@ static int VCDOpen( vlc_object_t *p_this ) ...@@ -243,7 +243,7 @@ static int VCDOpen( vlc_object_t *p_this )
* (off_t)VCD_DATA_SIZE; * (off_t)VCD_DATA_SIZE;
/* Number of chapters */ /* Number of chapters */
area[i]->i_part_nb = 0; // will be the entry points area[i]->i_part_nb = 0; /* will be the entry points */
area[i]->i_part = 1; area[i]->i_part = 1;
area[i]->i_plugin_data = p_vcd->p_sectors[i]; area[i]->i_plugin_data = p_vcd->p_sectors[i];
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* trivial.c : trivial mixer plug-in (1 input, no downmixing) * trivial.c : trivial mixer plug-in (1 input, no downmixing)
***************************************************************************** *****************************************************************************
* Copyright (C) 2002 VideoLAN * Copyright (C) 2002 VideoLAN
* $Id: trivial.c,v 1.1 2002/08/07 21:36:55 massiot Exp $ * $Id: trivial.c,v 1.2 2002/08/08 00:35:10 sam Exp $
* *
* Authors: Christophe Massiot <massiot@via.ecp.fr> * Authors: Christophe Massiot <massiot@via.ecp.fr>
* *
...@@ -99,10 +99,10 @@ static void DoWork( aout_instance_t * p_aout, aout_buffer_t * p_buffer ) ...@@ -99,10 +99,10 @@ static void DoWork( aout_instance_t * p_aout, aout_buffer_t * p_buffer )
{ {
int i_nb_bytes = p_buffer->i_nb_samples * sizeof(u32) int i_nb_bytes = p_buffer->i_nb_samples * sizeof(u32)
* p_input->input.i_channels; * p_input->input.i_channels;
char * p_in = (p_input->p_first_byte_to_mix == NULL) ? byte_t * p_in = (p_input->p_first_byte_to_mix == NULL) ?
p_input->fifo.p_first->p_buffer : p_input->fifo.p_first->p_buffer :
p_input->p_first_byte_to_mix; p_input->p_first_byte_to_mix;
char * p_out = p_buffer->p_buffer; byte_t * p_out = p_buffer->p_buffer;
for ( ; ; ) for ( ; ; )
{ {
...@@ -161,7 +161,7 @@ static void DoWork( aout_instance_t * p_aout, aout_buffer_t * p_buffer ) ...@@ -161,7 +161,7 @@ static void DoWork( aout_instance_t * p_aout, aout_buffer_t * p_buffer )
for ( ; ; ) for ( ; ; )
{ {
ptrdiff_t i_available_bytes = (p_input->fifo.p_first->p_buffer ptrdiff_t i_available_bytes = (p_input->fifo.p_first->p_buffer
- (char *)p_in) - (byte_t *)p_in)
+ p_input->fifo.p_first->i_nb_samples + p_input->fifo.p_first->i_nb_samples
* sizeof(u32) * sizeof(u32)
* p_input->input.i_channels; * p_input->input.i_channels;
...@@ -195,7 +195,7 @@ static void DoWork( aout_instance_t * p_aout, aout_buffer_t * p_buffer ) ...@@ -195,7 +195,7 @@ static void DoWork( aout_instance_t * p_aout, aout_buffer_t * p_buffer )
SparseCopy( p_out, p_in, i_nb_samples, SparseCopy( p_out, p_in, i_nb_samples,
p_aout->mixer.output.i_channels, p_aout->mixer.output.i_channels,
p_input->input.i_channels ); p_input->input.i_channels );
p_input->p_first_byte_to_mix = (char *)p_in p_input->p_first_byte_to_mix = (byte_t *)p_in
+ i_nb_samples * p_input->input.i_channels + i_nb_samples * p_input->input.i_channels
* sizeof(u32); * sizeof(u32);
break; break;
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* oss.c : OSS /dev/dsp module for vlc * oss.c : OSS /dev/dsp module for vlc
***************************************************************************** *****************************************************************************
* Copyright (C) 2000-2002 VideoLAN * Copyright (C) 2000-2002 VideoLAN
* $Id: oss.c,v 1.1 2002/08/07 21:36:55 massiot Exp $ * $Id: oss.c,v 1.2 2002/08/08 00:35:11 sam Exp $
* *
* Authors: Michel Kaempf <maxx@via.ecp.fr> * Authors: Michel Kaempf <maxx@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org> * Samuel Hocevar <sam@zoy.org>
...@@ -40,6 +40,7 @@ ...@@ -40,6 +40,7 @@
#endif #endif
#include <vlc/aout.h> #include <vlc/aout.h>
#include "aout_internal.h" #include "aout_internal.h"
/* SNDCTL_DSP_RESET, SNDCTL_DSP_SETFMT, SNDCTL_DSP_STEREO, SNDCTL_DSP_SPEED, /* SNDCTL_DSP_RESET, SNDCTL_DSP_SETFMT, SNDCTL_DSP_STEREO, SNDCTL_DSP_SPEED,
...@@ -62,6 +63,7 @@ struct aout_sys_t ...@@ -62,6 +63,7 @@ struct aout_sys_t
{ {
int i_fd; int i_fd;
volatile vlc_bool_t b_die; volatile vlc_bool_t b_die;
volatile vlc_bool_t b_initialized;
}; };
#define DEFAULT_FRAME_SIZE 2048 #define DEFAULT_FRAME_SIZE 2048
...@@ -111,7 +113,7 @@ static int Open( vlc_object_t *p_this ) ...@@ -111,7 +113,7 @@ static int Open( vlc_object_t *p_this )
if( (psz_device = config_GetPsz( p_aout, "dspdev" )) == NULL ) if( (psz_device = config_GetPsz( p_aout, "dspdev" )) == NULL )
{ {
msg_Err( p_aout, "no audio device given (maybe /dev/dsp ?)" ); msg_Err( p_aout, "no audio device given (maybe /dev/dsp ?)" );
free( p_aout->p_sys ); free( p_sys );
return -1; return -1;
} }
...@@ -128,16 +130,17 @@ static int Open( vlc_object_t *p_this ) ...@@ -128,16 +130,17 @@ static int Open( vlc_object_t *p_this )
/* Create OSS thread and wait for its readiness. */ /* Create OSS thread and wait for its readiness. */
p_sys->b_die = 0; p_sys->b_die = 0;
if( vlc_thread_create( p_aout, "aout", OSSThread, VLC_TRUE ) ) p_sys->b_initialized = VLC_FALSE;
if( vlc_thread_create( p_aout, "aout", OSSThread, VLC_FALSE ) )
{ {
msg_Err( p_input, "cannot create OSS thread (%s)", strerror(errno) ); msg_Err( p_aout, "cannot create OSS thread (%s)", strerror(errno) );
free( p_aout->p_sys->psz_device ); free( psz_device );
free( p_aout->p_sys ); free( p_sys );
return -1; return -1;
} }
p_aout->pf_setformat = SetFormat; p_aout->output.pf_setformat = SetFormat;
p_aout->pf_play = Play; p_aout->output.pf_play = Play;
return 0; return 0;
} }
...@@ -157,6 +160,8 @@ static int SetFormat( aout_instance_t *p_aout ) ...@@ -157,6 +160,8 @@ static int SetFormat( aout_instance_t *p_aout )
int i_rate; int i_rate;
vlc_bool_t b_stereo; vlc_bool_t b_stereo;
p_sys->b_initialized = VLC_FALSE;
/* Reset the DSP device */ /* Reset the DSP device */
if( ioctl( p_sys->i_fd, SNDCTL_DSP_RESET, NULL ) < 0 ) if( ioctl( p_sys->i_fd, SNDCTL_DSP_RESET, NULL ) < 0 )
{ {
...@@ -203,9 +208,10 @@ static int SetFormat( aout_instance_t *p_aout ) ...@@ -203,9 +208,10 @@ static int SetFormat( aout_instance_t *p_aout )
/* Set the output rate */ /* Set the output rate */
i_rate = p_aout->output.output.i_rate; i_rate = p_aout->output.output.i_rate;
if( ioctl( p_aout->p_sys->i_fd, SNDCTL_DSP_SPEED, &i_rate ) < 0 ) if( ioctl( p_sys->i_fd, SNDCTL_DSP_SPEED, &i_rate ) < 0 )
{ {
msg_Err( p_aout, "cannot set audio output rate (%i)", p_aout->i_rate ); msg_Err( p_aout, "cannot set audio output rate (%i)",
p_aout->output.output.i_rate );
return -1; return -1;
} }
...@@ -218,6 +224,8 @@ static int SetFormat( aout_instance_t *p_aout ) ...@@ -218,6 +224,8 @@ static int SetFormat( aout_instance_t *p_aout )
p_aout->output.i_nb_samples = DEFAULT_FRAME_SIZE; p_aout->output.i_nb_samples = DEFAULT_FRAME_SIZE;
p_sys->b_initialized = VLC_TRUE;
return 0; return 0;
} }
...@@ -240,8 +248,8 @@ static void Close( vlc_object_t * p_this ) ...@@ -240,8 +248,8 @@ static void Close( vlc_object_t * p_this )
p_sys->b_die = 1; p_sys->b_die = 1;
vlc_thread_join( p_aout ); vlc_thread_join( p_aout );
close( p_aout->p_sys->i_fd ); close( p_sys->i_fd );
free( p_aout->p_sys ); free( p_sys );
} }
...@@ -275,7 +283,7 @@ static int OSSThread( aout_instance_t * p_aout ) ...@@ -275,7 +283,7 @@ static int OSSThread( aout_instance_t * p_aout )
while ( !p_sys->b_die ) while ( !p_sys->b_die )
{ {
int i_bytes_per_sample = aout_FormatToBytes( &p_aout->output.output ); int i_bytes_per_sample;
aout_buffer_t * p_buffer; aout_buffer_t * p_buffer;
mtime_t next_date; mtime_t next_date;
int i_tmp; int i_tmp;
...@@ -285,6 +293,13 @@ static int OSSThread( aout_instance_t * p_aout ) ...@@ -285,6 +293,13 @@ static int OSSThread( aout_instance_t * p_aout )
* is equal to the current date + duration of buffered samples. * is equal to the current date + duration of buffered samples.
* Order is important here, since GetBufInfo is believed to take * Order is important here, since GetBufInfo is believed to take
* more time than mdate(). */ * more time than mdate(). */
if( !p_sys->b_initialized )
{
msleep( THREAD_SLEEP );
continue;
}
i_bytes_per_sample = aout_FormatToBytes( &p_aout->output.output );
next_date = (mtime_t)GetBufInfo( p_aout ) * 1000000 next_date = (mtime_t)GetBufInfo( p_aout ) * 1000000
/ i_bytes_per_sample / i_bytes_per_sample
/ p_aout->output.output.i_rate; / p_aout->output.output.i_rate;
...@@ -315,4 +330,6 @@ static int OSSThread( aout_instance_t * p_aout ) ...@@ -315,4 +330,6 @@ static int OSSThread( aout_instance_t * p_aout )
aout_BufferFree( p_buffer ); aout_BufferFree( p_buffer );
} }
} }
return 0;
} }
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* adec.h : A52 decoder interface * adec.h : A52 decoder interface
***************************************************************************** *****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN * Copyright (C) 1999, 2000 VideoLAN
* $Id: adec.h,v 1.1 2002/08/04 17:23:42 sam Exp $ * $Id: adec.h,v 1.2 2002/08/08 00:35:11 sam Exp $
* *
* Authors: Michel Kaempf <maxx@via.ecp.fr> * Authors: Michel Kaempf <maxx@via.ecp.fr>
* Renaud Dartus <reno@videolan.org> * Renaud Dartus <reno@videolan.org>
...@@ -68,7 +68,7 @@ typedef struct syncinfo_s { ...@@ -68,7 +68,7 @@ typedef struct syncinfo_s {
/* Frame size in 16 bit words */ /* Frame size in 16 bit words */
u16 frame_size; u16 frame_size;
/* Bit rate in kilobits */ /* Bit rate in kilobits */
//u16 bit_rate; /*u16 bit_rate;*/
} syncinfo_t; } syncinfo_t;
typedef struct bsi_s { typedef struct bsi_s {
...@@ -267,14 +267,14 @@ typedef struct audblk_s { ...@@ -267,14 +267,14 @@ typedef struct audblk_s {
u16 skipl; u16 skipl;
/* channel mantissas */ /* channel mantissas */
// u16 chmant[5][256]; /* u16 chmant[5][256]; */
/* coupling mantissas */ /* coupling mantissas */
float cpl_flt[ 256 ]; float cpl_flt[ 256 ];
// u16 cplmant[256]; /* u16 cplmant[256]; */
/* coupling mantissas */ /* coupling mantissas */
// u16 lfemant[7]; /* u16 lfemant[7]; */
/* -- Information not in the bitstream, but derived thereof -- */ /* -- Information not in the bitstream, but derived thereof -- */
...@@ -301,15 +301,15 @@ typedef struct audblk_s { ...@@ -301,15 +301,15 @@ typedef struct audblk_s {
u16 cplendmant; u16 cplendmant;
/* Decoded exponent info */ /* Decoded exponent info */
u16 fbw_exp[5][256]; s16 fbw_exp[5][256];
u16 cpl_exp[256]; s16 cpl_exp[256];
u16 lfe_exp[7]; s16 lfe_exp[7];
/* Bit allocation pointer results */ /* Bit allocation pointer results */
u16 fbw_bap[5][256]; s16 fbw_bap[5][256];
/* FIXME?? figure out exactly how many entries there should be (253-37?) */ /* FIXME?? figure out exactly how many entries there should be (253-37?) */
u16 cpl_bap[256]; s16 cpl_bap[256];
u16 lfe_bap[7]; s16 lfe_bap[7];
} audblk_t; } audblk_t;
/* Everything you wanted to know about band structure */ /* Everything you wanted to know about band structure */
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* downmix.h : A52 downmix types * downmix.h : A52 downmix types
***************************************************************************** *****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN * Copyright (C) 1999, 2000 VideoLAN
* $Id: downmix.h,v 1.2 2002/08/07 00:29:36 sam Exp $ * $Id: downmix.h,v 1.3 2002/08/08 00:35:11 sam Exp $
* *
* Authors: Michel Kaempf <maxx@via.ecp.fr> * Authors: Michel Kaempf <maxx@via.ecp.fr>
* Renaud Dartus <reno@videolan.org> * Renaud Dartus <reno@videolan.org>
...@@ -22,17 +22,15 @@ ...@@ -22,17 +22,15 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
*****************************************************************************/ *****************************************************************************/
VLC_DECLARE_STRUCT(dm_par_t) typedef struct dm_par_t
VLC_DECLARE_STRUCT(downmix_t)
struct dm_par_t
{ {
float unit; float unit;
float clev; float clev;
float slev; float slev;
};
struct downmix_t } dm_par_t;
typedef struct downmix_t
{ {
VLC_COMMON_MEMBERS VLC_COMMON_MEMBERS
...@@ -45,5 +43,6 @@ struct downmix_t ...@@ -45,5 +43,6 @@ struct downmix_t
void (*pf_downmix_3f_0r_to_2ch)(float *, dm_par_t * dm_par); void (*pf_downmix_3f_0r_to_2ch)(float *, dm_par_t * dm_par);
void (*pf_stream_sample_2ch_to_s16)(s16 *, float *left, float *right); void (*pf_stream_sample_2ch_to_s16)(s16 *, float *left, float *right);
void (*pf_stream_sample_1ch_to_s16)(s16 *, float *center); void (*pf_stream_sample_1ch_to_s16)(s16 *, float *center);
};
} downmix_t;
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* exponent.h: A52 exponent calculations * exponent.h: A52 exponent calculations
***************************************************************************** *****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN * Copyright (C) 1999, 2000 VideoLAN
* $Id: exponent.h,v 1.1 2002/08/04 17:23:42 sam Exp $ * $Id: exponent.h,v 1.2 2002/08/08 00:35:11 sam Exp $
* *
* Authors: Michel Kaempf <maxx@via.ecp.fr> * Authors: Michel Kaempf <maxx@via.ecp.fr>
* Michel Lespinasse <walken@zoy.org> * Michel Lespinasse <walken@zoy.org>
...@@ -59,7 +59,7 @@ static const s16 exps_3[128] = ...@@ -59,7 +59,7 @@ static const s16 exps_3[128] =
static inline int exp_unpack_ch( a52dec_t * p_a52dec, u16 type, static inline int exp_unpack_ch( a52dec_t * p_a52dec, u16 type,
u16 expstr, u16 ngrps, u16 initial_exp, u16 expstr, u16 ngrps, u16 initial_exp,
u16 exps[], u16 * dest ) u16 exps[], s16 * dest )
{ {
u16 i,j; u16 i,j;
s16 exp_acc; s16 exp_acc;
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* imdct.c: A52 DCT * imdct.c: A52 DCT
***************************************************************************** *****************************************************************************
* Copyright (C) 1999-2001 VideoLAN * Copyright (C) 1999-2001 VideoLAN
* $Id: imdct.c,v 1.1 2002/08/04 17:23:42 sam Exp $ * $Id: imdct.c,v 1.2 2002/08/08 00:35:11 sam Exp $
* *
* Authors: Michel Kaempf <maxx@via.ecp.fr> * Authors: Michel Kaempf <maxx@via.ecp.fr>
* Aaron Holtzman <aholtzma@engr.uvic.ca> * Aaron Holtzman <aholtzma@engr.uvic.ca>
...@@ -110,10 +110,10 @@ void imdct (a52dec_t * p_a52dec, s16 * buffer) ...@@ -110,10 +110,10 @@ void imdct (a52dec_t * p_a52dec, s16 * buffer)
case 2: case 2:
break; break;
default: /* 1/0 */ default: /* 1/0 */
// if (p_a52dec->bsi.acmod == 1) /* if (p_a52dec->bsi.acmod == 1) */
center = p_a52dec->samples; center = p_a52dec->samples;
// else if (p_a52dec->bsi.acmod == 0) /* else if (p_a52dec->bsi.acmod == 0)
// center = samples[config.dual_mono_ch_sel]; center = samples[config.dual_mono_ch_sel]; */
do_imdct(p_a52dec->p_imdct, center, p_a52dec->p_imdct->delay); /* no downmix*/ do_imdct(p_a52dec->p_imdct, center, p_a52dec->p_imdct->delay); /* no downmix*/
p_a52dec->p_downmix->pf_stream_sample_1ch_to_s16 (buffer, center); p_a52dec->p_downmix->pf_stream_sample_1ch_to_s16 (buffer, center);
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* imdct.h : A52 IMDCT types * imdct.h : A52 IMDCT types
***************************************************************************** *****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN * Copyright (C) 1999, 2000 VideoLAN
* $Id: imdct.h,v 1.2 2002/08/07 00:29:36 sam Exp $ * $Id: imdct.h,v 1.3 2002/08/08 00:35:11 sam Exp $
* *
* Authors: Michel Kaempf <maxx@via.ecp.fr> * Authors: Michel Kaempf <maxx@via.ecp.fr>
* Renaud Dartus <reno@videolan.org> * Renaud Dartus <reno@videolan.org>
...@@ -22,17 +22,17 @@ ...@@ -22,17 +22,17 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
*****************************************************************************/ *****************************************************************************/
VLC_DECLARE_STRUCT(complex_t) typedef struct complex_t
VLC_DECLARE_STRUCT(imdct_t)
struct complex_t
{ {
float real; float real;
float imag; float imag;
};
} complex_t;
#define N 512 #define N 512
typedef struct imdct_t imdct_t;
struct imdct_t struct imdct_t
{ {
VLC_COMMON_MEMBERS VLC_COMMON_MEMBERS
...@@ -77,10 +77,13 @@ struct imdct_t ...@@ -77,10 +77,13 @@ struct imdct_t
/* Module used and shortcuts */ /* Module used and shortcuts */
module_t * p_module; module_t * p_module;
void (*pf_imdct_init) ( imdct_t * ); void (*pf_imdct_init) ( imdct_t * );
//void (*pf_fft_64p) (complex_t *a); #if 0
void (*pf_fft_64p) (complex_t *a);
#endif
void (*pf_imdct_256) ( imdct_t *, float [], float [] ); void (*pf_imdct_256) ( imdct_t *, float [], float [] );
void (*pf_imdct_256_nol) ( imdct_t *, float [], float [] ); void (*pf_imdct_256_nol) ( imdct_t *, float [], float [] );
void (*pf_imdct_512) ( imdct_t *, float [], float [] ); void (*pf_imdct_512) ( imdct_t *, float [], float [] );
void (*pf_imdct_512_nol) ( imdct_t *, float [], float [] ); void (*pf_imdct_512_nol) ( imdct_t *, float [], float [] );
}; };
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* parse.c: A52 parsing procedures * parse.c: A52 parsing procedures
***************************************************************************** *****************************************************************************
* Copyright (C) 1999-2001 VideoLAN * Copyright (C) 1999-2001 VideoLAN
* $Id: parse.c,v 1.1 2002/08/04 17:23:42 sam Exp $ * $Id: parse.c,v 1.2 2002/08/08 00:35:11 sam Exp $
* *
* Authors: Michel Kaempf <maxx@via.ecp.fr> * Authors: Michel Kaempf <maxx@via.ecp.fr>
* Aaron Holtzman <aholtzma@engr.uvic.ca> * Aaron Holtzman <aholtzma@engr.uvic.ca>
...@@ -738,8 +738,10 @@ int parse_audblk (a52dec_t * p_a52dec, int blknum) ...@@ -738,8 +738,10 @@ int parse_audblk (a52dec_t * p_a52dec, int blknum)
if (p_a52dec->audblk.deltbae[i] == DELTA_BIT_NEW) if (p_a52dec->audblk.deltbae[i] == DELTA_BIT_NEW)
{ {
p_a52dec->audblk.deltnseg[i] = GetBits (&p_a52dec->bit_stream,3); p_a52dec->audblk.deltnseg[i] = GetBits (&p_a52dec->bit_stream,3);
// if (p_a52dec->audblk.deltnseg[i] >= 8) #if 0
// fprintf (stderr, "parse debug: p_a52dec->audblk.deltnseg[%i] == %i\n", i, p_a52dec->audblk.deltnseg[i]); if (p_a52dec->audblk.deltnseg[i] >= 8)
fprintf (stderr, "parse debug: p_a52dec->audblk.deltnseg[%i] == %i\n", i, p_a52dec->audblk.deltnseg[i]);
#endif
for (j = 0; j < p_a52dec->audblk.deltnseg[i] + 1; j++) for (j = 0; j < p_a52dec->audblk.deltnseg[i] + 1; j++)
{ {
p_a52dec->audblk.deltoffst[i][j] = GetBits (&p_a52dec->bit_stream,5); p_a52dec->audblk.deltoffst[i][j] = GetBits (&p_a52dec->bit_stream,5);
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* layer1.c: MPEG Layer I audio decoder * layer1.c: MPEG Layer I audio decoder
***************************************************************************** *****************************************************************************
* Copyright (C) 1999-2001 VideoLAN * Copyright (C) 1999-2001 VideoLAN
* $Id: layer1.c,v 1.1 2002/08/04 17:23:42 sam Exp $ * $Id: layer1.c,v 1.2 2002/08/08 00:35:11 sam Exp $
* *
* Authors: Michel Kaempf <maxx@via.ecp.fr> * Authors: Michel Kaempf <maxx@via.ecp.fr>
* Michel Lespinasse <walken@via.ecp.fr> * Michel Lespinasse <walken@via.ecp.fr>
...@@ -92,9 +92,7 @@ int adec_layer1_mono( adec_thread_t * p_adec, s16 * buffer ) ...@@ -92,9 +92,7 @@ int adec_layer1_mono( adec_thread_t * p_adec, s16 * buffer )
float offset[32]; float offset[32];
float sample[32]; float sample[32];
int i_sb; unsigned int i_sb, s, i_read_bits = 0;
int s;
int i_read_bits = 0;
/* /*
* Parse the allocation tables * Parse the allocation tables
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* layer2.c: MPEG Layer II audio decoder * layer2.c: MPEG Layer II audio decoder
***************************************************************************** *****************************************************************************
* Copyright (C) 1999-2001 VideoLAN * Copyright (C) 1999-2001 VideoLAN
* $Id: layer2.c,v 1.1 2002/08/04 17:23:42 sam Exp $ * $Id: layer2.c,v 1.2 2002/08/08 00:35:11 sam Exp $
* *
* Authors: Michel Kaempf <maxx@via.ecp.fr> * Authors: Michel Kaempf <maxx@via.ecp.fr>
* Michel Lespinasse <walken@via.ecp.fr> * Michel Lespinasse <walken@via.ecp.fr>
...@@ -83,7 +83,7 @@ static int adec_bound_table[4] = { 4, 8, 12, 16 }; ...@@ -83,7 +83,7 @@ static int adec_bound_table[4] = { 4, 8, 12, 16 };
typedef struct typedef struct
{ {
s8 nbal[32]; s8 nbal[32];
u8 * alloc[32]; s8 * alloc[32];
} alloc_table_t; } alloc_table_t;
#define L3 -1 #define L3 -1
...@@ -209,7 +209,7 @@ int adec_layer2_mono( adec_thread_t * p_adec, s16 * buffer ) ...@@ -209,7 +209,7 @@ int adec_layer2_mono( adec_thread_t * p_adec, s16 * buffer )
adec_layer2_get_table (p_adec->header, freq_table, &alloc_table, &sblimit); adec_layer2_get_table (p_adec->header, freq_table, &alloc_table, &sblimit);
/* parse allocation */ /* parse allocation */
//sblimit=27; /*sblimit=27;*/
for (sb = 0; sb < sblimit; sb++) for (sb = 0; sb < sblimit; sb++)
{ {
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* math.c: Inverse Discrete Cosine Transform and Pulse Code Modulation * math.c: Inverse Discrete Cosine Transform and Pulse Code Modulation
***************************************************************************** *****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN * Copyright (C) 1999, 2000 VideoLAN
* $Id: math.c,v 1.1 2002/08/04 17:23:42 sam Exp $ * $Id: math.c,v 1.2 2002/08/08 00:35:11 sam Exp $
* *
* Authors: Michel Kaempf <maxx@via.ecp.fr> * Authors: Michel Kaempf <maxx@via.ecp.fr>
* Michel Lespinasse <walken@via.ecp.fr> * Michel Lespinasse <walken@via.ecp.fr>
...@@ -481,12 +481,12 @@ void PCM(adec_bank_t *b, s16 *p_pcm, int jump) ...@@ -481,12 +481,12 @@ void PCM(adec_bank_t *b, s16 *p_pcm, int jump)
if ((tmp += *f++ * *v) > 32767) if ((tmp += *f++ * *v) > 32767)
{ {
/* ceiling saturation */ /* ceiling saturation */
*p_pcm = 0x7FFF; *p_pcm = 32767; /* 0x7ffff */
} }
else if (tmp < -32768) else if (tmp < -32768)
{ {
/* floor saturation */ /* floor saturation */
*p_pcm = 0x8000; *p_pcm = -32768; /* 0x8000 */
} }
else else
{ {
...@@ -518,11 +518,11 @@ void PCM(adec_bank_t *b, s16 *p_pcm, int jump) ...@@ -518,11 +518,11 @@ void PCM(adec_bank_t *b, s16 *p_pcm, int jump)
tmp += *f++ * *v--; tmp += *f++ * *v--;
if ((tmp += *f++ * *v) > 32767) if ((tmp += *f++ * *v) > 32767)
{ {
*p_pcm = 0x7FFF; *p_pcm = 32767; /* 0x7ffff */
} }
else if (tmp < -32768) else if (tmp < -32768)
{ {
*p_pcm = 0x8000; *p_pcm = -32768; /* 0x8000 */
} }
else else
{ {
...@@ -554,11 +554,11 @@ void PCM(adec_bank_t *b, s16 *p_pcm, int jump) ...@@ -554,11 +554,11 @@ void PCM(adec_bank_t *b, s16 *p_pcm, int jump)
tmp += *f++ * *v--; tmp += *f++ * *v--;
if ((tmp += *f++ * *v) > 32767) if ((tmp += *f++ * *v) > 32767)
{ {
*p_pcm = 0x7FFF; *p_pcm = 32767; /* 0x7ffff */
} }
else if (tmp < -32768) else if (tmp < -32768)
{ {
*p_pcm = 0x8000; *p_pcm = -32768; /* 0x8000 */
} }
else else
{ {
...@@ -590,11 +590,11 @@ void PCM(adec_bank_t *b, s16 *p_pcm, int jump) ...@@ -590,11 +590,11 @@ void PCM(adec_bank_t *b, s16 *p_pcm, int jump)
tmp += *f++ * *v--; tmp += *f++ * *v--;
if ((tmp += *f++ * *v) > 32767) if ((tmp += *f++ * *v) > 32767)
{ {
*p_pcm = 0x7FFF; *p_pcm = 32767; /* 0x7ffff */
} }
else if (tmp < -32768) else if (tmp < -32768)
{ {
*p_pcm = 0x8000; *p_pcm = -32768; /* 0x8000 */
} }
else else
{ {
...@@ -626,11 +626,11 @@ void PCM(adec_bank_t *b, s16 *p_pcm, int jump) ...@@ -626,11 +626,11 @@ void PCM(adec_bank_t *b, s16 *p_pcm, int jump)
tmp += *f++ * *v--; tmp += *f++ * *v--;
if ((tmp += *f++ * *v) > 32767) if ((tmp += *f++ * *v) > 32767)
{ {
*p_pcm = 0x7FFF; *p_pcm = 32767; /* 0x7ffff */
} }
else if (tmp < -32768) else if (tmp < -32768)
{ {
*p_pcm = 0x8000; *p_pcm = -32768; /* 0x8000 */
} }
else else
{ {
...@@ -662,11 +662,11 @@ void PCM(adec_bank_t *b, s16 *p_pcm, int jump) ...@@ -662,11 +662,11 @@ void PCM(adec_bank_t *b, s16 *p_pcm, int jump)
tmp += *f++ * *v--; tmp += *f++ * *v--;
if ((tmp += *f++ * *v) > 32767) if ((tmp += *f++ * *v) > 32767)
{ {
*p_pcm = 0x7FFF; *p_pcm = 32767; /* 0x7ffff */
} }
else if (tmp < -32768) else if (tmp < -32768)
{ {
*p_pcm = 0x8000; *p_pcm = -32768; /* 0x8000 */
} }
else else
{ {
...@@ -698,11 +698,11 @@ void PCM(adec_bank_t *b, s16 *p_pcm, int jump) ...@@ -698,11 +698,11 @@ void PCM(adec_bank_t *b, s16 *p_pcm, int jump)
tmp += *f++ * *v--; tmp += *f++ * *v--;
if ((tmp += *f++ * *v) > 32767) if ((tmp += *f++ * *v) > 32767)
{ {
*p_pcm = 0x7FFF; *p_pcm = 32767; /* 0x7ffff */
} }
else if (tmp < -32768) else if (tmp < -32768)
{ {
*p_pcm = 0x8000; *p_pcm = -32768; /* 0x8000 */
} }
else else
{ {
...@@ -734,11 +734,11 @@ void PCM(adec_bank_t *b, s16 *p_pcm, int jump) ...@@ -734,11 +734,11 @@ void PCM(adec_bank_t *b, s16 *p_pcm, int jump)
tmp += *f++ * *v--; tmp += *f++ * *v--;
if ((tmp += *f++ * *v) > 32767) if ((tmp += *f++ * *v) > 32767)
{ {
*p_pcm = 0x7FFF; *p_pcm = 32767; /* 0x7ffff */
} }
else if (tmp < -32768) else if (tmp < -32768)
{ {
*p_pcm = 0x8000; *p_pcm = -32768; /* 0x8000 */
} }
else else
{ {
...@@ -770,11 +770,11 @@ void PCM(adec_bank_t *b, s16 *p_pcm, int jump) ...@@ -770,11 +770,11 @@ void PCM(adec_bank_t *b, s16 *p_pcm, int jump)
tmp += *f++ * *v--; tmp += *f++ * *v--;
if ((tmp += *f++ * *v) > 32767) if ((tmp += *f++ * *v) > 32767)
{ {
*p_pcm = 0x7FFF; *p_pcm = 32767; /* 0x7ffff */
} }
else if (tmp < -32768) else if (tmp < -32768)
{ {
*p_pcm = 0x8000; *p_pcm = -32768; /* 0x8000 */
} }
else else
{ {
...@@ -806,11 +806,11 @@ void PCM(adec_bank_t *b, s16 *p_pcm, int jump) ...@@ -806,11 +806,11 @@ void PCM(adec_bank_t *b, s16 *p_pcm, int jump)
tmp += *f++ * *v--; tmp += *f++ * *v--;
if ((tmp += *f++ * *v) > 32767) if ((tmp += *f++ * *v) > 32767)
{ {
*p_pcm = 0x7FFF; *p_pcm = 32767; /* 0x7ffff */
} }
else if (tmp < -32768) else if (tmp < -32768)
{ {
*p_pcm = 0x8000; *p_pcm = -32768; /* 0x8000 */
} }
else else
{ {
...@@ -842,11 +842,11 @@ void PCM(adec_bank_t *b, s16 *p_pcm, int jump) ...@@ -842,11 +842,11 @@ void PCM(adec_bank_t *b, s16 *p_pcm, int jump)
tmp += *f++ * *v--; tmp += *f++ * *v--;
if ((tmp += *f++ * *v) > 32767) if ((tmp += *f++ * *v) > 32767)
{ {
*p_pcm = 0x7FFF; *p_pcm = 32767; /* 0x7ffff */
} }
else if (tmp < -32768) else if (tmp < -32768)
{ {
*p_pcm = 0x8000; *p_pcm = -32768; /* 0x8000 */
} }
else else
{ {
...@@ -878,11 +878,11 @@ void PCM(adec_bank_t *b, s16 *p_pcm, int jump) ...@@ -878,11 +878,11 @@ void PCM(adec_bank_t *b, s16 *p_pcm, int jump)
tmp += *f++ * *v--; tmp += *f++ * *v--;
if ((tmp += *f++ * *v) > 32767) if ((tmp += *f++ * *v) > 32767)
{ {
*p_pcm = 0x7FFF; *p_pcm = 32767; /* 0x7ffff */
} }
else if (tmp < -32768) else if (tmp < -32768)
{ {
*p_pcm = 0x8000; *p_pcm = -32768; /* 0x8000 */
} }
else else
{ {
...@@ -914,11 +914,11 @@ void PCM(adec_bank_t *b, s16 *p_pcm, int jump) ...@@ -914,11 +914,11 @@ void PCM(adec_bank_t *b, s16 *p_pcm, int jump)
tmp += *f++ * *v--; tmp += *f++ * *v--;
if ((tmp += *f++ * *v) > 32767) if ((tmp += *f++ * *v) > 32767)
{ {
*p_pcm = 0x7FFF; *p_pcm = 32767; /* 0x7ffff */
} }
else if (tmp < -32768) else if (tmp < -32768)
{ {
*p_pcm = 0x8000; *p_pcm = -32768; /* 0x8000 */
} }
else else
{ {
...@@ -950,11 +950,11 @@ void PCM(adec_bank_t *b, s16 *p_pcm, int jump) ...@@ -950,11 +950,11 @@ void PCM(adec_bank_t *b, s16 *p_pcm, int jump)
tmp += *f++ * *v--; tmp += *f++ * *v--;
if ((tmp += *f++ * *v) > 32767) if ((tmp += *f++ * *v) > 32767)
{ {
*p_pcm = 0x7FFF; *p_pcm = 32767; /* 0x7ffff */
} }
else if (tmp < -32768) else if (tmp < -32768)
{ {
*p_pcm = 0x8000; *p_pcm = -32768; /* 0x8000 */
} }
else else
{ {
...@@ -986,11 +986,11 @@ void PCM(adec_bank_t *b, s16 *p_pcm, int jump) ...@@ -986,11 +986,11 @@ void PCM(adec_bank_t *b, s16 *p_pcm, int jump)
v += 15; v += 15;
if ((tmp += *f++ * *v) > 32767) if ((tmp += *f++ * *v) > 32767)
{ {
*p_pcm = 0x7FFF; *p_pcm = 32767; /* 0x7ffff */
} }
else if (tmp < -32768) else if (tmp < -32768)
{ {
*p_pcm = 0x8000; *p_pcm = -32768; /* 0x8000 */
} }
else else
{ {
...@@ -1021,11 +1021,11 @@ void PCM(adec_bank_t *b, s16 *p_pcm, int jump) ...@@ -1021,11 +1021,11 @@ void PCM(adec_bank_t *b, s16 *p_pcm, int jump)
tmp += *f++ * *v--; tmp += *f++ * *v--;
if ((tmp += *f++ * *v) > 32767) if ((tmp += *f++ * *v) > 32767)
{ {
*p_pcm = 0x7FFF; *p_pcm = 32767; /* 0x7ffff */
} }
else if (tmp < -32768) else if (tmp < -32768)
{ {
*p_pcm = 0x8000; *p_pcm = -32768; /* 0x8000 */
} }
else else
{ {
......
This diff is collapsed.
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* video_decoder.c : video decoder thread * video_decoder.c : video decoder thread
***************************************************************************** *****************************************************************************
* Copyright (C) 1999-2001 VideoLAN * Copyright (C) 1999-2001 VideoLAN
* $Id: decoder.c,v 1.2 2002/08/04 18:39:41 sam Exp $ * $Id: decoder.c,v 1.3 2002/08/08 00:35:11 sam Exp $
* *
* Authors: Christophe Massiot <massiot@via.ecp.fr> * Authors: Christophe Massiot <massiot@via.ecp.fr>
* Michel Lespinasse <walken@zoy.org> * Michel Lespinasse <walken@zoy.org>
...@@ -218,7 +218,7 @@ static inline void MotionBlock( vdec_pool_t * p_pool, vlc_bool_t b_average, ...@@ -218,7 +218,7 @@ static inline void MotionBlock( vdec_pool_t * p_pool, vlc_bool_t b_average,
#define DECODE_NONINTRA_BLOCK( i_b, p_dest ) \ #define DECODE_NONINTRA_BLOCK( i_b, p_dest ) \
if( p_mb->i_coded_block_pattern & (1 << (11 - (i_b))) ) \ if( p_mb->i_coded_block_pattern & (1 << (11 - (i_b))) ) \
{ \ { \
DECODE_INTRA_BLOCK( i_b, p_dest ); \ DECODE_INTRA_BLOCK( i_b, p_dest ) \
} }
#define DECLARE_DECODEMB( PSZ_NAME, I_CHROMA ) \ #define DECLARE_DECODEMB( PSZ_NAME, I_CHROMA ) \
...@@ -265,28 +265,28 @@ void PSZ_NAME ( vdec_thread_t *p_vdec, macroblock_t * p_mb ) \ ...@@ -265,28 +265,28 @@ void PSZ_NAME ( vdec_thread_t *p_vdec, macroblock_t * p_mb ) \
* adding prediction and coefficient data (ISO/IEC \ * adding prediction and coefficient data (ISO/IEC \
* 13818-2 section 7.6.8) \ * 13818-2 section 7.6.8) \
*/ \ */ \
DECODE_NONINTRA_BLOCK( 0, p_mb->p_y_data ); \ DECODE_NONINTRA_BLOCK( 0, p_mb->p_y_data ) \
DECODE_NONINTRA_BLOCK( 1, p_mb->p_y_data + 8 ); \ DECODE_NONINTRA_BLOCK( 1, p_mb->p_y_data + 8 ) \
DECODE_NONINTRA_BLOCK( 2, p_mb->p_y_data + i_lum_dct_offset ); \ DECODE_NONINTRA_BLOCK( 2, p_mb->p_y_data + i_lum_dct_offset ) \
DECODE_NONINTRA_BLOCK( 3, p_mb->p_y_data + i_lum_dct_offset + 8 ); \ DECODE_NONINTRA_BLOCK( 3, p_mb->p_y_data + i_lum_dct_offset + 8 ) \
if( I_CHROMA != CHROMA_NONE ) \ if( I_CHROMA != CHROMA_NONE ) \
{ \ { \
DECODE_NONINTRA_BLOCK( 4, p_mb->p_u_data ); \ DECODE_NONINTRA_BLOCK( 4, p_mb->p_u_data ) \
DECODE_NONINTRA_BLOCK( 5, p_mb->p_v_data ); \ DECODE_NONINTRA_BLOCK( 5, p_mb->p_v_data ) \
if( I_CHROMA != CHROMA_420 ) \ if( I_CHROMA != CHROMA_420 ) \
{ \ { \
DECODE_NONINTRA_BLOCK( 6, p_mb->p_u_data \ DECODE_NONINTRA_BLOCK( 6, p_mb->p_u_data \
+ i_chrom_dct_offset ); \ + i_chrom_dct_offset ) \
DECODE_NONINTRA_BLOCK( 7, p_mb->p_v_data \ DECODE_NONINTRA_BLOCK( 7, p_mb->p_v_data \
+ i_chrom_dct_offset ); \ + i_chrom_dct_offset ) \
if( I_CHROMA == CHROMA_444 ) \ if( I_CHROMA == CHROMA_444 ) \
{ \ { \
DECODE_NONINTRA_BLOCK( 8, p_mb->p_u_data + 8 ); \ DECODE_NONINTRA_BLOCK( 8, p_mb->p_u_data + 8 ) \
DECODE_NONINTRA_BLOCK( 9, p_mb->p_v_data + 8 ); \ DECODE_NONINTRA_BLOCK( 9, p_mb->p_v_data + 8 ) \
DECODE_NONINTRA_BLOCK( 10, p_mb->p_u_data + 8 \ DECODE_NONINTRA_BLOCK( 10, p_mb->p_u_data + 8 \
+ i_chrom_dct_offset ); \ + i_chrom_dct_offset ) \
DECODE_NONINTRA_BLOCK( 11, p_mb->p_v_data + 8 \ DECODE_NONINTRA_BLOCK( 11, p_mb->p_v_data + 8 \
+ i_chrom_dct_offset ); \ + i_chrom_dct_offset ) \
} \ } \
} \ } \
} \ } \
...@@ -294,38 +294,38 @@ void PSZ_NAME ( vdec_thread_t *p_vdec, macroblock_t * p_mb ) \ ...@@ -294,38 +294,38 @@ void PSZ_NAME ( vdec_thread_t *p_vdec, macroblock_t * p_mb ) \
else \ else \
{ \ { \
/* Intra macroblock */ \ /* Intra macroblock */ \
DECODE_INTRA_BLOCK( 0, p_mb->p_y_data ); \ DECODE_INTRA_BLOCK( 0, p_mb->p_y_data ) \
DECODE_INTRA_BLOCK( 1, p_mb->p_y_data + 8 ); \ DECODE_INTRA_BLOCK( 1, p_mb->p_y_data + 8 ) \
DECODE_INTRA_BLOCK( 2, p_mb->p_y_data + i_lum_dct_offset ); \ DECODE_INTRA_BLOCK( 2, p_mb->p_y_data + i_lum_dct_offset ) \
DECODE_INTRA_BLOCK( 3, p_mb->p_y_data + i_lum_dct_offset + 8 ); \ DECODE_INTRA_BLOCK( 3, p_mb->p_y_data + i_lum_dct_offset + 8 ) \
if( I_CHROMA != CHROMA_NONE ) \ if( I_CHROMA != CHROMA_NONE ) \
{ \ { \
DECODE_INTRA_BLOCK( 4, p_mb->p_u_data ); \ DECODE_INTRA_BLOCK( 4, p_mb->p_u_data ) \
DECODE_INTRA_BLOCK( 5, p_mb->p_v_data ); \ DECODE_INTRA_BLOCK( 5, p_mb->p_v_data ) \
if( I_CHROMA != CHROMA_420 ) \ if( I_CHROMA != CHROMA_420 ) \
{ \ { \
DECODE_INTRA_BLOCK( 6, p_mb->p_u_data \ DECODE_INTRA_BLOCK( 6, p_mb->p_u_data \
+ i_chrom_dct_offset ); \ + i_chrom_dct_offset ) \
DECODE_INTRA_BLOCK( 7, p_mb->p_v_data \ DECODE_INTRA_BLOCK( 7, p_mb->p_v_data \
+ i_chrom_dct_offset ); \ + i_chrom_dct_offset ) \
if( I_CHROMA == CHROMA_444 ) \ if( I_CHROMA == CHROMA_444 ) \
{ \ { \
DECODE_INTRA_BLOCK( 8, p_mb->p_u_data + 8 ); \ DECODE_INTRA_BLOCK( 8, p_mb->p_u_data + 8 ) \
DECODE_INTRA_BLOCK( 9, p_mb->p_v_data + 8 ); \ DECODE_INTRA_BLOCK( 9, p_mb->p_v_data + 8 ) \
DECODE_INTRA_BLOCK( 10, p_mb->p_u_data + 8 \ DECODE_INTRA_BLOCK( 10, p_mb->p_u_data + 8 \
+ i_chrom_dct_offset ); \ + i_chrom_dct_offset ) \
DECODE_INTRA_BLOCK( 11, p_mb->p_v_data + 8 \ DECODE_INTRA_BLOCK( 11, p_mb->p_v_data + 8 \
+ i_chrom_dct_offset ); \ + i_chrom_dct_offset ) \
} \ } \
} \ } \
} \ } \
} \ } \
} }
DECLARE_DECODEMB( vdec_DecodeMacroblockBW, CHROMA_NONE ); DECLARE_DECODEMB( vdec_DecodeMacroblockBW, CHROMA_NONE )
DECLARE_DECODEMB( vdec_DecodeMacroblock420, CHROMA_420 ); DECLARE_DECODEMB( vdec_DecodeMacroblock420, CHROMA_420 )
DECLARE_DECODEMB( vdec_DecodeMacroblock422, CHROMA_422 ); DECLARE_DECODEMB( vdec_DecodeMacroblock422, CHROMA_422 )
DECLARE_DECODEMB( vdec_DecodeMacroblock444, CHROMA_444 ); DECLARE_DECODEMB( vdec_DecodeMacroblock444, CHROMA_444 )
#undef DECLARE_DECODEMB #undef DECLARE_DECODEMB
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* decoder.h : video decoder thread * decoder.h : video decoder thread
***************************************************************************** *****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN * Copyright (C) 1999, 2000 VideoLAN
* $Id: decoder.h,v 1.2 2002/08/07 00:29:36 sam Exp $ * $Id: decoder.h,v 1.3 2002/08/08 00:35:11 sam Exp $
* *
* Authors: Christophe Massiot <massiot@via.ecp.fr> * Authors: Christophe Massiot <massiot@via.ecp.fr>
* *
...@@ -21,14 +21,13 @@ ...@@ -21,14 +21,13 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
*****************************************************************************/ *****************************************************************************/
VLC_DECLARE_STRUCT(vpar_thread_t) typedef struct vpar_thread_t vpar_thread_t;
VLC_DECLARE_STRUCT(vdec_thread_t) typedef struct vdec_pool_t vdec_pool_t;
VLC_DECLARE_STRUCT(vdec_pool_t)
/***************************************************************************** /*****************************************************************************
* vdec_thread_t: video decoder thread descriptor * vdec_thread_t: video decoder thread descriptor
*****************************************************************************/ *****************************************************************************/
struct vdec_thread_t typedef struct vdec_thread_t
{ {
VLC_COMMON_MEMBERS VLC_COMMON_MEMBERS
...@@ -37,7 +36,8 @@ struct vdec_thread_t ...@@ -37,7 +36,8 @@ struct vdec_thread_t
/* Input properties */ /* Input properties */
vdec_pool_t * p_pool; vdec_pool_t * p_pool;
};
} vdec_thread_t;
/***************************************************************************** /*****************************************************************************
* Prototypes * Prototypes
......
This diff is collapsed.
This diff is collapsed.
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* motion.c : C motion compensation module for vlc * motion.c : C motion compensation module for vlc
***************************************************************************** *****************************************************************************
* Copyright (C) 2001 VideoLAN * Copyright (C) 2001 VideoLAN
* $Id: motion.c,v 1.1 2002/08/04 17:23:42 sam Exp $ * $Id: motion.c,v 1.2 2002/08/08 00:35:11 sam Exp $
* *
* Authors: Aaron Holtzman <aholtzma@ess.engr.uvic.ca> * Authors: Aaron Holtzman <aholtzma@ess.engr.uvic.ca>
* Michel Lespinasse <walken@zoy.org> * Michel Lespinasse <walken@zoy.org>
...@@ -60,7 +60,7 @@ vlc_module_end(); ...@@ -60,7 +60,7 @@ vlc_module_end();
#define put(predictor,i) dest[i] = predictor (i) #define put(predictor,i) dest[i] = predictor (i)
#define avg(predictor,i) dest[i] = avg2 (predictor (i), dest[i]) #define avg(predictor,i) dest[i] = avg2 (predictor (i), dest[i])
// mc function template /* mc function template */
#define MC_FUNC(op,xy) \ #define MC_FUNC(op,xy) \
static void MC_##op##_##xy##16_c (yuv_data_t * dest, yuv_data_t * ref, \ static void MC_##op##_##xy##16_c (yuv_data_t * dest, yuv_data_t * ref, \
...@@ -104,7 +104,7 @@ static void MC_##op##_##xy##8_c (yuv_data_t * dest, yuv_data_t * ref, \ ...@@ -104,7 +104,7 @@ static void MC_##op##_##xy##8_c (yuv_data_t * dest, yuv_data_t * ref, \
} while (--height); \ } while (--height); \
} }
// definitions of the actual mc functions /* definitions of the actual mc functions */
MC_FUNC (put,o) MC_FUNC (put,o)
MC_FUNC (avg,o) MC_FUNC (avg,o)
......
This diff is collapsed.
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* motionmmxext.c : MMX EXT motion compensation module for vlc * motionmmxext.c : MMX EXT motion compensation module for vlc
***************************************************************************** *****************************************************************************
* Copyright (C) 2001 VideoLAN * Copyright (C) 2001 VideoLAN
* $Id: motionmmxext.c,v 1.1 2002/08/04 17:23:42 sam Exp $ * $Id: motionmmxext.c,v 1.2 2002/08/08 00:35:11 sam Exp $
* *
* Authors: Aaron Holtzman <aholtzma@ess.engr.uvic.ca> * Authors: Aaron Holtzman <aholtzma@ess.engr.uvic.ca>
* Michel Lespinasse <walken@zoy.org> * Michel Lespinasse <walken@zoy.org>
...@@ -56,7 +56,7 @@ vlc_module_end(); ...@@ -56,7 +56,7 @@ vlc_module_end();
#define CPU_3DNOW 1 #define CPU_3DNOW 1
//CPU_MMXEXT/CPU_3DNOW adaptation layer /* CPU_MMXEXT/CPU_3DNOW adaptation layer */
#define pavg_r2r(src,dest) \ #define pavg_r2r(src,dest) \
do { \ do { \
...@@ -75,7 +75,7 @@ do { \ ...@@ -75,7 +75,7 @@ do { \
} while (0) } while (0)
//CPU_MMXEXT code /* CPU_MMXEXT code */
static inline void MC_put1_8 (int height, yuv_data_t * dest, yuv_data_t * ref, static inline void MC_put1_8 (int height, yuv_data_t * dest, yuv_data_t * ref,
...@@ -222,8 +222,8 @@ static inline void MC_put4_8 (int height, yuv_data_t * dest, yuv_data_t * ref, ...@@ -222,8 +222,8 @@ static inline void MC_put4_8 (int height, yuv_data_t * dest, yuv_data_t * ref,
movq_r2m (mm0, *dest); movq_r2m (mm0, *dest);
dest += stride; dest += stride;
movq_r2r (mm6, mm7); // unroll ! movq_r2r (mm6, mm7); /* unroll ! */
movq_r2r (mm2, mm0); // unroll ! movq_r2r (mm2, mm0); /* unroll ! */
} while (--height); } while (--height);
} }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* spdif.c: A52 pass-through to external decoder with enabled soundcard * spdif.c: A52 pass-through to external decoder with enabled soundcard
***************************************************************************** *****************************************************************************
* Copyright (C) 2001 VideoLAN * Copyright (C) 2001 VideoLAN
* $Id: spdif.c,v 1.1 2002/08/04 17:23:42 sam Exp $ * $Id: spdif.c,v 1.2 2002/08/08 00:35:11 sam Exp $
* *
* Authors: Stphane Borel <stef@via.ecp.fr> * Authors: Stphane Borel <stef@via.ecp.fr>
* Juha Yrjola <jyrjola@cc.hut.fi> * Juha Yrjola <jyrjola@cc.hut.fi>
...@@ -195,7 +195,7 @@ static int RunDecoder( decoder_fifo_t *p_fifo ) ...@@ -195,7 +195,7 @@ static int RunDecoder( decoder_fifo_t *p_fifo )
i_current_pts += i_frame_time; i_current_pts += i_frame_time;
} }
// wait a little to avoid an input flood from the a52 input /* wait a little to avoid an input flood from the a52 input */
mwait( i_current_pts - 500000 ); mwait( i_current_pts - 500000 );
vlc_mutex_lock (&p_spdif->p_aout_fifo->data_lock); vlc_mutex_lock (&p_spdif->p_aout_fifo->data_lock);
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* mpeg_audio.c : mpeg_audio Stream input module for vlc * mpeg_audio.c : mpeg_audio Stream input module for vlc
***************************************************************************** *****************************************************************************
* Copyright (C) 2001 VideoLAN * Copyright (C) 2001 VideoLAN
* $Id: audio.c,v 1.2 2002/08/07 00:29:36 sam Exp $ * $Id: audio.c,v 1.3 2002/08/08 00:35:11 sam Exp $
* *
* Authors: Laurent Aimar <fenrir@via.ecp.fr> * Authors: Laurent Aimar <fenrir@via.ecp.fr>
* *
...@@ -272,7 +272,7 @@ static int MPEGAudio_SkipID3Tag( input_thread_t *p_input ) ...@@ -272,7 +272,7 @@ static int MPEGAudio_SkipID3Tag( input_thread_t *p_input )
i_size = (p_peek[6] << 21) + i_size = (p_peek[6] << 21) +
(p_peek[7] << 14) + (p_peek[7] << 14) +
(p_peek[8] << 7) + (p_peek[8] << 7) +
p_peek[9]; //Is this safe? p_peek[9]; /* Is this safe? */
if ( b_footer ) if ( b_footer )
{ {
i_size += 10; i_size += 10;
...@@ -285,7 +285,7 @@ static int MPEGAudio_SkipID3Tag( input_thread_t *p_input ) ...@@ -285,7 +285,7 @@ static int MPEGAudio_SkipID3Tag( input_thread_t *p_input )
return( -1 ); return( -1 );
} }
p_input->p_current_data += i_size; //seek passed end of ID3 tag p_input->p_current_data += i_size; /* seek passed end of ID3 tag */
return (0); return (0);
} }
......
...@@ -29,8 +29,6 @@ ...@@ -29,8 +29,6 @@
#include "playlist.h" #include "playlist.h"
#include "preferences.h" #include "preferences.h"
VLC_DECLARE_STRUCT(es_descriptor_t)
/***************************************************************************** /*****************************************************************************
* The TrackBar is graduated from 0 to SLIDER_MAX_VALUE. * The TrackBar is graduated from 0 to SLIDER_MAX_VALUE.
* SLIDER_MAX_VALUE is set to the higher acceptable value (2^31 - 1), in order * SLIDER_MAX_VALUE is set to the higher acceptable value (2^31 - 1), in order
......
/***************************************************************************** /*****************************************************************************
* fastmemcpy.h : fast memcpy routines * fastmemcpy.h : fast memcpy routines
***************************************************************************** *****************************************************************************
* $Id: fastmemcpy.h,v 1.1 2002/08/04 17:23:43 sam Exp $ * $Id: fastmemcpy.h,v 1.2 2002/08/08 00:35:11 sam Exp $
* *
* Authors: various Linux kernel hackers * Authors: various Linux kernel hackers
* various MPlayer hackers * various MPlayer hackers
...@@ -29,9 +29,9 @@ ...@@ -29,9 +29,9 @@
#define BLOCK_SIZE 4096 #define BLOCK_SIZE 4096
#define CONFUSION_FACTOR 0 #define CONFUSION_FACTOR 0
//Feel free to fine-tune the above 2, it might be possible to get some speedup with them :) /*Feel free to fine-tune the above 2, it might be possible to get some speedup with them :)*/
//#define STATISTICS /*#define STATISTICS*/
#ifndef HAVE_SSE2 #ifndef HAVE_SSE2
/* /*
...@@ -90,8 +90,8 @@ data. ...@@ -90,8 +90,8 @@ data.
If you have questions please contact with me: Nick Kurshev: nickols_k@mail.ru. If you have questions please contact with me: Nick Kurshev: nickols_k@mail.ru.
*/ */
// 3dnow memcpy support from kernel 2.4.2 /* 3dnow memcpy support from kernel 2.4.2 */
// by Pontscho/fresh!mindworkz /* by Pontscho/fresh!mindworkz */
#if defined( HAVE_MMX2 ) || defined( HAVE_3DNOW ) || defined( HAVE_MMX ) #if defined( HAVE_MMX2 ) || defined( HAVE_3DNOW ) || defined( HAVE_MMX )
...@@ -128,7 +128,7 @@ __asm__ __volatile__(\ ...@@ -128,7 +128,7 @@ __asm__ __volatile__(\
#ifdef HAVE_SSE #ifdef HAVE_SSE
#define MMREG_SIZE 16 #define MMREG_SIZE 16
#else #else
#define MMREG_SIZE 64 //8 #define MMREG_SIZE 64 /*8*/
#endif #endif
/* Small defines (for readability only) ;) */ /* Small defines (for readability only) ;) */
...@@ -245,7 +245,7 @@ void * fast_memcpy(void * to, const void * from, size_t len) ...@@ -245,7 +245,7 @@ void * fast_memcpy(void * to, const void * from, size_t len)
((unsigned char *)to)+=64; ((unsigned char *)to)+=64;
} }
#else #else
// Align destination at BLOCK_SIZE boundary /* Align destination at BLOCK_SIZE boundary */
for(; ((int)to & (BLOCK_SIZE-1)) && i>0; i--) for(; ((int)to & (BLOCK_SIZE-1)) && i>0; i--)
{ {
__asm__ __volatile__ ( __asm__ __volatile__ (
...@@ -269,12 +269,12 @@ void * fast_memcpy(void * to, const void * from, size_t len) ...@@ -269,12 +269,12 @@ void * fast_memcpy(void * to, const void * from, size_t len)
MOVNTQ" %%mm6, 48(%1)\n" MOVNTQ" %%mm6, 48(%1)\n"
MOVNTQ" %%mm7, 56(%1)\n" MOVNTQ" %%mm7, 56(%1)\n"
:: "r" (from), "r" (to) : "memory"); :: "r" (from), "r" (to) : "memory");
((const unsigned char *)from)+=64; from = (const void *) (((const unsigned char *)from)+64);
((unsigned char *)to)+=64; to = (void *) (((unsigned char *)to)+64);
} }
// printf(" %d %d\n", (int)from&1023, (int)to&1023); /* printf(" %d %d\n", (int)from&1023, (int)to&1023); */
// Pure Assembly cuz gcc is a bit unpredictable ;) /* Pure Assembly cuz gcc is a bit unpredictable ;) */
# if 0 # if 0
if(i>=BLOCK_SIZE/64) if(i>=BLOCK_SIZE/64)
asm volatile( asm volatile(
...@@ -314,7 +314,7 @@ void * fast_memcpy(void * to, const void * from, size_t len) ...@@ -314,7 +314,7 @@ void * fast_memcpy(void * to, const void * from, size_t len)
"jb 2b \n\t" "jb 2b \n\t"
#if CONFUSION_FACTOR > 0 #if CONFUSION_FACTOR > 0
// a few percent speedup on out of order executing CPUs /* a few percent speedup on out of order executing CPUs */
"movl %5, %%eax \n\t" "movl %5, %%eax \n\t"
"2: \n\t" "2: \n\t"
"movl (%0), %%ebx \n\t" "movl (%0), %%ebx \n\t"
...@@ -360,8 +360,8 @@ void * fast_memcpy(void * to, const void * from, size_t len) ...@@ -360,8 +360,8 @@ void * fast_memcpy(void * to, const void * from, size_t len)
MOVNTQ" %%mm6, 48(%1)\n" MOVNTQ" %%mm6, 48(%1)\n"
MOVNTQ" %%mm7, 56(%1)\n" MOVNTQ" %%mm7, 56(%1)\n"
:: "r" (from), "r" (to) : "memory"); :: "r" (from), "r" (to) : "memory");
((const unsigned char *)from)+=64; from = (const void *) (((const unsigned char *)from)+64);
((unsigned char *)to)+=64; to = (void *) (((unsigned char *)to)+64);
} }
#endif /* Have SSE */ #endif /* Have SSE */
......
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.
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.
This diff is collapsed.
This diff is collapsed.
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