Commit a70f8bb3 authored by Sam Hocevar's avatar Sam Hocevar

  * Mandatory step for video output IV and the audio output quality
    fix: the output threads are now spawned when a decoder needs one,
    so it can decide the audio frequency or the video window size. Still
    under heavy construction, so don't get too excited at finding bugs
    in it yet.

    Note: this change broke the XVideo module, so I made its score much
    lower than before. I suspect xvideo.so had a bug before which only
    appears now. Other video output plugins may be broken as well, but
    again this might be due to old existing bugs showing their ugly head.

  * Fixed a few buffer overflows in the Gnome interface.
  * The module bank is now a global variable. The video output bank and
    the audio output bank might follow (when they exist).
  * Coding style and organization fixes to the spdif decoder.
  * autoconf and Makefile changes by Arnaud Gomes-do-Vale
    <arnaud@carrosse.frmug.org>.
parent 7f1f24b3
...@@ -46,7 +46,7 @@ D: AC3 decoder ...@@ -46,7 +46,7 @@ D: AC3 decoder
N: Nilmoni Deb N: Nilmoni Deb
E: ndeb@ece.cmu.edu E: ndeb@ece.cmu.edu
D: Minor configure.in and Makefile.in fixes D: Minor autoconf and Makefile fixes
N: Cyril Deguet N: Cyril Deguet
C: asmax C: asmax
...@@ -75,6 +75,10 @@ D: ALSA audio output ...@@ -75,6 +75,10 @@ D: ALSA audio output
D: input netlist D: input netlist
D: MPEG TS input D: MPEG TS input
N: Arnaud Gomes-do-Vale
E: arnaud@carrosse.frmug.org
D: autoconf patches
N: Jean-Philippe Grimaldi N: Jean-Philippe Grimaldi
E: jeanphi@via.ecp.fr E: jeanphi@via.ecp.fr
C: jeanphi C: jeanphi
...@@ -148,7 +152,7 @@ D: MPEG video decoder ...@@ -148,7 +152,7 @@ D: MPEG video decoder
N: Arkadiusz Miskiewicz N: Arkadiusz Miskiewicz
E: misiek@pld.ORG.PL E: misiek@pld.ORG.PL
D: Makefile and configure patches D: autoconf and Makefile patches
N: Olivier Pomel N: Olivier Pomel
E: pomel@via.ecp.fr E: pomel@via.ecp.fr
...@@ -169,7 +173,7 @@ D: BeOS video output (BBitmap and Overlay) ...@@ -169,7 +173,7 @@ D: BeOS video output (BBitmap and Overlay)
N: Espen Skoglund N: Espen Skoglund
E: esk@ira.uka.de E: esk@ira.uka.de
D: FreeBSD configure.in and Makefile patches D: FreeBSD autoconf and Makefile patches
N: Benoit Steiner N: Benoit Steiner
E: benny@via.ecp.fr E: benny@via.ecp.fr
......
...@@ -4,7 +4,16 @@ ...@@ -4,7 +4,16 @@
HEAD HEAD
* DVD title change no longer restart the input. * Mandatory step for video output IV and the audio output quality
fix: the output threads are now spawned when a decoder needs one,
so it can decide the audio frequency or the video window size.
* Fixed a few buffer overflows in the Gnome interface.
* The module bank is now a global variable. The video output bank and
the audio output bank might follow (when they exist).
* Coding style and organization fixes to the spdif decoder.
* autoconf and Makefile changes by Arnaud Gomes-do-Vale
<arnaud@carrosse.frmug.org>.
* DVD title change no longer restarts the input.
* BeOS crash fix by Wade Majors <guru@startrek.com>. * BeOS crash fix by Wade Majors <guru@startrek.com>.
* Slight modification in ClockManageRef: after a synchro reinit, we still * Slight modification in ClockManageRef: after a synchro reinit, we still
do the mwait and re-init last-cr. do the mwait and re-init last-cr.
......
...@@ -14,13 +14,13 @@ Here is a shortcut to copy-paste for a complete build: ...@@ -14,13 +14,13 @@ Here is a shortcut to copy-paste for a complete build:
make distclean && ./configure --prefix=/usr --enable-gnome \ make distclean && ./configure --prefix=/usr --enable-gnome \
--enable-fb --with-glide --with-ggi --with-sdl --enable-esd \ --enable-fb --with-glide --with-ggi --with-sdl --enable-esd \
--enable-alsa --enable-mga --enable-gtk --enable-qt --enable-xvideo --enable-mga --enable-gtk --enable-qt --enable-xvideo
If you intend to debug stuff, you may want to disable optimizations: If you intend to debug stuff, you may want to disable optimizations:
make distclean && ./configure --prefix=/usr --enable-gnome \ make distclean && ./configure --prefix=/usr --enable-gnome \
--enable-fb --with-glide --with-ggi --with-sdl --enable-esd \ --enable-fb --with-glide --with-ggi --with-sdl --enable-esd \
--enable-alsa --enable-mga --enable-gtk --enable-qt --enable-xvideo \ --enable-mga --enable-gtk --enable-qt --enable-xvideo \
--disable-optimizatons --disable-optimizatons
......
...@@ -40,17 +40,17 @@ INTERFACE = src/interface/main.o \ ...@@ -40,17 +40,17 @@ INTERFACE = src/interface/main.o \
src/interface/intf_channels.o \ src/interface/intf_channels.o \
src/interface/intf_urldecode.o \ src/interface/intf_urldecode.o \
INPUT = src/input/input_ext-dec.o \ INPUT = src/input/input.o \
src/input/input_ext-dec.o \
src/input/input_ext-intf.o \ src/input/input_ext-intf.o \
src/input/input_dec.o \ src/input/input_dec.o \
src/input/input_programs.o \ src/input/input_programs.o \
src/input/input_netlist.o \ src/input/input_netlist.o \
src/input/input_clock.o \ src/input/input_clock.o \
src/input/input.o \
src/input/mpeg_system.o src/input/mpeg_system.o
AUDIO_OUTPUT = src/audio_output/audio_output.o \ AUDIO_OUTPUT = src/audio_output/audio_output.o \
src/audio_output/aout_fifo.o \ src/audio_output/aout_ext-dec.o \
src/audio_output/aout_u8.o \ src/audio_output/aout_u8.o \
src/audio_output/aout_s8.o \ src/audio_output/aout_s8.o \
src/audio_output/aout_u16.o \ src/audio_output/aout_u16.o \
...@@ -356,5 +356,4 @@ $(PLUGIN_OBJ): FORCE ...@@ -356,5 +356,4 @@ $(PLUGIN_OBJ): FORCE
builtins: Makefile.modules Makefile.opts Makefile.dep Makefile $(BUILTIN_OBJ) builtins: Makefile.modules Makefile.opts Makefile.dep Makefile $(BUILTIN_OBJ)
$(BUILTIN_OBJ): FORCE $(BUILTIN_OBJ): FORCE
cd $(shell echo " "$(PLUGINS_TARGETS)" " | sed -e 's@.* \([^/]*/\)'$(@:lib/%.a=%)' .*@plugins/\1@' -e 's@^ .*@@') && $(MAKE) $(@:%=../../%) cd $(shell echo " "$(PLUGINS_TARGETS)" " | sed -e 's@.* \([^/]*/\)'$(@:lib/%.a=%)' .*@plugins/\1@' -e 's@^ .*@@') && $(MAKE) $(@:%=../../%)
$(RANLIB) $@
...@@ -45,6 +45,7 @@ CC = @CC@ ...@@ -45,6 +45,7 @@ CC = @CC@
CFLAGS = @CFLAGS@ CFLAGS = @CFLAGS@
SHELL = @SHELL@ SHELL = @SHELL@
RANLIB = @RANLIB@ RANLIB = @RANLIB@
MOC = @MOC@
# #
# Installation environment # Installation environment
......
This diff is collapsed.
...@@ -48,6 +48,7 @@ AC_CHECK_FUNC(inet_aton,,[ ...@@ -48,6 +48,7 @@ AC_CHECK_FUNC(inet_aton,,[
AC_CHECK_LIB(resolv,inet_aton,LIB="${LIB} -lresolv") AC_CHECK_LIB(resolv,inet_aton,LIB="${LIB} -lresolv")
]) ])
AC_CHECK_FUNCS(vasprintf) AC_CHECK_FUNCS(vasprintf)
AC_CHECK_FUNCS(swab)
AC_CHECK_FUNC(getopt_long,[AC_DEFINE(HAVE_GETOPT_LONG,1,long getopt support)], AC_CHECK_FUNC(getopt_long,[AC_DEFINE(HAVE_GETOPT_LONG,1,long getopt support)],
[ # FreeBSD has a gnugetopt library for this: [ # FreeBSD has a gnugetopt library for this:
...@@ -392,6 +393,12 @@ AC_ARG_ENABLE(qt, ...@@ -392,6 +393,12 @@ AC_ARG_ENABLE(qt,
PLUGINS="${PLUGINS} qt" PLUGINS="${PLUGINS} qt"
ALIASES="${ALIASES} qvlc" ALIASES="${ALIASES} qvlc"
LIB_QT="-lqt -L${QTDIR}/lib" LIB_QT="-lqt -L${QTDIR}/lib"
if test -x ${QTDIR}/bin/moc ;
then
MOC=${QTDIR}/bin/moc
else
MOC=moc
fi
fi]) fi])
dnl dnl
...@@ -499,6 +506,7 @@ AC_SUBST(STATS) ...@@ -499,6 +506,7 @@ AC_SUBST(STATS)
AC_SUBST(TRACE) AC_SUBST(TRACE)
AC_SUBST(OPTIMS) AC_SUBST(OPTIMS)
AC_SUBST(CSS) AC_SUBST(CSS)
AC_SUBST(MOC)
AC_SUBST(LCFLAGS) AC_SUBST(LCFLAGS)
AC_SUBST(LIB) AC_SUBST(LIB)
...@@ -539,8 +547,8 @@ trace mode : ${TRACE} ...@@ -539,8 +547,8 @@ trace mode : ${TRACE}
optimizations : ${OPTIMS} optimizations : ${OPTIMS}
CSS decryption : ${CSS} CSS decryption : ${CSS}
need builtin getopt : ${GETOPT} need builtin getopt : ${GETOPT}
plugin modules :${PLUGINS}
built-in modules :${BUILTINS} built-in modules :${BUILTINS}
plugin modules :${PLUGINS}
vlc aliases :${ALIASES} vlc aliases :${ALIASES}
You may now tune Makefile.opts at your convenience." You may now tune Makefile.opts at your convenience."
......
...@@ -47,7 +47,10 @@ Disable audio output. ...@@ -47,7 +47,10 @@ Disable audio output.
Specify an audio output module: "dsp", "esd", for instance. Specify an audio output module: "dsp", "esd", for instance.
.TP .TP
.B \-\-stereo, \-\-mono .B \-\-stereo, \-\-mono
Choose stereo or mono audio output Choose stereo or mono audio output.
.TP
.B \-\-spdif
Activate hardware AC3 pass-through mode.
.TP .TP
.B \-\-novideo .B \-\-novideo
Disable video output. Disable video output.
...@@ -145,6 +148,7 @@ also accepts a lot of parameters to customize its behaviour. ...@@ -145,6 +148,7 @@ also accepts a lot of parameters to customize its behaviour.
vlc_aout=<method name> audio method vlc_aout=<method name> audio method
vlc_dsp=<filename> dsp device path vlc_dsp=<filename> dsp device path
vlc_stereo={1|0} stereo or mono output vlc_stereo={1|0} stereo or mono output
vlc_spdif={1|0} AC3 pass-through mode
vlc_audio_rate=<rate> output rate vlc_audio_rate=<rate> output rate
.TP .TP
.B Video parameters: .B Video parameters:
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* audio_output.h : audio output thread interface * audio_output.h : audio output thread interface
***************************************************************************** *****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN * Copyright (C) 1999, 2000 VideoLAN
* $Id: audio_output.h,v 1.32 2001/04/29 02:48:51 stef Exp $ * $Id: audio_output.h,v 1.33 2001/05/01 04:18:17 sam Exp $
* *
* Authors: Michel Kaempf <maxx@via.ecp.fr> * Authors: Michel Kaempf <maxx@via.ecp.fr>
* *
...@@ -21,27 +21,6 @@ ...@@ -21,27 +21,6 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
*****************************************************************************/ *****************************************************************************/
/*****************************************************************************
* Required headers:
* - "common.h" ( boolean_t )
* - "mtime.h" ( mtime_t )
* - "threads.h" ( vlc_thread_t )
*****************************************************************************/
/* TODO :
*
* - Créer un flag destroy dans les fifos audio pour indiquer au thread audio
* qu'il peut libérer la mémoire occupée par le buffer de la fifo lorsqu'il
* le désire (fin du son ou fin du thread)
*
*/
/*
* Macros
*/
#define AOUT_FIFO_ISEMPTY( fifo ) ( (fifo).l_end_frame == (fifo).l_start_frame )
#define AOUT_FIFO_ISFULL( fifo ) ( ((((fifo).l_end_frame + 1) - (fifo).l_start_frame) & AOUT_FIFO_SIZE) == 0 )
/***************************************************************************** /*****************************************************************************
* aout_increment_t * aout_increment_t
***************************************************************************** *****************************************************************************
...@@ -112,23 +91,22 @@ typedef struct aout_fifo_s ...@@ -112,23 +91,22 @@ typedef struct aout_fifo_s
} aout_fifo_t; } aout_fifo_t;
#define AOUT_FIFO_ISEMPTY( fifo ) \
( (fifo).l_end_frame == (fifo).l_start_frame )
#define AOUT_FIFO_ISFULL( fifo ) \
( ((((fifo).l_end_frame + 1) - (fifo).l_start_frame) & AOUT_FIFO_SIZE) == 0 )
#define AOUT_EMPTY_FIFO 0 #define AOUT_EMPTY_FIFO 0
#define AOUT_INTF_MONO_FIFO 1 #define AOUT_INTF_MONO_FIFO 1
#define AOUT_INTF_STEREO_FIFO 2 #define AOUT_INTF_STEREO_FIFO 2
#define AOUT_ADEC_MONO_FIFO 3 #define AOUT_ADEC_MONO_FIFO 3
#define AOUT_ADEC_STEREO_FIFO 4 #define AOUT_ADEC_STEREO_FIFO 4
#define AOUT_ADEC_SPDIF_FIFO 5
/***************************************************************************** /*****************************************************************************
* aout_thread_t : audio output thread descriptor * aout_thread_t : audio output thread descriptor
*****************************************************************************/ *****************************************************************************/
typedef int (aout_open_t) ( p_aout_thread_t p_aout );
typedef int (aout_setformat_t) ( p_aout_thread_t p_aout );
typedef long (aout_getbufinfo_t) ( p_aout_thread_t p_aout,
long l_buffer_limit );
typedef void (aout_play_t) ( p_aout_thread_t p_aout,
byte_t *buffer, int i_size );
typedef void (aout_close_t) ( p_aout_thread_t p_aout );
typedef struct aout_thread_s typedef struct aout_thread_s
{ {
vlc_thread_t thread_id; vlc_thread_t thread_id;
...@@ -140,11 +118,11 @@ typedef struct aout_thread_s ...@@ -140,11 +118,11 @@ typedef struct aout_thread_s
/* Plugin used and shortcuts to access its capabilities */ /* Plugin used and shortcuts to access its capabilities */
struct module_s * p_module; struct module_s * p_module;
aout_open_t * pf_open; int ( *pf_open ) ( p_aout_thread_t );
aout_setformat_t * pf_setformat; int ( *pf_setformat ) ( p_aout_thread_t );
aout_getbufinfo_t * pf_getbufinfo; long ( *pf_getbufinfo ) ( p_aout_thread_t, long );
aout_play_t * pf_play; void ( *pf_play ) ( p_aout_thread_t, byte_t *, int );
aout_close_t * pf_close; void ( *pf_close ) ( p_aout_thread_t );
void * buffer; void * buffer;
/* The s32 buffer is used to mix all the audio fifos together before /* The s32 buffer is used to mix all the audio fifos together before
...@@ -164,6 +142,8 @@ typedef struct aout_thread_s ...@@ -164,6 +142,8 @@ typedef struct aout_thread_s
char * psz_device; char * psz_device;
int i_fd; int i_fd;
/* The current volume */
int i_vol;
/* Format of the audio output samples */ /* Format of the audio output samples */
int i_format; int i_format;
/* Number of channels */ /* Number of channels */
...@@ -178,10 +158,6 @@ typedef struct aout_thread_s ...@@ -178,10 +158,6 @@ typedef struct aout_thread_s
* for the OSS output */ * for the OSS output */
p_aout_sys_t p_sys; p_aout_sys_t p_sys;
/* there is the current volume */
int vol;
} aout_thread_t; } aout_thread_t;
/* Those are from <linux/soundcard.h> but are needed because of formats /* Those are from <linux/soundcard.h> but are needed because of formats
...@@ -205,11 +181,9 @@ typedef struct aout_thread_s ...@@ -205,11 +181,9 @@ typedef struct aout_thread_s
* Prototypes * Prototypes
*****************************************************************************/ *****************************************************************************/
aout_thread_t * aout_CreateThread ( int *pi_status ); aout_thread_t * aout_CreateThread ( int *pi_status );
void aout_DestroyThread ( aout_thread_t *p_aout, void aout_DestroyThread ( aout_thread_t *, int * );
int *pi_status );
aout_fifo_t * aout_CreateFifo ( aout_thread_t *p_aout, aout_fifo_t * aout_CreateFifo ( int, int, long, long, long, void * );
aout_fifo_t *p_fifo );
void aout_DestroyFifo ( aout_fifo_t *p_fifo ); void aout_DestroyFifo ( aout_fifo_t *p_fifo );
void aout_FreeFifo ( aout_fifo_t *p_fifo ); void aout_FreeFifo ( aout_fifo_t *p_fifo );
...@@ -238,6 +238,10 @@ ...@@ -238,6 +238,10 @@
#define AOUT_STEREO_VAR "vlc_stereo" #define AOUT_STEREO_VAR "vlc_stereo"
#define AOUT_STEREO_DEFAULT 1 #define AOUT_STEREO_DEFAULT 1
/* Environment variable for spdif mode */
#define AOUT_SPDIF_VAR "vlc_spdif"
#define AOUT_SPDIF_DEFAULT 0
/* Volume */ /* Volume */
#define VOLUME_DEFAULT 512 #define VOLUME_DEFAULT 512
#define VOLUME_STEP 128 #define VOLUME_STEP 128
......
...@@ -46,6 +46,9 @@ ...@@ -46,6 +46,9 @@
/* Define if you have the strtol function. */ /* Define if you have the strtol function. */
#undef HAVE_STRTOL #undef HAVE_STRTOL
/* Define if you have the swab function. */
#undef HAVE_SWAB
/* Define if you have the usleep function. */ /* Define if you have the usleep function. */
#undef HAVE_USLEEP #undef HAVE_USLEEP
......
...@@ -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, 2000 VideoLAN * Copyright (C) 1999, 2000 VideoLAN
* $Id: input_ext-dec.h,v 1.30 2001/04/28 03:36:25 sam Exp $ * $Id: input_ext-dec.h,v 1.31 2001/05/01 04:18:17 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>
...@@ -545,15 +545,10 @@ typedef struct vdec_config_s ...@@ -545,15 +545,10 @@ typedef struct vdec_config_s
***************************************************************************** *****************************************************************************
* Pointers given to audio decoders threads. * Pointers given to audio decoders threads.
*****************************************************************************/ *****************************************************************************/
struct aout_thread_s;
typedef struct adec_config_s typedef struct adec_config_s
{ {
struct aout_thread_s * p_aout; struct aout_fifo_s * (* pf_create_fifo)( struct aout_fifo_s * );
void (* pf_destroy_fifo)( void );
struct aout_fifo_s * (* pf_create_fifo)( struct aout_thread_s *,
struct aout_fifo_s * );
void (* pf_destroy_fifo)( struct aout_thread_s *);
decoder_config_t decoder_config; decoder_config_t decoder_config;
} adec_config_t; } adec_config_t;
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
* control the pace of reading. * control the pace of reading.
***************************************************************************** *****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN * Copyright (C) 1999, 2000 VideoLAN
* $Id: input_ext-intf.h,v 1.34 2001/04/20 05:40:03 stef Exp $ * $Id: input_ext-intf.h,v 1.35 2001/05/01 04:18:17 sam Exp $
* *
* Authors: Christophe Massiot <massiot@via.ecp.fr> * Authors: Christophe Massiot <massiot@via.ecp.fr>
* *
...@@ -134,7 +134,6 @@ typedef struct pgrm_descriptor_s ...@@ -134,7 +134,6 @@ typedef struct pgrm_descriptor_s
/* Decoders control */ /* Decoders control */
struct vout_thread_s * p_vout; struct vout_thread_s * p_vout;
struct aout_thread_s * p_aout;
int i_es_number; /* size of the following array */ int i_es_number; /* size of the following array */
es_descriptor_t ** pp_es; /* array of pointers to ES */ es_descriptor_t ** pp_es; /* array of pointers to ES */
...@@ -250,7 +249,6 @@ typedef struct i_p_config_s ...@@ -250,7 +249,6 @@ typedef struct i_p_config_s
***************************************************************************** *****************************************************************************
* This structure includes all the local static variables of an input thread * This structure includes all the local static variables of an input thread
*****************************************************************************/ *****************************************************************************/
struct aout_thread_s;
struct vout_thread_s; struct vout_thread_s;
typedef struct input_thread_s typedef struct input_thread_s
...@@ -305,7 +303,6 @@ typedef struct input_thread_s ...@@ -305,7 +303,6 @@ typedef struct input_thread_s
stream_descriptor_t stream; /* PAT tables */ stream_descriptor_t stream; /* PAT tables */
/* For auto-launch of decoders */ /* For auto-launch of decoders */
struct aout_thread_s * p_default_aout;
struct vout_thread_s * p_default_vout; struct vout_thread_s * p_default_vout;
#ifdef STATS #ifdef STATS
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
* Declaration and extern access to global program object. * Declaration and extern access to global program object.
***************************************************************************** *****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN * Copyright (C) 1999, 2000 VideoLAN
* $Id: main.h,v 1.16 2001/04/29 02:48:51 stef Exp $ * $Id: main.h,v 1.17 2001/05/01 04:18:17 sam Exp $
* *
* Authors: Vincent Seguin <seguin@via.ecp.fr> * Authors: Vincent Seguin <seguin@via.ecp.fr>
* *
...@@ -48,7 +48,6 @@ typedef struct ...@@ -48,7 +48,6 @@ typedef struct
boolean_t b_audio; /* is audio output allowed ? */ boolean_t b_audio; /* is audio output allowed ? */
boolean_t b_video; /* is video output allowed ? */ boolean_t b_video; /* is video output allowed ? */
boolean_t b_channels; /* is channel changing supported ? */ boolean_t b_channels; /* is channel changing supported ? */
boolean_t b_spdif; /* spdif mode ? */
/* Unique threads */ /* Unique threads */
p_vout_thread_t p_vout; /* video output thread */ p_vout_thread_t p_vout; /* video output thread */
...@@ -57,7 +56,6 @@ typedef struct ...@@ -57,7 +56,6 @@ typedef struct
/* Shared data - these structures are accessed directly from p_main by /* Shared data - these structures are accessed directly from p_main by
* several modules */ * several modules */
struct module_bank_s * p_bank; /* module bank */
p_playlist_t p_playlist; /* playlist */ p_playlist_t p_playlist; /* playlist */
p_intf_msg_t p_msg; /* messages interface data */ p_intf_msg_t p_msg; /* messages interface data */
p_input_channel_t p_channel; /* channel library data */ p_input_channel_t p_channel; /* channel library data */
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* modules.h : Module management functions. * modules.h : Module management functions.
***************************************************************************** *****************************************************************************
* Copyright (C) 2001 VideoLAN * Copyright (C) 2001 VideoLAN
* $Id: modules.h,v 1.21 2001/04/28 03:36:25 sam Exp $ * $Id: modules.h,v 1.22 2001/05/01 04:18:17 sam Exp $
* *
* Authors: Samuel Hocevar <sam@zoy.org> * Authors: Samuel Hocevar <sam@zoy.org>
* *
...@@ -25,6 +25,25 @@ ...@@ -25,6 +25,25 @@
#include <sys/types.h> /* off_t */ #include <sys/types.h> /* off_t */
#endif #endif
/*****************************************************************************
* bank_t, p_bank (global variable)
*****************************************************************************
* This global variable is accessed by any function using modules.
*****************************************************************************/
typedef struct
{
struct module_s * first; /* First module of the bank */
vlc_mutex_t lock; /* Global lock -- you can't imagine how awful it
is to design thread-safe linked lists. */
} bank_t;
extern bank_t *p_bank;
/*****************************************************************************
* Module #defines.
*****************************************************************************/
/* Number of tries before we unload an unused module */ /* Number of tries before we unload an unused module */
#define MODULE_HIDE_DELAY 100 #define MODULE_HIDE_DELAY 100
...@@ -224,15 +243,6 @@ typedef struct module_config_s ...@@ -224,15 +243,6 @@ typedef struct module_config_s
* Bank and module description structures * Bank and module description structures
*****************************************************************************/ *****************************************************************************/
/* The module bank structure */
typedef struct module_bank_s
{
struct module_s * first; /* First module of the bank */
vlc_mutex_t lock; /* Global lock -- you can't imagine how awful it
is to design thread-safe linked lists. */
} module_bank_t;
/* The module description structure */ /* The module description structure */
typedef struct module_s typedef struct module_s
{ {
...@@ -275,14 +285,10 @@ typedef struct module_s ...@@ -275,14 +285,10 @@ typedef struct module_s
/***************************************************************************** /*****************************************************************************
* Exported functions. * Exported functions.
*****************************************************************************/ *****************************************************************************/
module_bank_t * module_CreateBank ( void ); void module_InitBank ( void );
void module_InitBank ( module_bank_t * p_bank ); void module_EndBank ( void );
void module_DestroyBank ( module_bank_t * p_bank ); void module_ResetBank ( void );
void module_ResetBank ( module_bank_t * p_bank ); void module_ManageBank ( void );
void module_ManageBank ( module_bank_t * p_bank ); module_t * module_Need ( int i_capabilities, void *p_data );
void module_Unneed ( module_t * p_module );
module_t * module_Need ( module_bank_t *p_bank,
int i_capabilities, void *p_data );
void module_Unneed ( module_bank_t * p_bank,
module_t * p_module );
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
*****************************************************************************/ *****************************************************************************/
#define ALLOCATE_BUILTIN( NAME ) \ #define ALLOCATE_BUILTIN( NAME ) \
AllocateBuiltinModule( p_bank, module_ ## NAME ## _InitModule, \ AllocateBuiltinModule( module_ ## NAME ## _InitModule, \
module_ ## NAME ## _ActivateModule, \ module_ ## NAME ## _ActivateModule, \
module_ ## NAME ## _DeactivateModule ); module_ ## NAME ## _DeactivateModule );
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
* thread, and destroy a previously oppenned video output thread. * thread, and destroy a previously oppenned video output thread.
***************************************************************************** *****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN * Copyright (C) 1999, 2000 VideoLAN
* $Id: video_output.h,v 1.57 2001/03/21 13:42:33 sam Exp $ * $Id: video_output.h,v 1.58 2001/05/01 04:18:17 sam Exp $
* *
* Authors: Vincent Seguin <seguin@via.ecp.fr> * Authors: Vincent Seguin <seguin@via.ecp.fr>
* *
...@@ -106,6 +106,28 @@ typedef struct vout_buffer_s ...@@ -106,6 +106,28 @@ typedef struct vout_buffer_s
byte_t * p_data; /* memory address */ byte_t * p_data; /* memory address */
} vout_buffer_t; } vout_buffer_t;
/*****************************************************************************
* vout_fifo_t
*****************************************************************************/
typedef struct vout_fifo_s
{
/* See the fifo types below */
int i_type;
boolean_t b_die;
int i_fifo; /* Just to keep track of the fifo index */
int i_width;
int i_height;
vlc_mutex_t data_lock;
vlc_cond_t data_wait;
} vout_fifo_t;
#define VOUT_EMPTY_FIFO 0
#define VOUT_YUV_FIFO 1
#define VOUT_SPU_FIFO 2
/***************************************************************************** /*****************************************************************************
* vout_thread_t: video output thread descriptor * vout_thread_t: video output thread descriptor
***************************************************************************** *****************************************************************************
...@@ -236,6 +258,11 @@ typedef struct vout_thread_s ...@@ -236,6 +258,11 @@ typedef struct vout_thread_s
*****************************************************************************/ *****************************************************************************/
vout_thread_t * vout_CreateThread ( int *pi_status ); vout_thread_t * vout_CreateThread ( int *pi_status );
void vout_DestroyThread ( vout_thread_t *p_vout, int *pi_status ); void vout_DestroyThread ( vout_thread_t *p_vout, int *pi_status );
vout_fifo_t * vout_CreateFifo ( void );
void vout_DestroyFifo ( vout_fifo_t *p_fifo );
void vout_FreeFifo ( vout_fifo_t *p_fifo );
picture_t * vout_CreatePicture ( vout_thread_t *p_vout, int i_type, picture_t * vout_CreatePicture ( vout_thread_t *p_vout, int i_type,
int i_width, int i_height ); int i_width, int i_height );
void vout_DestroyPicture ( vout_thread_t *p_vout, picture_t *p_pic ); void vout_DestroyPicture ( vout_thread_t *p_vout, picture_t *p_pic );
......
...@@ -27,4 +27,5 @@ include ../../Makefile.modules ...@@ -27,4 +27,5 @@ include ../../Makefile.modules
../../lib/alsa.a: $(BUILTIN_C) ../../lib/alsa.a: $(BUILTIN_C)
ar r $@ $^ ar r $@ $^
$(RANLIB) $@
...@@ -27,4 +27,5 @@ include ../../Makefile.modules ...@@ -27,4 +27,5 @@ include ../../Makefile.modules
../../lib/beos.a: $(BUILTIN_CPP) ../../lib/beos.a: $(BUILTIN_CPP)
ar r $@ $^ ar r $@ $^
$(RANLIB) $@
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* intf_beos.cpp: beos interface * intf_beos.cpp: beos interface
***************************************************************************** *****************************************************************************
* Copyright (C) 1999, 2000, 2001 VideoLAN * Copyright (C) 1999, 2000, 2001 VideoLAN
* $Id: intf_beos.cpp,v 1.26 2001/04/29 17:03:20 sam Exp $ * $Id: intf_beos.cpp,v 1.27 2001/05/01 04:18:17 sam Exp $
* *
* Authors: Jean-Marc Dressler <polux@via.ecp.fr> * Authors: Jean-Marc Dressler <polux@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org> * Samuel Hocevar <sam@zoy.org>
...@@ -281,7 +281,7 @@ void InterfaceWindow::MessageReceived( BMessage * p_message ) ...@@ -281,7 +281,7 @@ void InterfaceWindow::MessageReceived( BMessage * p_message )
// silence the sound, otherwise very horrible // silence the sound, otherwise very horrible
if (p_main->p_aout != NULL) if (p_main->p_aout != NULL)
{ {
p_main->p_aout->vol = 0; p_main->p_aout->i_vol = 0;
} }
snooze(400000); snooze(400000);
input_SetStatus(p_intf->p_input, INPUT_STATUS_END); input_SetStatus(p_intf->p_input, INPUT_STATUS_END);
...@@ -293,7 +293,7 @@ void InterfaceWindow::MessageReceived( BMessage * p_message ) ...@@ -293,7 +293,7 @@ void InterfaceWindow::MessageReceived( BMessage * p_message )
// { // {
// if (p_main->p_aout != NULL) // if (p_main->p_aout != NULL)
// { // {
// p_main->p_aout->vol = vol_val; // p_main->p_aout->i_vol = vol_val;
// } // }
// snooze(400000); // snooze(400000);
// input_SetStatus(p_intf->p_input, INPUT_STATUS_PLAY); // input_SetStatus(p_intf->p_input, INPUT_STATUS_PLAY);
...@@ -309,7 +309,7 @@ void InterfaceWindow::MessageReceived( BMessage * p_message ) ...@@ -309,7 +309,7 @@ void InterfaceWindow::MessageReceived( BMessage * p_message )
{ {
if (p_main->p_aout != NULL) if (p_main->p_aout != NULL)
{ {
p_main->p_aout->vol = 0; p_main->p_aout->i_vol = 0;
} }
playback_status = PAUSED; playback_status = PAUSED;
} }
...@@ -318,7 +318,7 @@ void InterfaceWindow::MessageReceived( BMessage * p_message ) ...@@ -318,7 +318,7 @@ void InterfaceWindow::MessageReceived( BMessage * p_message )
{ {
if (p_main->p_aout != NULL) if (p_main->p_aout != NULL)
{ {
p_main->p_aout->vol = vol_val; p_main->p_aout->i_vol = vol_val;
} }
playback_status = PLAYING; playback_status = PLAYING;
} }
...@@ -332,7 +332,7 @@ void InterfaceWindow::MessageReceived( BMessage * p_message ) ...@@ -332,7 +332,7 @@ void InterfaceWindow::MessageReceived( BMessage * p_message )
{ {
if (p_main->p_aout != NULL) if (p_main->p_aout != NULL)
{ {
p_main->p_aout->vol = 0; p_main->p_aout->i_vol = 0;
} }
snooze(400000); snooze(400000);
input_SetStatus(p_intf->p_input, INPUT_STATUS_FASTER); input_SetStatus(p_intf->p_input, INPUT_STATUS_FASTER);
...@@ -344,7 +344,7 @@ void InterfaceWindow::MessageReceived( BMessage * p_message ) ...@@ -344,7 +344,7 @@ void InterfaceWindow::MessageReceived( BMessage * p_message )
{ {
if (p_main->p_aout != NULL) if (p_main->p_aout != NULL)
{ {
p_main->p_aout->vol = 0; p_main->p_aout->i_vol = 0;
} }
snooze(400000); snooze(400000);
input_SetStatus(p_intf->p_input, INPUT_STATUS_SLOWER); input_SetStatus(p_intf->p_input, INPUT_STATUS_SLOWER);
...@@ -357,22 +357,22 @@ void InterfaceWindow::MessageReceived( BMessage * p_message ) ...@@ -357,22 +357,22 @@ void InterfaceWindow::MessageReceived( BMessage * p_message )
// adjust the volume // adjust the volume
if (p_main->p_aout != NULL) if (p_main->p_aout != NULL)
{ {
p_main->p_aout->vol = vol_val; p_main->p_aout->i_vol = vol_val;
} }
break; break;
case VOLUME_MUTE: case VOLUME_MUTE:
// mute // mute
if (p_main->p_aout != NULL) if (p_main->p_aout != NULL)
{ {
if (p_main->p_aout->vol == 0) if (p_main->p_aout->i_vol == 0)
{ {
p_vol->SetEnabled(true); p_vol->SetEnabled(true);
p_main->p_aout->vol = vol_val; p_main->p_aout->i_vol = vol_val;
} }
else else
{ {
p_vol->SetEnabled(false); p_vol->SetEnabled(false);
p_main->p_aout->vol = 0; p_main->p_aout->i_vol = 0;
} }
} }
break; break;
......
...@@ -27,4 +27,5 @@ include ../../Makefile.modules ...@@ -27,4 +27,5 @@ include ../../Makefile.modules
../../lib/darwin.a: $(BUILTIN_C) ../../lib/darwin.a: $(BUILTIN_C)
ar r $@ $^ ar r $@ $^
$(RANLIB) $@
...@@ -27,4 +27,5 @@ include ../../Makefile.modules ...@@ -27,4 +27,5 @@ include ../../Makefile.modules
../../lib/dsp.a: $(BUILTIN_C) ../../lib/dsp.a: $(BUILTIN_C)
ar r $@ $^ ar r $@ $^
$(RANLIB) $@
...@@ -27,4 +27,5 @@ include ../../Makefile.modules ...@@ -27,4 +27,5 @@ include ../../Makefile.modules
../../lib/dummy.a: $(BUILTIN_C) ../../lib/dummy.a: $(BUILTIN_C)
ar r $@ $^ ar r $@ $^
$(RANLIB) $@
...@@ -27,4 +27,5 @@ include ../../Makefile.modules ...@@ -27,4 +27,5 @@ include ../../Makefile.modules
../../lib/dvd.a: $(BUILTIN_C) ../../lib/dvd.a: $(BUILTIN_C)
ar r $@ $^ ar r $@ $^
$(RANLIB) $@
...@@ -27,4 +27,5 @@ include ../../Makefile.modules ...@@ -27,4 +27,5 @@ include ../../Makefile.modules
../../lib/esd.a: $(BUILTIN_C) ../../lib/esd.a: $(BUILTIN_C)
ar r $@ $^ ar r $@ $^
$(RANLIB) $@
...@@ -27,4 +27,5 @@ include ../../Makefile.modules ...@@ -27,4 +27,5 @@ include ../../Makefile.modules
../../lib/fb.a: $(BUILTIN_C) ../../lib/fb.a: $(BUILTIN_C)
ar r $@ $^ ar r $@ $^
$(RANLIB) $@
...@@ -27,4 +27,5 @@ include ../../Makefile.modules ...@@ -27,4 +27,5 @@ include ../../Makefile.modules
../../lib/ggi.a: $(BUILTIN_C) ../../lib/ggi.a: $(BUILTIN_C)
ar r $@ $^ ar r $@ $^
$(RANLIB) $@
...@@ -35,4 +35,5 @@ $(BUILTIN_GLIDE): BUILTIN_%.o: %.c ...@@ -35,4 +35,5 @@ $(BUILTIN_GLIDE): BUILTIN_%.o: %.c
../../lib/glide.a: $(BUILTIN_GLIDE) ../../lib/glide.a: $(BUILTIN_GLIDE)
ar r $@ $^ ar r $@ $^
$(RANLIB) $@
...@@ -35,4 +35,5 @@ $(BUILTIN_GNOME): BUILTIN_%.o: %.c ...@@ -35,4 +35,5 @@ $(BUILTIN_GNOME): BUILTIN_%.o: %.c
../../lib/gnome.a: $(BUILTIN_GNOME) ../../lib/gnome.a: $(BUILTIN_GNOME)
ar r $@ $^ ar r $@ $^
$(RANLIB) $@
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* gnome_callbacks.c : Callbacks for the Gnome plugin. * gnome_callbacks.c : Callbacks for the Gnome plugin.
***************************************************************************** *****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN * Copyright (C) 2000, 2001 VideoLAN
* $Id: gnome_callbacks.c,v 1.24 2001/04/22 00:08:26 stef Exp $ * $Id: gnome_callbacks.c,v 1.25 2001/05/01 04:18:18 sam Exp $
* *
* Authors: Samuel Hocevar <sam@zoy.org> * Authors: Samuel Hocevar <sam@zoy.org>
* Stphane Borel <stef@via.ecp.fr> * Stphane Borel <stef@via.ecp.fr>
...@@ -1011,7 +1011,8 @@ on_disc_ok_clicked (GtkButton *button, ...@@ -1011,7 +1011,8 @@ on_disc_ok_clicked (GtkButton *button,
GTK_WIDGET(button), "disc_name" ) ) ); GTK_WIDGET(button), "disc_name" ) ) );
/* "dvd:foo" has size 5 + strlen(foo) */ /* "dvd:foo" has size 5 + strlen(foo) */
psz_source = malloc( 5 + strlen( psz_device ) ); psz_source = malloc( 3 /* "dvd" */ + 1 /* ":" */
+ strlen( psz_device ) + 1 /* "\0" */ );
if( psz_source == NULL ) if( psz_source == NULL )
{ {
return; return;
...@@ -1110,7 +1111,9 @@ on_network_ok_clicked (GtkButton *button, ...@@ -1110,7 +1111,9 @@ on_network_ok_clicked (GtkButton *button,
} }
/* Allocate room for "protocol://server:port" */ /* Allocate room for "protocol://server:port" */
psz_source = malloc( strlen( psz_protocol ) + strlen( psz_server ) + 10 ); psz_source = malloc( strlen( psz_protocol ) + 3 /* "://" */
+ strlen( psz_server ) + 1 /* ":" */
+ 5 /* 0-65535 */ + 1 /* "\0" */ );
if( psz_source == NULL ) if( psz_source == NULL )
{ {
return; return;
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* intf_gnome.c: Gnome interface * intf_gnome.c: Gnome interface
***************************************************************************** *****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN * Copyright (C) 1999, 2000 VideoLAN
* $Id: intf_gnome.c,v 1.33 2001/04/29 02:48:51 stef Exp $ * $Id: intf_gnome.c,v 1.34 2001/05/01 04:18:18 sam Exp $
* *
* Authors: Samuel Hocevar <sam@zoy.org> * Authors: Samuel Hocevar <sam@zoy.org>
* Stphane Borel <stef@via.ecp.fr> * Stphane Borel <stef@via.ecp.fr>
...@@ -438,13 +438,14 @@ static gint GnomeLanguageMenus( gpointer p_data, ...@@ -438,13 +438,14 @@ static gint GnomeLanguageMenus( gpointer p_data,
gint i_cat, gint i_cat,
void(*pf_toggle )( GtkCheckMenuItem *, gpointer ) ) void(*pf_toggle )( GtkCheckMenuItem *, gpointer ) )
{ {
#define GNOME_LANGUAGE_MENU_SIZE 64
intf_thread_t * p_intf; intf_thread_t * p_intf;
GtkWidget * p_menu; GtkWidget * p_menu;
GtkWidget * p_separator; GtkWidget * p_separator;
GtkWidget * p_item; GtkWidget * p_item;
GtkWidget * p_item_active; GtkWidget * p_item_active;
GSList * p_group; GSList * p_group;
char psz_name[12]; char psz_name[ GNOME_LANGUAGE_MENU_SIZE ];
gint i_item; gint i_item;
gint i; gint i;
...@@ -463,7 +464,8 @@ static gint GnomeLanguageMenus( gpointer p_data, ...@@ -463,7 +464,8 @@ static gint GnomeLanguageMenus( gpointer p_data,
p_menu = gtk_menu_new(); p_menu = gtk_menu_new();
/* special case for "off" item */ /* special case for "off" item */
sprintf( psz_name, "Off" ); snprintf( psz_name, GNOME_LANGUAGE_MENU_SIZE, "Off" );
psz_name[ GNOME_LANGUAGE_MENU_SIZE - 1 ] = '\0';
p_item = gtk_radio_menu_item_new_with_label( p_group, psz_name ); p_item = gtk_radio_menu_item_new_with_label( p_group, psz_name );
p_group = gtk_radio_menu_item_group( GTK_RADIO_MENU_ITEM( p_item ) ); p_group = gtk_radio_menu_item_group( GTK_RADIO_MENU_ITEM( p_item ) );
...@@ -494,7 +496,9 @@ static gint GnomeLanguageMenus( gpointer p_data, ...@@ -494,7 +496,9 @@ static gint GnomeLanguageMenus( gpointer p_data,
strcpy( psz_name, p_intf->p_input->stream.pp_es[i]->psz_desc ); strcpy( psz_name, p_intf->p_input->stream.pp_es[i]->psz_desc );
if( psz_name[0] == '\0' ) if( psz_name[0] == '\0' )
{ {
sprintf( psz_name, "Language %d", i_item ); snprintf( psz_name, GNOME_LANGUAGE_MENU_SIZE,
"Language %d", i_item );
psz_name[ GNOME_LANGUAGE_MENU_SIZE - 1 ] = '\0';
} }
p_item = gtk_radio_menu_item_new_with_label( p_group, psz_name ); p_item = gtk_radio_menu_item_new_with_label( p_group, psz_name );
...@@ -546,8 +550,9 @@ static gint GnomeLanguageMenus( gpointer p_data, ...@@ -546,8 +550,9 @@ static gint GnomeLanguageMenus( gpointer p_data,
static gint GnomeAngleMenu( gpointer p_data, GtkWidget * p_angle, static gint GnomeAngleMenu( gpointer p_data, GtkWidget * p_angle,
void(*pf_toggle)( GtkCheckMenuItem *, gpointer ) ) void(*pf_toggle)( GtkCheckMenuItem *, gpointer ) )
{ {
#define GNOME_ANGLE_MENU_SIZE 64
intf_thread_t * p_intf; intf_thread_t * p_intf;
char psz_name[12]; char psz_name[ GNOME_ANGLE_MENU_SIZE ];
GtkWidget * p_angle_menu; GtkWidget * p_angle_menu;
GSList * p_angle_group; GSList * p_angle_group;
GtkWidget * p_item; GtkWidget * p_item;
...@@ -570,7 +575,8 @@ static gint GnomeAngleMenu( gpointer p_data, GtkWidget * p_angle, ...@@ -570,7 +575,8 @@ static gint GnomeAngleMenu( gpointer p_data, GtkWidget * p_angle,
i_angle < p_intf->p_input->stream.p_selected_area->i_angle_nb ; i_angle < p_intf->p_input->stream.p_selected_area->i_angle_nb ;
i_angle++ ) i_angle++ )
{ {
sprintf( psz_name, "Angle %d", i_angle + 1 ); snprintf( psz_name, GNOME_ANGLE_MENU_SIZE, "Angle %d", i_angle + 1 );
psz_name[ GNOME_ANGLE_MENU_SIZE - 1 ] = '\0';
p_item = gtk_radio_menu_item_new_with_label( p_angle_group, p_item = gtk_radio_menu_item_new_with_label( p_angle_group,
psz_name ); psz_name );
...@@ -657,13 +663,17 @@ static gint GnomeChapterMenu( gpointer p_data, GtkWidget * p_chapter, ...@@ -657,13 +663,17 @@ static gint GnomeChapterMenu( gpointer p_data, GtkWidget * p_chapter,
gtk_menu_append( GTK_MENU( p_chapter_menu ), p_menu_item ); gtk_menu_append( GTK_MENU( p_chapter_menu ), p_menu_item );
} }
sprintf( psz_name, "%d - %d", i_chapter + 1, i_chapter + 10); snprintf( psz_name, GNOME_ANGLE_MENU_SIZE,
"%d - %d", i_chapter + 1, i_chapter + 10);
psz_name[ GNOME_ANGLE_MENU_SIZE - 1 ] = '\0';
p_menu_item = gtk_menu_item_new_with_label( psz_name ); p_menu_item = gtk_menu_item_new_with_label( psz_name );
gtk_widget_show( p_menu_item ); gtk_widget_show( p_menu_item );
p_chapter_submenu = gtk_menu_new(); p_chapter_submenu = gtk_menu_new();
} }
sprintf( psz_name, "Chapter %d", i_chapter + 1 ); snprintf( psz_name, GNOME_ANGLE_MENU_SIZE,
"Chapter %d", i_chapter + 1 );
psz_name[ GNOME_ANGLE_MENU_SIZE - 1 ] = '\0';
p_item = gtk_radio_menu_item_new_with_label( p_chapter_group, p_item = gtk_radio_menu_item_new_with_label( p_chapter_group,
psz_name ); psz_name );
...@@ -732,8 +742,9 @@ static gint GnomeTitleMenu( gpointer p_data, ...@@ -732,8 +742,9 @@ static gint GnomeTitleMenu( gpointer p_data,
GtkWidget * p_navigation, GtkWidget * p_navigation,
void(*pf_toggle )( GtkCheckMenuItem *, gpointer ) ) void(*pf_toggle )( GtkCheckMenuItem *, gpointer ) )
{ {
#define GNOME_TITLE_MENU_SIZE 64
intf_thread_t * p_intf; intf_thread_t * p_intf;
char psz_name[12]; char psz_name[ GNOME_TITLE_MENU_SIZE ];
GtkWidget * p_title_menu; GtkWidget * p_title_menu;
GtkWidget * p_title_submenu; GtkWidget * p_title_submenu;
GtkWidget * p_title_item; GtkWidget * p_title_item;
...@@ -780,13 +791,17 @@ static gint GnomeTitleMenu( gpointer p_data, ...@@ -780,13 +791,17 @@ static gint GnomeTitleMenu( gpointer p_data,
gtk_menu_append( GTK_MENU( p_title_menu ), p_title_menu_item ); gtk_menu_append( GTK_MENU( p_title_menu ), p_title_menu_item );
} }
sprintf( psz_name, "%d - %d", i_title, i_title + 9 ); snprintf( psz_name, GNOME_TITLE_MENU_SIZE,
"%d - %d", i_title, i_title + 9 );
psz_name[ GNOME_TITLE_MENU_SIZE - 1 ] = '\0';
p_title_menu_item = gtk_menu_item_new_with_label( psz_name ); p_title_menu_item = gtk_menu_item_new_with_label( psz_name );
gtk_widget_show( p_title_menu_item ); gtk_widget_show( p_title_menu_item );
p_title_submenu = gtk_menu_new(); p_title_submenu = gtk_menu_new();
} }
sprintf( psz_name, "Title %d (%d)", i_title, p_intf->p_input->stream.pp_areas[i_title]->i_part_nb ); snprintf( psz_name, GNOME_TITLE_MENU_SIZE, "Title %d (%d)", i_title,
p_intf->p_input->stream.pp_areas[i_title]->i_part_nb );
psz_name[ GNOME_TITLE_MENU_SIZE - 1 ] = '\0';
if( pf_toggle == on_menubar_title_toggle ) if( pf_toggle == on_menubar_title_toggle )
{ {
...@@ -835,15 +850,18 @@ static gint GnomeTitleMenu( gpointer p_data, ...@@ -835,15 +850,18 @@ static gint GnomeTitleMenu( gpointer p_data,
p_chapter_menu_item ); p_chapter_menu_item );
} }
sprintf( psz_name, "%d - %d", i_chapter + 1, snprintf( psz_name, GNOME_TITLE_MENU_SIZE,
i_chapter + 10); "%d - %d", i_chapter + 1, i_chapter + 10 );
psz_name[ GNOME_TITLE_MENU_SIZE - 1 ] = '\0';
p_chapter_menu_item = p_chapter_menu_item =
gtk_menu_item_new_with_label( psz_name ); gtk_menu_item_new_with_label( psz_name );
gtk_widget_show( p_chapter_menu_item ); gtk_widget_show( p_chapter_menu_item );
p_chapter_submenu = gtk_menu_new(); p_chapter_submenu = gtk_menu_new();
} }
sprintf( psz_name, "Chapter %d", i_chapter + 1 ); snprintf( psz_name, GNOME_TITLE_MENU_SIZE,
"Chapter %d", i_chapter + 1 );
psz_name[ GNOME_TITLE_MENU_SIZE - 1 ] = '\0';
p_item = gtk_radio_menu_item_new_with_label( p_item = gtk_radio_menu_item_new_with_label(
p_chapter_group, psz_name ); p_chapter_group, psz_name );
...@@ -924,7 +942,6 @@ static gint GnomeTitleMenu( gpointer p_data, ...@@ -924,7 +942,6 @@ static gint GnomeTitleMenu( gpointer p_data,
TRUE ); TRUE );
} }
return TRUE; return TRUE;
} }
...@@ -947,14 +964,15 @@ static gint GnomeSetupMenu( intf_thread_t * p_intf ) ...@@ -947,14 +964,15 @@ static gint GnomeSetupMenu( intf_thread_t * p_intf )
if( p_intf->p_sys->b_title_update ) if( p_intf->p_sys->b_title_update )
{ {
char psz_title[3]; char psz_title[5];
p_menubar_menu = GTK_WIDGET( gtk_object_get_data( GTK_OBJECT( p_menubar_menu = GTK_WIDGET( gtk_object_get_data( GTK_OBJECT(
p_intf->p_sys->p_window ), "menubar_title" ) ); p_intf->p_sys->p_window ), "menubar_title" ) );
GnomeTitleMenu( p_intf, p_menubar_menu, on_menubar_title_toggle ); GnomeTitleMenu( p_intf, p_menubar_menu, on_menubar_title_toggle );
snprintf( psz_title, 3, "%02d", snprintf( psz_title, 5, "%d",
p_intf->p_input->stream.p_selected_area->i_id ); p_intf->p_input->stream.p_selected_area->i_id );
psz_title[ 4 ] = '\0';
gtk_label_set_text( p_intf->p_sys->p_label_title, psz_title ); gtk_label_set_text( p_intf->p_sys->p_label_title, psz_title );
p_intf->p_sys->b_title_update = 0; p_intf->p_sys->b_title_update = 0;
...@@ -962,7 +980,7 @@ static gint GnomeSetupMenu( intf_thread_t * p_intf ) ...@@ -962,7 +980,7 @@ static gint GnomeSetupMenu( intf_thread_t * p_intf )
if( p_intf->p_sys->b_chapter_update ) if( p_intf->p_sys->b_chapter_update )
{ {
char psz_chapter[3]; char psz_chapter[5];
p_popup_menu = GTK_WIDGET( gtk_object_get_data( GTK_OBJECT( p_popup_menu = GTK_WIDGET( gtk_object_get_data( GTK_OBJECT(
p_intf->p_sys->p_popup ), "popup_navigation" ) ); p_intf->p_sys->p_popup ), "popup_navigation" ) );
...@@ -972,8 +990,9 @@ static gint GnomeSetupMenu( intf_thread_t * p_intf ) ...@@ -972,8 +990,9 @@ static gint GnomeSetupMenu( intf_thread_t * p_intf )
p_intf->p_sys->p_window ), "menubar_chapter" ) ); p_intf->p_sys->p_window ), "menubar_chapter" ) );
GnomeChapterMenu( p_intf, p_menubar_menu, on_menubar_chapter_toggle ); GnomeChapterMenu( p_intf, p_menubar_menu, on_menubar_chapter_toggle );
snprintf( psz_chapter, 3, "%02d", snprintf( psz_chapter, 5, "%d",
p_intf->p_input->stream.p_selected_area->i_part ); p_intf->p_input->stream.p_selected_area->i_part );
psz_chapter[ 4 ] = '\0';
gtk_label_set_text( p_intf->p_sys->p_label_chapter, psz_chapter ); gtk_label_set_text( p_intf->p_sys->p_label_chapter, psz_chapter );
p_intf->p_sys->i_part = p_intf->p_sys->i_part =
......
...@@ -33,4 +33,5 @@ include ../../Makefile.modules ...@@ -33,4 +33,5 @@ include ../../Makefile.modules
../../lib/gtk.a: $(BUILTIN_C) ../../lib/gtk.a: $(BUILTIN_C)
ar r $@ $^ ar r $@ $^
$(RANLIB) $@
...@@ -67,28 +67,33 @@ $(BUILTIN_IDCTALTIVEC): BUILTIN_IDCTALTIVEC_%.o: %.c ...@@ -67,28 +67,33 @@ $(BUILTIN_IDCTALTIVEC): BUILTIN_IDCTALTIVEC_%.o: %.c
../../lib/idct.a: $(BUILTIN_IDCT) ../../lib/idct.a: $(BUILTIN_IDCT)
ar r $@ $^ ar r $@ $^
$(RANLIB) $@
../../lib/idctclassic.so: $(PLUGIN_IDCTCLASSIC) $(PLUGIN_IDCTCOMMON) ../../lib/idctclassic.so: $(PLUGIN_IDCTCLASSIC) $(PLUGIN_IDCTCOMMON)
$(CC) $(PCFLAGS) -o $@ $^ $(PLCFLAGS) $(CC) $(PCFLAGS) -o $@ $^ $(PLCFLAGS)
../../lib/idctclassic.a: $(BUILTIN_IDCTCLASSIC) ../../lib/idctclassic.a: $(BUILTIN_IDCTCLASSIC)
ar r $@ $^ ar r $@ $^
$(RANLIB) $@
../../lib/idctmmx.so: $(PLUGIN_IDCTMMX) $(PLUGIN_IDCTCOMMON) ../../lib/idctmmx.so: $(PLUGIN_IDCTMMX) $(PLUGIN_IDCTCOMMON)
$(CC) $(PCFLAGS) -o $@ $^ $(PLCFLAGS) $(CC) $(PCFLAGS) -o $@ $^ $(PLCFLAGS)
../../lib/idctmmx.a: $(BUILTIN_IDCTMMX) ../../lib/idctmmx.a: $(BUILTIN_IDCTMMX)
ar r $@ $^ ar r $@ $^
$(RANLIB) $@
../../lib/idctmmxext.so: $(PLUGIN_IDCTMMXEXT) $(PLUGIN_IDCTCOMMON) ../../lib/idctmmxext.so: $(PLUGIN_IDCTMMXEXT) $(PLUGIN_IDCTCOMMON)
$(CC) $(PCFLAGS) -o $@ $^ $(PLCFLAGS) $(CC) $(PCFLAGS) -o $@ $^ $(PLCFLAGS)
../../lib/idctmmxext.a: $(BUILTIN_IDCTMMXEXT) ../../lib/idctmmxext.a: $(BUILTIN_IDCTMMXEXT)
ar r $@ $^ ar r $@ $^
$(RANLIB) $@
../../lib/idctaltivec.so: $(PLUGIN_IDCTALTIVEC) $(PLUGIN_IDCTCOMMON) ../../lib/idctaltivec.so: $(PLUGIN_IDCTALTIVEC) $(PLUGIN_IDCTCOMMON)
$(CC) $(PCFLAGS) -o $@ $^ $(PLCFLAGS) $(LIB_IDCTALTIVEC) $(CC) $(PCFLAGS) -o $@ $^ $(PLCFLAGS) $(LIB_IDCTALTIVEC)
../../lib/idctaltivec.a: $(BUILTIN_IDCTALTIVEC) ../../lib/idctaltivec.a: $(BUILTIN_IDCTALTIVEC)
ar r $@ $^ ar r $@ $^
$(RANLIB) $@
...@@ -35,4 +35,5 @@ $(BUILTIN_MACOSX): BUILTIN_%.o: %.c ...@@ -35,4 +35,5 @@ $(BUILTIN_MACOSX): BUILTIN_%.o: %.c
../../lib/macosx.a: $(BUILTIN_MACOSX) ../../lib/macosx.a: $(BUILTIN_MACOSX)
ar r $@ $^ ar r $@ $^
$(RANLIB) $@
...@@ -535,7 +535,7 @@ void playorpause ( intf_thread_t *p_intf ) ...@@ -535,7 +535,7 @@ void playorpause ( intf_thread_t *p_intf )
{ {
if (p_main->p_aout != NULL) if (p_main->p_aout != NULL)
{ {
p_main->p_aout->vol = 0; p_main->p_aout->i_vol = 0;
} }
p_main->p_vout->p_sys->playback_status = PAUSED; p_main->p_vout->p_sys->playback_status = PAUSED;
SetMenuItemText( GetMenuHandle(kMenuControls), kControlsPlayORPause, "\pPlay"); SetMenuItemText( GetMenuHandle(kMenuControls), kControlsPlayORPause, "\pPlay");
...@@ -545,7 +545,7 @@ void playorpause ( intf_thread_t *p_intf ) ...@@ -545,7 +545,7 @@ void playorpause ( intf_thread_t *p_intf )
{ {
if (p_main->p_aout != NULL) if (p_main->p_aout != NULL)
{ {
p_main->p_aout->vol = p_main->p_vout->p_sys->vol_val; p_main->p_aout->i_vol = p_main->p_vout->p_sys->vol_val;
} }
p_main->p_vout->p_sys->playback_status = PLAYING; p_main->p_vout->p_sys->playback_status = PLAYING;
SetMenuItemText( GetMenuHandle(kMenuControls), kControlsPlayORPause, "\pPause"); SetMenuItemText( GetMenuHandle(kMenuControls), kControlsPlayORPause, "\pPause");
...@@ -563,7 +563,7 @@ void stop ( intf_thread_t *p_intf ) ...@@ -563,7 +563,7 @@ void stop ( intf_thread_t *p_intf )
// silence the sound, otherwise very horrible // silence the sound, otherwise very horrible
if (p_main->p_aout != NULL) if (p_main->p_aout != NULL)
{ {
p_main->p_aout->vol = 0; p_main->p_aout->i_vol = 0;
} }
//snooze(400000); //snooze(400000);
input_SetStatus(p_intf->p_input, INPUT_STATUS_END); input_SetStatus(p_intf->p_input, INPUT_STATUS_END);
...@@ -659,7 +659,7 @@ void DoMenuCommand( intf_thread_t *p_intf , long menuResult) ...@@ -659,7 +659,7 @@ void DoMenuCommand( intf_thread_t *p_intf , long menuResult)
{ {
if (p_main->p_aout != NULL) if (p_main->p_aout != NULL)
{ {
p_main->p_aout->vol = 0; p_main->p_aout->i_vol = 0;
} }
//snooze(400000); //snooze(400000);
input_SetStatus(p_intf->p_input, INPUT_STATUS_FASTER); input_SetStatus(p_intf->p_input, INPUT_STATUS_FASTER);
...@@ -672,7 +672,7 @@ void DoMenuCommand( intf_thread_t *p_intf , long menuResult) ...@@ -672,7 +672,7 @@ void DoMenuCommand( intf_thread_t *p_intf , long menuResult)
{ {
if (p_main->p_aout != NULL) if (p_main->p_aout != NULL)
{ {
p_main->p_aout->vol = 0; p_main->p_aout->i_vol = 0;
} }
//snooze(400000); //snooze(400000);
input_SetStatus(p_intf->p_input, INPUT_STATUS_SLOWER); input_SetStatus(p_intf->p_input, INPUT_STATUS_SLOWER);
...@@ -706,7 +706,7 @@ void DoMenuCommand( intf_thread_t *p_intf , long menuResult) ...@@ -706,7 +706,7 @@ void DoMenuCommand( intf_thread_t *p_intf , long menuResult)
// adjust the volume // adjust the volume
if (p_main->p_aout != NULL) if (p_main->p_aout != NULL)
{ {
p_main->p_aout->vol++; p_main->p_aout->i_vol++;
} }
break; break;
...@@ -714,7 +714,7 @@ void DoMenuCommand( intf_thread_t *p_intf , long menuResult) ...@@ -714,7 +714,7 @@ void DoMenuCommand( intf_thread_t *p_intf , long menuResult)
// adjust the volume // adjust the volume
if (p_main->p_aout != NULL) if (p_main->p_aout != NULL)
{ {
p_main->p_aout->vol--; p_main->p_aout->i_vol--;
} }
break; break;
...@@ -722,16 +722,16 @@ void DoMenuCommand( intf_thread_t *p_intf , long menuResult) ...@@ -722,16 +722,16 @@ void DoMenuCommand( intf_thread_t *p_intf , long menuResult)
// mute // mute
if (p_main->p_aout != NULL) if (p_main->p_aout != NULL)
{ {
if (p_main->p_aout->vol == 0) if (p_main->p_aout->i_vol == 0)
{ {
//p_vol->SetEnabled(true); //p_vol->SetEnabled(true);
p_main->p_aout->vol = p_main->p_vout->p_sys->vol_val; p_main->p_aout->i_vol = p_main->p_vout->p_sys->vol_val;
} }
else else
{ {
//p_vol->SetEnabled(false); //p_vol->SetEnabled(false);
p_main->p_vout->p_sys->vol_val = p_main->p_aout->vol; p_main->p_vout->p_sys->vol_val = p_main->p_aout->i_vol;
p_main->p_aout->vol = 0; p_main->p_aout->i_vol = 0;
} }
} }
break; break;
......
...@@ -27,4 +27,5 @@ include ../../Makefile.modules ...@@ -27,4 +27,5 @@ include ../../Makefile.modules
../../lib/mga.a: $(BUILTIN_C) ../../lib/mga.a: $(BUILTIN_C)
ar r $@ $^ ar r $@ $^
$(RANLIB) $@
...@@ -49,22 +49,26 @@ $(BUILTIN_MOTIONMMXEXT): BUILTIN_MOTIONMMXEXT_%.o: %.c ...@@ -49,22 +49,26 @@ $(BUILTIN_MOTIONMMXEXT): BUILTIN_MOTIONMMXEXT_%.o: %.c
../../lib/motion.a: $(BUILTIN_MOTION) ../../lib/motion.a: $(BUILTIN_MOTION)
ar r $@ $^ ar r $@ $^
$(RANLIB) $@
../../lib/motionclassic.so: $(PLUGIN_MOTIONCLASSIC) $(PLUGIN_MOTIONCOMMON) ../../lib/motionclassic.so: $(PLUGIN_MOTIONCLASSIC) $(PLUGIN_MOTIONCOMMON)
$(CC) $(PCFLAGS) -o $@ $^ $(PLCFLAGS) $(CC) $(PCFLAGS) -o $@ $^ $(PLCFLAGS)
../../lib/motionclassic.a: $(BUILTIN_MOTIONCLASSIC) ../../lib/motionclassic.a: $(BUILTIN_MOTIONCLASSIC)
ar r $@ $^ ar r $@ $^
$(RANLIB) $@
../../lib/motionmmx.so: $(PLUGIN_MOTIONMMX) $(PLUGIN_MOTIONCOMMON) ../../lib/motionmmx.so: $(PLUGIN_MOTIONMMX) $(PLUGIN_MOTIONCOMMON)
$(CC) $(PCFLAGS) -o $@ $^ $(PLCFLAGS) $(CC) $(PCFLAGS) -o $@ $^ $(PLCFLAGS)
../../lib/motionmmx.a: $(BUILTIN_MOTIONMMX) ../../lib/motionmmx.a: $(BUILTIN_MOTIONMMX)
ar r $@ $^ ar r $@ $^
$(RANLIB) $@
../../lib/motionmmxext.so: $(PLUGIN_MOTIONMMXEXT) $(PLUGIN_MOTIONCOMMON) ../../lib/motionmmxext.so: $(PLUGIN_MOTIONMMXEXT) $(PLUGIN_MOTIONCOMMON)
$(CC) $(PCFLAGS) -o $@ $^ $(PLCFLAGS) $(CC) $(PCFLAGS) -o $@ $^ $(PLCFLAGS)
../../lib/motionmmxext.a: $(BUILTIN_MOTIONMMXEXT) ../../lib/motionmmxext.a: $(BUILTIN_MOTIONMMXEXT)
ar r $@ $^ ar r $@ $^
$(RANLIB) $@
...@@ -33,16 +33,19 @@ include ../../Makefile.modules ...@@ -33,16 +33,19 @@ include ../../Makefile.modules
../../lib/es.a: $(BUILTIN_ES) ../../lib/es.a: $(BUILTIN_ES)
ar r $@ $^ ar r $@ $^
$(RANLIB) $@
../../lib/ps.so: $(PLUGIN_PS) ../../lib/ps.so: $(PLUGIN_PS)
$(CC) $(PCFLAGS) -o $@ $^ $(PLCFLAGS) $(CC) $(PCFLAGS) -o $@ $^ $(PLCFLAGS)
../../lib/ps.a: $(BUILTIN_PS) ../../lib/ps.a: $(BUILTIN_PS)
ar r $@ $^ ar r $@ $^
$(RANLIB) $@
../../lib/ts.so: $(PLUGIN_TS) ../../lib/ts.so: $(PLUGIN_TS)
$(CC) $(PCFLAGS) -o $@ $^ $(PLCFLAGS) $(LIB_TS) $(CC) $(PCFLAGS) -o $@ $^ $(PLCFLAGS) $(LIB_TS)
../../lib/ts.a: $(BUILTIN_TS) ../../lib/ts.a: $(BUILTIN_TS)
ar r $@ $^ ar r $@ $^
$(RANLIB) $@
...@@ -27,4 +27,5 @@ include ../../Makefile.modules ...@@ -27,4 +27,5 @@ include ../../Makefile.modules
../../lib/null.a: $(BUILTIN_C) ../../lib/null.a: $(BUILTIN_C)
ar r $@ $^ ar r $@ $^
$(RANLIB) $@
...@@ -22,13 +22,13 @@ $(PLUGIN_QT): %.o: .dep/%.dpp ...@@ -22,13 +22,13 @@ $(PLUGIN_QT): %.o: .dep/%.dpp
$(PLUGIN_QT): %.o: %.moc $(PLUGIN_QT): %.o: %.moc
$(CC) $(CFLAGS) $(PCFLAGS) -I/usr/include/qt -I${QTDIR}/include -c -o $@ $(<:%.moc=%.cpp) $(CC) $(CFLAGS) $(PCFLAGS) -I/usr/include/qt -I${QTDIR}/include -c -o $@ $(<:%.moc=%.cpp)
$(PLUGIN_QT:%.o=%.moc): %.moc: %.cpp $(PLUGIN_QT:%.o=%.moc): %.moc: %.cpp
moc -i $< -o $@ $(MOC) -i $< -o $@
$(BUILTIN_QT): BUILTIN_%.o: .dep/%.dpp $(BUILTIN_QT): BUILTIN_%.o: .dep/%.dpp
$(BUILTIN_QT): %.o: %.moc $(BUILTIN_QT): %.o: %.moc
$(CC) $(CFLAGS) -DBUILTIN -I/usr/include/qt -I${QTDIR}/include -c -o $@ $(<:BUILTIN_%.moc=%.cpp) $(CC) $(CFLAGS) -DBUILTIN -I/usr/include/qt -I${QTDIR}/include -c -o $@ $(<:BUILTIN_%.moc=%.cpp)
$(BUILTIN_QT:%.o=%.moc): BUILTIN_%.moc: %.cpp $(BUILTIN_QT:%.o=%.moc): BUILTIN_%.moc: %.cpp
moc -i $< -o $@ $(MOC) -i $< -o $@
# #
# Real targets # Real targets
...@@ -39,4 +39,5 @@ $(BUILTIN_QT:%.o=%.moc): BUILTIN_%.moc: %.cpp ...@@ -39,4 +39,5 @@ $(BUILTIN_QT:%.o=%.moc): BUILTIN_%.moc: %.cpp
../../lib/qt.a: $(BUILTIN_QT) ../../lib/qt.a: $(BUILTIN_QT)
ar r $@ $^ ar r $@ $^
$(RANLIB) $@
...@@ -27,4 +27,5 @@ include ../../Makefile.modules ...@@ -27,4 +27,5 @@ include ../../Makefile.modules
../../lib/sdl.a: $(BUILTIN_C) ../../lib/sdl.a: $(BUILTIN_C)
ar r $@ $^ ar r $@ $^
$(RANLIB) $@
...@@ -31,10 +31,12 @@ include ../../Makefile.modules ...@@ -31,10 +31,12 @@ include ../../Makefile.modules
../../lib/ncurses.a: $(BUILTIN_NCURSES) ../../lib/ncurses.a: $(BUILTIN_NCURSES)
ar r $@ $^ ar r $@ $^
$(RANLIB) $@
../../lib/rc.so: $(PLUGIN_RC) ../../lib/rc.so: $(PLUGIN_RC)
$(CC) $(PCFLAGS) -o $@ $^ $(PLCFLAGS) $(CC) $(PCFLAGS) -o $@ $^ $(PLCFLAGS)
../../lib/rc.a: $(BUILTIN_RC) ../../lib/rc.a: $(BUILTIN_RC)
ar r $@ $^ ar r $@ $^
$(RANLIB) $@
/***************************************************************************** /*****************************************************************************
* intf_rc.cpp: rc interface * intf_rc.cpp: remote control interface
***************************************************************************** *****************************************************************************
* Copyright (C) 1999-2001 VideoLAN * Copyright (C) 1999-2001 VideoLAN
* $Id: intf_rc.cpp,v 0.1 2001/04/27 shurdeek * $Id: intf_rc.cpp,v 0.1 2001/04/27 shurdeek
......
/***************************************************************************** /*****************************************************************************
* rc.cpp : stdin/stdout plugin for vlc * rc.cpp : remote control stdin/stdout plugin for vlc
***************************************************************************** *****************************************************************************
* Copyright (C) 2001 VideoLAN * Copyright (C) 2001 VideoLAN
* $Id: rc.cpp,v 0.1 2001/04/27 shurdeek * $Id: rc.cpp,v 0.1 2001/04/27 shurdeek
...@@ -62,7 +62,7 @@ void _M( intf_getfunctions )( function_list_t * p_function_list ); ...@@ -62,7 +62,7 @@ void _M( intf_getfunctions )( function_list_t * p_function_list );
MODULE_INIT MODULE_INIT
{ {
p_module->psz_name = MODULE_STRING; p_module->psz_name = MODULE_STRING;
p_module->psz_longname = "rc interface module"; p_module->psz_longname = "remote control interface module";
p_module->psz_version = VERSION; p_module->psz_version = VERSION;
p_module->i_capabilities = MODULE_CAPABILITY_NULL p_module->i_capabilities = MODULE_CAPABILITY_NULL
......
...@@ -42,6 +42,7 @@ endif ...@@ -42,6 +42,7 @@ endif
../../lib/x11.a: $(BUILTIN_X11) ../../lib/x11.a: $(BUILTIN_X11)
ar r $@ $^ ar r $@ $^
$(RANLIB) $@
../../lib/xvideo.so: $(PLUGIN_XVIDEO) ../../lib/xvideo.so: $(PLUGIN_XVIDEO)
ifeq ($(SYS),nto-qnx) ifeq ($(SYS),nto-qnx)
...@@ -52,4 +53,5 @@ endif ...@@ -52,4 +53,5 @@ endif
../../lib/xvideo.a: $(BUILTIN_XVIDEO) ../../lib/xvideo.a: $(BUILTIN_XVIDEO)
ar r $@ $^ ar r $@ $^
$(RANLIB) $@
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* vout_xvideo.c: Xvideo video output display method * vout_xvideo.c: Xvideo video output display method
***************************************************************************** *****************************************************************************
* Copyright (C) 1998, 1999, 2000, 2001 VideoLAN * Copyright (C) 1998, 1999, 2000, 2001 VideoLAN
* $Id: vout_xvideo.c,v 1.12 2001/04/27 19:29:11 massiot Exp $ * $Id: vout_xvideo.c,v 1.13 2001/05/01 04:18:18 sam Exp $
* *
* Authors: Shane Harper <shanegh@optusnet.com.au> * Authors: Shane Harper <shanegh@optusnet.com.au>
* Vincent Seguin <seguin@via.ecp.fr> * Vincent Seguin <seguin@via.ecp.fr>
...@@ -207,7 +207,7 @@ static int vout_Probe( probedata_t *p_data ) ...@@ -207,7 +207,7 @@ static int vout_Probe( probedata_t *p_data )
return( 999 ); return( 999 );
} }
return( 110 ); return( 60 );
} }
/***************************************************************************** /*****************************************************************************
......
...@@ -32,10 +32,12 @@ include ../../Makefile.modules ...@@ -32,10 +32,12 @@ include ../../Makefile.modules
../../lib/yuv.a: $(BUILTIN_YUV) ../../lib/yuv.a: $(BUILTIN_YUV)
ar r $@ $^ ar r $@ $^
$(RANLIB) $@
../../lib/yuvmmx.so: $(PLUGIN_YUVMMX) ../../lib/yuvmmx.so: $(PLUGIN_YUVMMX)
$(CC) $(PCFLAGS) -o $@ $^ $(PLCFLAGS) $(CC) $(PCFLAGS) -o $@ $^ $(PLCFLAGS)
../../lib/yuvmmx.a: $(BUILTIN_YUVMMX) ../../lib/yuvmmx.a: $(BUILTIN_YUVMMX)
ar r $@ $^ ar r $@ $^
$(RANLIB) $@
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* ac3_decoder_thread.c: ac3 decoder thread * ac3_decoder_thread.c: ac3 decoder thread
***************************************************************************** *****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN * Copyright (C) 1999, 2000 VideoLAN
* $Id: ac3_decoder_thread.c,v 1.30 2001/04/30 21:04:20 reno Exp $ * $Id: ac3_decoder_thread.c,v 1.31 2001/05/01 04:18:18 sam Exp $
* *
* Authors: Michel Lespinasse <walken@zoy.org> * Authors: Michel Lespinasse <walken@zoy.org>
* *
...@@ -97,7 +97,6 @@ vlc_thread_t ac3dec_CreateThread( adec_config_t * p_config ) ...@@ -97,7 +97,6 @@ vlc_thread_t ac3dec_CreateThread( adec_config_t * p_config )
/* /*
* Initialize the output properties * Initialize the output properties
*/ */
p_ac3dec_t->p_aout = p_config->p_aout;
p_ac3dec_t->p_aout_fifo = NULL; p_ac3dec_t->p_aout_fifo = NULL;
/* Spawn the ac3 decoder thread */ /* Spawn the ac3 decoder thread */
...@@ -120,8 +119,6 @@ vlc_thread_t ac3dec_CreateThread( adec_config_t * p_config ) ...@@ -120,8 +119,6 @@ vlc_thread_t ac3dec_CreateThread( adec_config_t * p_config )
*****************************************************************************/ *****************************************************************************/
static int InitThread (ac3dec_thread_t * p_ac3dec_t) static int InitThread (ac3dec_thread_t * p_ac3dec_t)
{ {
aout_fifo_t aout_fifo;
intf_DbgMsg("ac3dec debug: initializing ac3 decoder thread %p",p_ac3dec_t); intf_DbgMsg("ac3dec debug: initializing ac3 decoder thread %p",p_ac3dec_t);
p_ac3dec_t->p_config->decoder_config.pf_init_bit_stream( p_ac3dec_t->p_config->decoder_config.pf_init_bit_stream(
...@@ -129,15 +126,10 @@ static int InitThread (ac3dec_thread_t * p_ac3dec_t) ...@@ -129,15 +126,10 @@ static int InitThread (ac3dec_thread_t * p_ac3dec_t)
p_ac3dec_t->p_config->decoder_config.p_decoder_fifo, p_ac3dec_t->p_config->decoder_config.p_decoder_fifo,
BitstreamCallback, (void *) p_ac3dec_t ); BitstreamCallback, (void *) p_ac3dec_t );
aout_fifo.i_type = AOUT_ADEC_STEREO_FIFO;
aout_fifo.i_channels = 2;
aout_fifo.b_stereo = 1;
aout_fifo.l_frame_size = AC3DEC_FRAME_SIZE;
/* Creating the audio output fifo */ /* Creating the audio output fifo */
if ((p_ac3dec_t->p_aout_fifo = aout_CreateFifo(p_ac3dec_t->p_aout, &aout_fifo)) == NULL) p_ac3dec_t->p_aout_fifo = aout_CreateFifo( AOUT_ADEC_STEREO_FIFO, 2, 0, 0,
AC3DEC_FRAME_SIZE, NULL );
if ( p_ac3dec_t->p_aout_fifo == NULL )
{ {
return -1; return -1;
} }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* ac3_decoder_thread.h : ac3 decoder thread interface * ac3_decoder_thread.h : ac3 decoder thread interface
***************************************************************************** *****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN * Copyright (C) 1999, 2000 VideoLAN
* $Id: ac3_decoder_thread.h,v 1.5 2001/04/20 12:14:34 reno Exp $ * $Id: ac3_decoder_thread.h,v 1.6 2001/05/01 04:18:18 sam Exp $
* *
* Authors: Michel Kaempf <maxx@via.ecp.fr> * Authors: Michel Kaempf <maxx@via.ecp.fr>
* *
...@@ -44,14 +44,12 @@ typedef struct ac3dec_thread_s ...@@ -44,14 +44,12 @@ typedef struct ac3dec_thread_s
/* /*
* Decoder properties * Decoder properties
*/ */
ac3dec_t ac3_decoder; ac3dec_t ac3_decoder;
/* /*
* Output properties * Output properties
*/ */
aout_fifo_t * p_aout_fifo; /* stores the decompressed audio frames */ aout_fifo_t * p_aout_fifo; /* stores the decompressed audio frames */
aout_thread_t * p_aout; /* needed to create the audio fifo */
} ac3dec_thread_t; } ac3dec_thread_t;
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* ac3_iec958.c: ac3 to spdif converter * ac3_iec958.c: ac3 to spdif converter
***************************************************************************** *****************************************************************************
* Copyright (C) 2001 VideoLAN * Copyright (C) 2001 VideoLAN
* $Id: ac3_iec958.c,v 1.1 2001/04/29 02:48:51 stef Exp $ * $Id: ac3_iec958.c,v 1.2 2001/05/01 04:18:18 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>
...@@ -102,72 +102,85 @@ static const frame_size_t p_frame_size_code[64] = ...@@ -102,72 +102,85 @@ static const frame_size_t p_frame_size_code[64] =
/**************************************************************************** /****************************************************************************
* ac3_iec958_build_burst: builds an iec958/spdif frame based on an ac3 frame * ac3_iec958_build_burst: builds an iec958/spdif frame based on an ac3 frame
****************************************************************************/ ****************************************************************************/
void ac3_iec958_build_burst( int i_length, u8 * pi_data, u8 * pi_out ) void ac3_iec958_build_burst( ac3_spdif_thread_t *p_spdif )
{ {
const u8 pi_sync[4] = { 0x72, 0xF8, 0x1F, 0x4E }; const u8 p_sync[4] = { 0x72, 0xF8, 0x1F, 0x4E };
int i_length = p_spdif->ac3_info.i_frame_size;
/* add the spdif headers */ #ifndef HAVE_SWAB
memcpy( pi_out, pi_sync, 4 ); /* Skip the first byte if i_length is odd */
if( i_length ) u16 * p_in = (u16 *)( p_spdif->p_ac3 + ( i_length & 0x1 ) );
pi_out[4] = 0x01; u16 * p_out = (u16 *)p_spdif->p_iec;
else #endif
pi_out[4] = 0;
pi_out[5] = 0x00; /* Add the spdif headers */
pi_out[6] = ( i_length *8 ) & 0xFF; memcpy( p_spdif->p_iec, p_sync, 4 );
pi_out[7] = ( ( i_length *8 ) >> 8 ) & 0xFF; p_spdif->p_iec[4] = i_length ? 0x01 : 0x00;
p_spdif->p_iec[5] = 0x00;
swab( pi_data, pi_out + 8, i_length ); p_spdif->p_iec[6] = ( i_length * 8 ) & 0xFF;
/* adds zero to complete the spdif frame p_spdif->p_iec[7] = ( ( i_length * 8 ) >> 8 ) & 0xFF;
#ifdef HAVE_SWAB
swab( p_spdif->p_ac3, p_spdif->p_iec + 8, i_length );
#else
/* i_length should be even */
i_length &= ~0x1;
while( i_length )
{
*p_out = ( (*p_in & 0x00ff) << 16 ) | ( (*p_in & 0xff00) >> 16 );
p_in++;
p_out++;
i_length -= 2;
}
#endif
/* Add zeroes to complete the spdif frame,
* they will be ignored by the decoder */ * they will be ignored by the decoder */
memset( pi_out + 8 + i_length, 0, SPDIF_FRAME - 8 - i_length ); memset( p_spdif->p_iec + 8 + i_length, 0, SPDIF_FRAME_SIZE - 8 - i_length );
} }
/**************************************************************************** /****************************************************************************
* ac3_iec958_parse_syncinfo: parse ac3 sync info * ac3_iec958_parse_syncinfo: parse ac3 sync info
****************************************************************************/ ****************************************************************************/
int ac3_iec958_parse_syncinfo( ac3_spdif_thread_t *p_spdif, int ac3_iec958_parse_syncinfo( ac3_spdif_thread_t *p_spdif )
ac3_info_t *ac3_info,
u8 * pi_ac3 )
{ {
int pi_sample_rates[4] = { 48000, 44100, 32000, -1 }; int p_sample_rates[4] = { 48000, 44100, 32000, -1 };
int i_frame_rate_code; int i_frame_rate_code;
int i_frame_size_code; int i_frame_size_code;
// u8 * pi_tmp;
sync_frame_t * p_sync_frame; sync_frame_t * p_sync_frame;
/* find sync word */ /* Find sync word */
while( ShowBits( &p_spdif->bit_stream, 16 ) != 0xb77 ) while( ShowBits( &p_spdif->bit_stream, 16 ) != 0xb77 )
{ {
RemoveBits( &p_spdif->bit_stream, 8 ); RemoveBits( &p_spdif->bit_stream, 8 );
} }
/* read sync frame */ /* Read sync frame */
pi_ac3 = malloc( sizeof(sync_frame_t) ); GetChunk( &p_spdif->bit_stream, p_spdif->p_ac3, sizeof(sync_frame_t) );
GetChunk( &p_spdif->bit_stream, pi_ac3, sizeof(sync_frame_t) ); p_sync_frame = (sync_frame_t*)p_spdif->p_ac3;
p_sync_frame = (sync_frame_t*)pi_ac3;
/* compute frame rate */ /* Compute frame rate */
i_frame_rate_code = (p_sync_frame->syncinfo.code >> 6) & 0x03; i_frame_rate_code = (p_sync_frame->syncinfo.code >> 6) & 0x03;
ac3_info->i_sample_rate = pi_sample_rates[i_frame_rate_code]; p_spdif->ac3_info.i_sample_rate = p_sample_rates[i_frame_rate_code];
if (ac3_info->i_sample_rate == -1) if( p_spdif->ac3_info.i_sample_rate == -1 )
{ {
return -1; return -1;
} }
/* compute frame size */ /* Compute frame size */
i_frame_size_code = p_sync_frame->syncinfo.code & 0x3f; i_frame_size_code = p_sync_frame->syncinfo.code & 0x3f;
ac3_info->i_frame_size = 2 * p_spdif->ac3_info.i_frame_size = 2 *
p_frame_size_code[i_frame_size_code].i_frame_size[i_frame_rate_code]; p_frame_size_code[i_frame_size_code].i_frame_size[i_frame_rate_code];
ac3_info->i_bit_rate = p_frame_size_code[i_frame_size_code].i_bit_rate; p_spdif->ac3_info.i_bit_rate =
p_frame_size_code[i_frame_size_code].i_bit_rate;
if( ( ( p_sync_frame->bsi.bsidmod >> 3 ) & 0x1f ) != 0x08 ) if( ( ( p_sync_frame->bsi.bsidmod >> 3 ) & 0x1f ) != 0x08 )
{ {
return -1; return -1;
} }
ac3_info->i_bs_mod = p_sync_frame->bsi.bsidmod & 0x7; p_spdif->ac3_info.i_bs_mod = p_sync_frame->bsi.bsidmod & 0x7;
// free( pi_tmp );
return 0; return 0;
} }
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* ac3_iec958.h: ac3 to spdif converter headers * ac3_iec958.h: ac3 to spdif converter headers
***************************************************************************** *****************************************************************************
* Copyright (C) 2001 VideoLAN * Copyright (C) 2001 VideoLAN
* $Id: ac3_iec958.h,v 1.1 2001/04/29 02:48:51 stef Exp $ * $Id: ac3_iec958.h,v 1.2 2001/05/01 04:18:18 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>
...@@ -23,20 +23,9 @@ ...@@ -23,20 +23,9 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
****************************************************************************/ ****************************************************************************/
#ifndef _AC3_IEC958_H
#define _AC3_IEC958_H
/**************************************************************************** /****************************************************************************
* information about ac3 frame * information about ac3 frame
****************************************************************************/ ****************************************************************************/
typedef struct ac3_info_s
{
int i_bit_rate;
int i_frame_size;
int i_sample_rate;
int i_bs_mod;
} ac3_info_t;
typedef struct sync_frame_s typedef struct sync_frame_s
{ {
struct syncinfo struct syncinfo
...@@ -56,7 +45,6 @@ typedef struct sync_frame_s ...@@ -56,7 +45,6 @@ typedef struct sync_frame_s
/**************************************************************************** /****************************************************************************
* Prototypes * Prototypes
****************************************************************************/ ****************************************************************************/
void ac3_iec958_build_burst ( int, u8 *, u8 * ); void ac3_iec958_build_burst ( struct ac3_spdif_thread_s * );
int ac3_iec958_parse_syncinfo ( struct ac3_spdif_thread_s *, int ac3_iec958_parse_syncinfo ( struct ac3_spdif_thread_s * );
struct ac3_info_s *, u8 * );
#endif
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* ac3_spdif.c: ac3 pass-through to external decoder with enabled soundcard * ac3_spdif.c: ac3 pass-through to external decoder with enabled soundcard
***************************************************************************** *****************************************************************************
* Copyright (C) 2001 VideoLAN * Copyright (C) 2001 VideoLAN
* $Id: ac3_spdif.c,v 1.1 2001/04/29 02:48:51 stef Exp $ * $Id: ac3_spdif.c,v 1.2 2001/05/01 04:18:18 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>
...@@ -69,20 +69,30 @@ vlc_thread_t spdif_CreateThread( adec_config_t * p_config ) ...@@ -69,20 +69,30 @@ vlc_thread_t spdif_CreateThread( adec_config_t * p_config )
intf_DbgMsg( "spdif debug: creating ac3 pass-through thread" ); intf_DbgMsg( "spdif debug: creating ac3 pass-through thread" );
/* Allocate the memory needed to store the thread's structure */ /* Allocate the memory needed to store the thread's structure */
if( ( p_spdif = malloc( sizeof(ac3_spdif_thread_t) ) ) == NULL ) p_spdif = malloc( sizeof(ac3_spdif_thread_t) );
if( p_spdif == NULL )
{ {
intf_ErrMsg ( "spdif error: not enough memory " intf_ErrMsg ( "spdif error: not enough memory "
"for spdif_CreateThread() to create the new thread"); "for spdif_CreateThread() to create the new thread");
return 0; return 0;
} }
/* Temporary buffer to store ac3 frames to be transformed */
p_spdif->p_ac3 = malloc( /*ac3_info.i_frame_size*/SPDIF_FRAME_SIZE );
if( p_spdif->p_ac3 == NULL )
{
free( p_spdif->p_ac3 );
return 0;
}
/* /*
* Initialize the thread properties * Initialize the thread properties
*/ */
p_spdif->p_config = p_config; p_spdif->p_config = p_config;
p_spdif->p_fifo = p_config->decoder_config.p_decoder_fifo; p_spdif->p_fifo = p_config->decoder_config.p_decoder_fifo;
p_spdif->p_aout = p_config->p_aout;
p_spdif->p_aout_fifo = NULL; p_spdif->p_aout_fifo = NULL;
/* Spawn the ac3 to spdif thread */ /* Spawn the ac3 to spdif thread */
...@@ -90,6 +100,7 @@ vlc_thread_t spdif_CreateThread( adec_config_t * p_config ) ...@@ -90,6 +100,7 @@ vlc_thread_t spdif_CreateThread( adec_config_t * p_config )
(vlc_thread_func_t)RunThread, (void *)p_spdif)) (vlc_thread_func_t)RunThread, (void *)p_spdif))
{ {
intf_ErrMsg( "spdif error: can't spawn spdif thread" ); intf_ErrMsg( "spdif error: can't spawn spdif thread" );
free( p_spdif->p_ac3 );
free( p_spdif ); free( p_spdif );
return 0; return 0;
} }
...@@ -108,27 +119,44 @@ vlc_thread_t spdif_CreateThread( adec_config_t * p_config ) ...@@ -108,27 +119,44 @@ vlc_thread_t spdif_CreateThread( adec_config_t * p_config )
****************************************************************************/ ****************************************************************************/
static int InitThread( ac3_spdif_thread_t * p_spdif ) static int InitThread( ac3_spdif_thread_t * p_spdif )
{ {
aout_fifo_t aout_fifo;
p_spdif->p_config->decoder_config.pf_init_bit_stream( p_spdif->p_config->decoder_config.pf_init_bit_stream(
&p_spdif->bit_stream, &p_spdif->bit_stream,
p_spdif->p_config->decoder_config.p_decoder_fifo, p_spdif->p_config->decoder_config.p_decoder_fifo,
BitstreamCallback, (void*)p_spdif ); BitstreamCallback, (void*)p_spdif );
aout_fifo.i_type = AOUT_ADEC_MONO_FIFO; /* Creating the audio output fifo */
aout_fifo.i_channels = 1; p_spdif->p_aout_fifo = aout_CreateFifo( AOUT_ADEC_SPDIF_FIFO, 1, 0, 0,
aout_fifo.b_stereo = 0; SPDIF_FRAME_SIZE, NULL );
if( p_spdif->p_aout_fifo == NULL )
{
return -1;
}
aout_fifo.l_frame_size = SPDIF_FRAME; intf_WarnMsg( 1, "spdif: aout fifo created" );
/* Creating the audio output fifo */ /* Check stream properties */
if( (p_spdif->p_aout_fifo = if( ac3_iec958_parse_syncinfo( p_spdif ) < 0 )
aout_CreateFifo( p_spdif->p_aout, &aout_fifo ) ) == NULL )
{ {
intf_ErrMsg( "spdif error: stream not valid");
aout_DestroyFifo( p_spdif->p_aout_fifo );
return -1; return -1;
} }
intf_WarnMsg( 1, "aout fifo for spdif created" ); /* Check that we can handle the rate */
if( p_spdif->ac3_info.i_sample_rate != 48000 )
{
intf_ErrMsg( "spdif error: Only 48000 Hz streams supported");
aout_DestroyFifo( p_spdif->p_aout_fifo );
return -1;
}
GetChunk( &p_spdif->bit_stream, p_spdif->p_ac3 + sizeof(sync_frame_t),
p_spdif->ac3_info.i_frame_size - sizeof(sync_frame_t) );
vlc_cond_signal( &p_spdif->p_aout_fifo->data_wait );
return 0; return 0;
} }
...@@ -139,34 +167,15 @@ static int InitThread( ac3_spdif_thread_t * p_spdif ) ...@@ -139,34 +167,15 @@ static int InitThread( ac3_spdif_thread_t * p_spdif )
****************************************************************************/ ****************************************************************************/
static void RunThread( ac3_spdif_thread_t * p_spdif ) static void RunThread( ac3_spdif_thread_t * p_spdif )
{ {
ac3_info_t ac3_info; /* Initializing the spdif decoder thread */
u8 * pi_ac3; if( InitThread( p_spdif ) )
u8 * pi_iec;
InitThread( p_spdif );
/* temporary buffer to store ac3 frames to be transformed */
pi_ac3 = malloc( /*ac3_info.i_frame_size*/SPDIF_FRAME );
/* check stream properties */
if( ac3_iec958_parse_syncinfo( p_spdif, &ac3_info, pi_ac3 ) < 0)
{ {
intf_ErrMsg( "spdif error: stream not valid"); p_spdif->p_fifo->b_error = 1;
exit(1);
}
if( ac3_info.i_sample_rate != 48000) {
intf_ErrMsg( "spdif error: Only 48000 Hz streams supported");
exit(1);
} }
GetChunk( &p_spdif->bit_stream, pi_ac3 + sizeof(sync_frame_t),
ac3_info.i_frame_size - sizeof(sync_frame_t) );
vlc_cond_signal( &p_spdif->p_aout_fifo->data_wait );
while( !p_spdif->p_fifo->b_die && !p_spdif->p_fifo->b_error ) while( !p_spdif->p_fifo->b_die && !p_spdif->p_fifo->b_error )
{ {
/* handle the dates */ /* Handle the dates */
if(DECODER_FIFO_START(*p_spdif->p_fifo)->i_pts) if(DECODER_FIFO_START(*p_spdif->p_fifo)->i_pts)
{ {
p_spdif->p_aout_fifo->date[p_spdif->p_aout_fifo->l_end_frame] = p_spdif->p_aout_fifo->date[p_spdif->p_aout_fifo->l_end_frame] =
...@@ -179,12 +188,12 @@ static void RunThread( ac3_spdif_thread_t * p_spdif ) ...@@ -179,12 +188,12 @@ static void RunThread( ac3_spdif_thread_t * p_spdif )
LAST_MDATE; LAST_MDATE;
} }
/* write in the first free packet of aout fifo */ /* Write in the first free packet of aout fifo */
pi_iec = (p_spdif->p_aout_fifo->buffer) + p_spdif->p_iec = (p_spdif->p_aout_fifo->buffer) +
(p_spdif->p_aout_fifo->l_end_frame * SPDIF_FRAME ); (p_spdif->p_aout_fifo->l_end_frame * SPDIF_FRAME_SIZE );
/* build burst to be sent to hardware decoder */ /* Build burst to be sent to hardware decoder */
ac3_iec958_build_burst( ac3_info.i_frame_size, pi_ac3, pi_iec ); ac3_iec958_build_burst( p_spdif );
vlc_mutex_lock (&p_spdif->p_aout_fifo->data_lock); vlc_mutex_lock (&p_spdif->p_aout_fifo->data_lock);
...@@ -193,18 +202,17 @@ static void RunThread( ac3_spdif_thread_t * p_spdif ) ...@@ -193,18 +202,17 @@ static void RunThread( ac3_spdif_thread_t * p_spdif )
vlc_mutex_unlock (&p_spdif->p_aout_fifo->data_lock); vlc_mutex_unlock (&p_spdif->p_aout_fifo->data_lock);
/* find syncword */ /* Find syncword */
while( ShowBits( &p_spdif->bit_stream, 16 ) != 0xb77 ) while( ShowBits( &p_spdif->bit_stream, 16 ) != 0xb77 )
{ {
RemoveBits( &p_spdif->bit_stream, 8 ); RemoveBits( &p_spdif->bit_stream, 8 );
} }
/* read data from bitstream */ /* Read data from bitstream */
GetChunk( &p_spdif->bit_stream, pi_ac3, ac3_info.i_frame_size ); GetChunk( &p_spdif->bit_stream, p_spdif->p_ac3,
p_spdif->ac3_info.i_frame_size );
} }
free( pi_ac3 );
/* If b_error is set, the ac3 spdif thread enters the error loop */ /* If b_error is set, the ac3 spdif thread enters the error loop */
if( p_spdif->p_fifo->b_error ) if( p_spdif->p_fifo->b_error )
{ {
...@@ -267,6 +275,7 @@ static void EndThread( ac3_spdif_thread_t * p_spdif ) ...@@ -267,6 +275,7 @@ static void EndThread( ac3_spdif_thread_t * p_spdif )
/* Destroy descriptor */ /* Destroy descriptor */
free( p_spdif->p_config ); free( p_spdif->p_config );
free( p_spdif->p_ac3 );
free( p_spdif ); free( p_spdif );
intf_DbgMsg ("spdif debug: thread %p destroyed", p_spdif ); intf_DbgMsg ("spdif debug: thread %p destroyed", p_spdif );
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* ac3_spdif.h: header for ac3 pass-through * ac3_spdif.h: header for ac3 pass-through
***************************************************************************** *****************************************************************************
* Copyright (C) 2001 VideoLAN * Copyright (C) 2001 VideoLAN
* $Id: ac3_spdif.h,v 1.1 2001/04/29 02:48:51 stef Exp $ * $Id: ac3_spdif.h,v 1.2 2001/05/01 04:18:18 sam Exp $
* *
* Authors: Stéphane Borel <stef@via.ecp.fr> * Authors: Stéphane Borel <stef@via.ecp.fr>
* *
...@@ -21,10 +21,15 @@ ...@@ -21,10 +21,15 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
****************************************************************************/ ****************************************************************************/
#ifndef _AC3_SPDIF_H #define SPDIF_FRAME_SIZE 6144
#define _AC3_SPDIF_H
#define SPDIF_FRAME 6144 typedef struct ac3_info_s
{
int i_bit_rate;
int i_frame_size;
int i_sample_rate;
int i_bs_mod;
} ac3_info_t;
/***************************************************************************** /*****************************************************************************
* ac3_spdif_thread_t : ac3 pass-through thread descriptor * ac3_spdif_thread_t : ac3 pass-through thread descriptor
...@@ -46,11 +51,17 @@ typedef struct ac3_spdif_thread_s ...@@ -46,11 +51,17 @@ typedef struct ac3_spdif_thread_s
bit_stream_t bit_stream; bit_stream_t bit_stream;
int i_available; int i_available;
/*
* Decoder properties
*/
ac3_info_t ac3_info;
u8 * p_ac3;
u8 * p_iec;
/* /*
* Output properties * Output properties
*/ */
aout_fifo_t * p_aout_fifo;/* stores the decompressed audio frames */ aout_fifo_t * p_aout_fifo; /* stores the decompressed audio frames */
aout_thread_t * p_aout; /* needed to create the audio fifo */
} ac3_spdif_thread_t; } ac3_spdif_thread_t;
...@@ -59,4 +70,3 @@ typedef struct ac3_spdif_thread_s ...@@ -59,4 +70,3 @@ typedef struct ac3_spdif_thread_s
*****************************************************************************/ *****************************************************************************/
vlc_thread_t spdif_CreateThread( adec_config_t * p_config ); vlc_thread_t spdif_CreateThread( adec_config_t * p_config );
#endif
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* audio_decoder.c: MPEG audio decoder thread * audio_decoder.c: MPEG audio decoder thread
***************************************************************************** *****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN * Copyright (C) 1999, 2000 VideoLAN
* $Id: audio_decoder.c,v 1.49 2001/04/25 10:22:32 massiot Exp $ * $Id: audio_decoder.c,v 1.50 2001/05/01 04:18:18 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>
...@@ -102,7 +102,6 @@ vlc_thread_t adec_CreateThread ( adec_config_t * p_config ) ...@@ -102,7 +102,6 @@ vlc_thread_t adec_CreateThread ( adec_config_t * p_config )
/* /*
* Initialize the output properties * Initialize the output properties
*/ */
p_adec->p_aout = p_config->p_aout;
p_adec->p_aout_fifo = NULL; p_adec->p_aout_fifo = NULL;
/* Spawn the audio decoder thread */ /* Spawn the audio decoder thread */
...@@ -128,21 +127,15 @@ vlc_thread_t adec_CreateThread ( adec_config_t * p_config ) ...@@ -128,21 +127,15 @@ vlc_thread_t adec_CreateThread ( adec_config_t * p_config )
*****************************************************************************/ *****************************************************************************/
static int InitThread (adec_thread_t * p_adec) static int InitThread (adec_thread_t * p_adec)
{ {
aout_fifo_t aout_fifo;
intf_DbgMsg ("adec debug: initializing audio decoder thread %p", p_adec); intf_DbgMsg ("adec debug: initializing audio decoder thread %p", p_adec);
p_adec->p_config->decoder_config.pf_init_bit_stream( &p_adec->bit_stream, p_adec->p_config->decoder_config.pf_init_bit_stream( &p_adec->bit_stream,
p_adec->p_config->decoder_config.p_decoder_fifo, NULL, NULL ); p_adec->p_config->decoder_config.p_decoder_fifo, NULL, NULL );
aout_fifo.i_type = AOUT_ADEC_STEREO_FIFO;
aout_fifo.i_channels = 2;
aout_fifo.b_stereo = 1;
aout_fifo.l_frame_size = ADEC_FRAME_SIZE;
/* Creating the audio output fifo */ /* Creating the audio output fifo */
if ( (p_adec->p_aout_fifo = p_adec->p_aout_fifo = aout_CreateFifo( AOUT_ADEC_STEREO_FIFO, 2, 0, 0,
aout_CreateFifo(p_adec->p_aout, &aout_fifo)) == NULL ) ADEC_FRAME_SIZE, NULL );
if ( p_adec->p_aout_fifo == NULL )
{ {
return -1; return -1;
} }
...@@ -164,9 +157,6 @@ static void RunThread (adec_thread_t * p_adec) ...@@ -164,9 +157,6 @@ static void RunThread (adec_thread_t * p_adec)
intf_DbgMsg ( "adec debug: running audio decoder thread (%p) (pid == %i)", intf_DbgMsg ( "adec debug: running audio decoder thread (%p) (pid == %i)",
p_adec, getpid() ); p_adec, getpid() );
/* You really suck */
//msleep ( INPUT_PTS_DELAY );
/* Initializing the audio decoder thread */ /* Initializing the audio decoder thread */
p_adec->p_fifo->b_error = InitThread (p_adec); p_adec->p_fifo->b_error = InitThread (p_adec);
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* audio_decoder.h : audio decoder thread interface * audio_decoder.h : audio decoder thread interface
***************************************************************************** *****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN * Copyright (C) 1999, 2000 VideoLAN
* $Id: audio_decoder.h,v 1.6 2001/03/21 13:42:34 sam Exp $ * $Id: audio_decoder.h,v 1.7 2001/05/01 04:18:18 sam Exp $
* *
* Authors: Michel Kaempf <maxx@via.ecp.fr> * Authors: Michel Kaempf <maxx@via.ecp.fr>
* *
...@@ -52,7 +52,6 @@ typedef struct adec_thread_s ...@@ -52,7 +52,6 @@ typedef struct adec_thread_s
* Output properties * Output properties
*/ */
struct aout_fifo_s * p_aout_fifo; /* stores the decompressed frames */ struct aout_fifo_s * p_aout_fifo; /* stores the decompressed frames */
struct aout_thread_s * p_aout; /* needed to create the audio fifo */
} adec_thread_t; } adec_thread_t;
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* aout_common.h: audio output inner functions * aout_common.h: audio output inner functions
***************************************************************************** *****************************************************************************
* Copyright (C) 1999, 2000, 2001 VideoLAN * Copyright (C) 1999, 2000, 2001 VideoLAN
* $Id: aout_common.h,v 1.3 2001/04/29 02:48:51 stef Exp $ * $Id: aout_common.h,v 1.4 2001/05/01 04:18:18 sam Exp $
* *
* Authors: Michel Kaempf <maxx@via.ecp.fr> * Authors: Michel Kaempf <maxx@via.ecp.fr>
* *
...@@ -45,8 +45,6 @@ void aout_SpdifThread ( aout_thread_t * p_aout ); ...@@ -45,8 +45,6 @@ void aout_SpdifThread ( aout_thread_t * p_aout );
(integer) += (increment).l_euclidean_integer; \ (integer) += (increment).l_euclidean_integer; \
} }
#define FIFO p_aout->fifo[i_fifo]
/***************************************************************************** /*****************************************************************************
* InitializeIncrement * InitializeIncrement
*****************************************************************************/ *****************************************************************************/
......
/***************************************************************************** /*****************************************************************************
* aout_fifo.c : exported fifo management functions * aout_ext-dec.c : exported fifo management functions
***************************************************************************** *****************************************************************************
* Copyright (C) 1999, 2000, 2001 VideoLAN * Copyright (C) 1999, 2000, 2001 VideoLAN
* $Id: aout_fifo.c,v 1.2 2001/03/21 13:42:34 sam Exp $ * $Id: aout_ext-dec.c,v 1.1 2001/05/01 04:18:18 sam Exp $
* *
* Authors: Michel Kaempf <maxx@via.ecp.fr> * Authors: Michel Kaempf <maxx@via.ecp.fr>
* *
...@@ -39,115 +39,137 @@ ...@@ -39,115 +39,137 @@
#include "audio_output.h" #include "audio_output.h"
#include "aout_common.h" #include "aout_common.h"
#include "main.h"
/***************************************************************************** /*****************************************************************************
* aout_CreateFifo * aout_CreateFifo
*****************************************************************************/ *****************************************************************************/
aout_fifo_t * aout_CreateFifo( aout_thread_t * p_aout, aout_fifo_t * p_fifo ) aout_fifo_t * aout_CreateFifo( int i_type, int i_channels, long l_rate,
long l_units, long l_frame_size,
void *p_buffer )
{ {
#define P_AOUT p_main->p_aout
int i_fifo; int i_fifo;
/* Spawn an audio output if there is none */
if( P_AOUT == NULL )
{
P_AOUT = aout_CreateThread( NULL );
if( P_AOUT == NULL )
{
return NULL;
}
}
/* Take the fifos lock */ /* Take the fifos lock */
vlc_mutex_lock( &p_aout->fifos_lock ); vlc_mutex_lock( &P_AOUT->fifos_lock );
/* Looking for a free fifo structure */ /* Looking for a free fifo structure */
for ( i_fifo = 0; i_fifo < AOUT_MAX_FIFOS; i_fifo++ ) for( i_fifo = 0; i_fifo < AOUT_MAX_FIFOS; i_fifo++ )
{ {
if ( p_aout->fifo[i_fifo].i_type == AOUT_EMPTY_FIFO) if( P_AOUT->fifo[i_fifo].i_type == AOUT_EMPTY_FIFO )
{ {
/* Not very clever, but at least we know which fifo it is */ /* Not very clever, but at least we know which fifo it is */
p_aout->fifo[i_fifo].i_fifo = i_fifo; P_AOUT->fifo[i_fifo].i_fifo = i_fifo;
break; break;
} }
} }
if ( i_fifo == AOUT_MAX_FIFOS ) if( i_fifo == AOUT_MAX_FIFOS )
{ {
intf_ErrMsg( "aout error: no fifo available" ); intf_ErrMsg( "aout error: no fifo available" );
vlc_mutex_unlock( &p_aout->fifos_lock ); vlc_mutex_unlock( &P_AOUT->fifos_lock );
return( NULL ); return( NULL );
} }
/* Initialize the new fifo structure */ /* Initialize the new fifo structure */
switch ( p_aout->fifo[i_fifo].i_type = p_fifo->i_type ) switch ( P_AOUT->fifo[i_fifo].i_type = i_type )
{ {
case AOUT_INTF_MONO_FIFO: case AOUT_INTF_MONO_FIFO:
case AOUT_INTF_STEREO_FIFO: case AOUT_INTF_STEREO_FIFO:
p_aout->fifo[i_fifo].b_die = 0; P_AOUT->fifo[i_fifo].b_die = 0;
p_aout->fifo[i_fifo].i_channels = p_fifo->i_channels; P_AOUT->fifo[i_fifo].i_channels = i_channels;
p_aout->fifo[i_fifo].b_stereo = p_fifo->b_stereo; P_AOUT->fifo[i_fifo].b_stereo = ( i_channels == 2 );
p_aout->fifo[i_fifo].l_rate = p_fifo->l_rate; P_AOUT->fifo[i_fifo].l_rate = l_rate;
p_aout->fifo[i_fifo].buffer = p_fifo->buffer; P_AOUT->fifo[i_fifo].buffer = p_buffer;
p_aout->fifo[i_fifo].l_unit = 0; P_AOUT->fifo[i_fifo].l_unit = 0;
InitializeIncrement( &p_aout->fifo[i_fifo].unit_increment, InitializeIncrement( &P_AOUT->fifo[i_fifo].unit_increment,
p_fifo->l_rate, p_aout->l_rate ); l_rate, P_AOUT->l_rate );
p_aout->fifo[i_fifo].l_units = p_fifo->l_units; P_AOUT->fifo[i_fifo].l_units = l_units;
break; break;
case AOUT_ADEC_MONO_FIFO: case AOUT_ADEC_MONO_FIFO:
case AOUT_ADEC_STEREO_FIFO: case AOUT_ADEC_STEREO_FIFO:
p_aout->fifo[i_fifo].b_die = 0; P_AOUT->fifo[i_fifo].b_die = 0;
p_aout->fifo[i_fifo].i_channels = p_fifo->i_channels; P_AOUT->fifo[i_fifo].i_channels = i_channels;
p_aout->fifo[i_fifo].b_stereo = p_fifo->b_stereo; P_AOUT->fifo[i_fifo].b_stereo = ( i_channels == 2 );
p_aout->fifo[i_fifo].l_rate = p_fifo->l_rate; P_AOUT->fifo[i_fifo].l_rate = l_rate;
p_aout->fifo[i_fifo].l_frame_size = p_fifo->l_frame_size; P_AOUT->fifo[i_fifo].l_frame_size = l_frame_size;
/* Allocate the memory needed to store the audio frames. As the /* Allocate the memory needed to store the audio frames. As the
* fifo is a rotative fifo, we must be able to find out whether the * fifo is a rotative fifo, we must be able to find out whether
* fifo is full or empty, that's why we must in fact allocate memory * the fifo is full or empty, that's why we must in fact allocate
* for (AOUT_FIFO_SIZE+1) audio frames. */ * memory for (AOUT_FIFO_SIZE+1) audio frames. */
p_aout->fifo[i_fifo].buffer = malloc( sizeof(s16)*(AOUT_FIFO_SIZE+1)*p_fifo->l_frame_size ); P_AOUT->fifo[i_fifo].buffer = malloc( sizeof(s16) *
if ( p_aout->fifo[i_fifo].buffer == NULL ) ( AOUT_FIFO_SIZE + 1 ) * l_frame_size );
if ( P_AOUT->fifo[i_fifo].buffer == NULL )
{ {
intf_ErrMsg( "aout error: cannot create frame buffer" ); intf_ErrMsg( "aout error: cannot create frame buffer" );
p_aout->fifo[i_fifo].i_type = AOUT_EMPTY_FIFO; P_AOUT->fifo[i_fifo].i_type = AOUT_EMPTY_FIFO;
vlc_mutex_unlock( &p_aout->fifos_lock ); vlc_mutex_unlock( &P_AOUT->fifos_lock );
return( NULL ); return( NULL );
} }
/* Allocate the memory needed to store the dates of the frames */ /* Allocate the memory needed to store the dates of the frames */
p_aout->fifo[i_fifo].date = (mtime_t *)malloc( sizeof(mtime_t)*(AOUT_FIFO_SIZE+1) ); P_AOUT->fifo[i_fifo].date =
if ( p_aout->fifo[i_fifo].date == NULL ) malloc( sizeof(mtime_t) * ( AOUT_FIFO_SIZE + 1) );
if ( P_AOUT->fifo[i_fifo].date == NULL )
{ {
intf_ErrMsg( "aout error: cannot create date buffer"); intf_ErrMsg( "aout error: cannot create date buffer");
free( p_aout->fifo[i_fifo].buffer ); free( P_AOUT->fifo[i_fifo].buffer );
p_aout->fifo[i_fifo].i_type = AOUT_EMPTY_FIFO; P_AOUT->fifo[i_fifo].i_type = AOUT_EMPTY_FIFO;
vlc_mutex_unlock( &p_aout->fifos_lock ); vlc_mutex_unlock( &P_AOUT->fifos_lock );
return( NULL ); return( NULL );
} }
/* Set the fifo's buffer as empty (the first frame that is to be /* Set the fifo's buffer as empty (the first frame that is to be
* played is also the first frame that is not to be played) */ * played is also the first frame that is not to be played) */
p_aout->fifo[i_fifo].l_start_frame = 0; P_AOUT->fifo[i_fifo].l_start_frame = 0;
/* p_aout->fifo[i_fifo].l_next_frame = 0; */ /* P_AOUT->fifo[i_fifo].l_next_frame = 0; */
p_aout->fifo[i_fifo].l_end_frame = 0; P_AOUT->fifo[i_fifo].l_end_frame = 0;
/* Waiting for the audio decoder to compute enough frames to work /* Waiting for the audio decoder to compute enough frames to work
* out the fifo's current rate (as soon as the decoder has decoded * out the fifo's current rate (as soon as the decoder has decoded
* enough frames, the members of the fifo structure that are not * enough frames, the members of the fifo structure that are not
* initialized now will be calculated) */ * initialized now will be calculated) */
p_aout->fifo[i_fifo].b_start_frame = 0; P_AOUT->fifo[i_fifo].b_start_frame = 0;
p_aout->fifo[i_fifo].b_next_frame = 0; P_AOUT->fifo[i_fifo].b_next_frame = 0;
break; break;
default: default:
intf_ErrMsg( "aout error: unknown fifo type 0x%x", p_aout->fifo[i_fifo].i_type ); intf_ErrMsg( "aout error: unknown fifo type 0x%x",
p_aout->fifo[i_fifo].i_type = AOUT_EMPTY_FIFO; P_AOUT->fifo[i_fifo].i_type );
vlc_mutex_unlock( &p_aout->fifos_lock ); P_AOUT->fifo[i_fifo].i_type = AOUT_EMPTY_FIFO;
vlc_mutex_unlock( &P_AOUT->fifos_lock );
return( NULL ); return( NULL );
} }
/* Release the fifos lock */ /* Release the fifos lock */
vlc_mutex_unlock( &p_aout->fifos_lock ); vlc_mutex_unlock( &P_AOUT->fifos_lock );
intf_WarnMsg( 2, "aout info: fifo #%i allocated, %i channels, rate %li", intf_WarnMsg( 2, "aout info: fifo #%i allocated, %i channels, rate %li",
p_aout->fifo[i_fifo].i_fifo, p_aout->fifo[i_fifo].i_channels, p_aout->fifo[i_fifo].l_rate ); P_AOUT->fifo[i_fifo].i_fifo, P_AOUT->fifo[i_fifo].i_channels,
P_AOUT->fifo[i_fifo].l_rate );
/* Return the pointer to the fifo structure */ /* Return the pointer to the fifo structure */
return( &FIFO ); return( &P_AOUT->fifo[i_fifo] );
#undef P_AOUT
} }
/***************************************************************************** /*****************************************************************************
......
...@@ -82,7 +82,7 @@ void aout_S16StereoThread( aout_thread_t * p_aout ) ...@@ -82,7 +82,7 @@ void aout_S16StereoThread( aout_thread_t * p_aout )
{ {
((s16 *)p_aout->buffer)[l_buffer] = ((s16 *)p_aout->buffer)[l_buffer] =
(s16)( ( p_aout->s32_buffer[l_buffer] / AOUT_MAX_FIFOS ) (s16)( ( p_aout->s32_buffer[l_buffer] / AOUT_MAX_FIFOS )
* p_aout->vol / 256 ) ; * p_aout->i_vol / 256 ) ;
p_aout->s32_buffer[l_buffer] = 0; p_aout->s32_buffer[l_buffer] = 0;
} }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* aout_u8.c: 8 bit unsigned audio output functions * aout_u8.c: 8 bit unsigned audio output functions
***************************************************************************** *****************************************************************************
* Copyright (C) 1999, 2000, 2001 VideoLAN * Copyright (C) 1999, 2000, 2001 VideoLAN
* $Id: aout_u8.c,v 1.2 2001/03/21 13:42:34 sam Exp $ * $Id: aout_u8.c,v 1.3 2001/05/01 04:18:18 sam Exp $
* *
* Authors: Michel Kaempf <maxx@via.ecp.fr> * Authors: Michel Kaempf <maxx@via.ecp.fr>
* *
...@@ -77,7 +77,7 @@ void aout_U8MonoThread( aout_thread_t * p_aout ) ...@@ -77,7 +77,7 @@ void aout_U8MonoThread( aout_thread_t * p_aout )
for ( l_buffer = 0; l_buffer < l_buffer_limit; l_buffer++ ) for ( l_buffer = 0; l_buffer < l_buffer_limit; l_buffer++ )
{ {
((u8 *)p_aout->buffer)[l_buffer] = (u8)( ( (p_aout->s32_buffer[l_buffer] / AOUT_MAX_FIFOS / 256 ) + 128 ) * p_aout->vol / 256 ); ((u8 *)p_aout->buffer)[l_buffer] = (u8)( ( (p_aout->s32_buffer[l_buffer] / AOUT_MAX_FIFOS / 256 ) + 128 ) * p_aout->i_vol / 256 );
p_aout->s32_buffer[l_buffer] = 0; p_aout->s32_buffer[l_buffer] = 0;
} }
...@@ -131,7 +131,7 @@ void aout_U8StereoThread( aout_thread_t * p_aout ) ...@@ -131,7 +131,7 @@ void aout_U8StereoThread( aout_thread_t * p_aout )
for ( l_buffer = 0; l_buffer < l_buffer_limit; l_buffer++ ) for ( l_buffer = 0; l_buffer < l_buffer_limit; l_buffer++ )
{ {
((u8 *)p_aout->buffer)[l_buffer] = (u8)( ( (p_aout->s32_buffer[l_buffer] / AOUT_MAX_FIFOS / 256) + 128 ) * p_aout->vol / 256 ); ((u8 *)p_aout->buffer)[l_buffer] = (u8)( ( (p_aout->s32_buffer[l_buffer] / AOUT_MAX_FIFOS / 256) + 128 ) * p_aout->i_vol / 256 );
p_aout->s32_buffer[l_buffer] = 0; p_aout->s32_buffer[l_buffer] = 0;
} }
l_bytes = p_aout->pf_getbufinfo( p_aout, l_buffer_limit ); l_bytes = p_aout->pf_getbufinfo( p_aout, l_buffer_limit );
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* audio_output.c : audio output thread * audio_output.c : audio output thread
***************************************************************************** *****************************************************************************
* Copyright (C) 1999, 2000, 2001 VideoLAN * Copyright (C) 1999, 2000, 2001 VideoLAN
* $Id: audio_output.c,v 1.58 2001/04/29 02:48:51 stef Exp $ * $Id: audio_output.c,v 1.59 2001/05/01 04:18:18 sam Exp $
* *
* Authors: Michel Kaempf <maxx@via.ecp.fr> * Authors: Michel Kaempf <maxx@via.ecp.fr>
* *
...@@ -82,8 +82,7 @@ aout_thread_t *aout_CreateThread( int *pi_status ) ...@@ -82,8 +82,7 @@ aout_thread_t *aout_CreateThread( int *pi_status )
} }
/* Choose the best module */ /* Choose the best module */
p_aout->p_module = module_Need( p_main->p_bank, p_aout->p_module = module_Need( MODULE_CAPABILITY_AOUT, NULL );
MODULE_CAPABILITY_AOUT, NULL );
if( p_aout->p_module == NULL ) if( p_aout->p_module == NULL )
{ {
...@@ -105,7 +104,7 @@ aout_thread_t *aout_CreateThread( int *pi_status ) ...@@ -105,7 +104,7 @@ aout_thread_t *aout_CreateThread( int *pi_status )
*/ */
if ( p_aout->pf_open( p_aout ) ) if ( p_aout->pf_open( p_aout ) )
{ {
module_Unneed( p_main->p_bank, p_aout->p_module ); module_Unneed( p_aout->p_module );
free( p_aout ); free( p_aout );
return( NULL ); return( NULL );
} }
...@@ -114,13 +113,13 @@ aout_thread_t *aout_CreateThread( int *pi_status ) ...@@ -114,13 +113,13 @@ aout_thread_t *aout_CreateThread( int *pi_status )
{ {
intf_ErrMsg( "aout error: null sample rate" ); intf_ErrMsg( "aout error: null sample rate" );
p_aout->pf_close( p_aout ); p_aout->pf_close( p_aout );
module_Unneed( p_main->p_bank, p_aout->p_module ); module_Unneed( p_aout->p_module );
free( p_aout ); free( p_aout );
return( NULL ); return( NULL );
} }
/* special setting for ac3 pass-through mode */ /* special setting for ac3 pass-through mode */
if( p_main->b_spdif ) if( main_GetIntVariable( AOUT_SPDIF_VAR, 0 ) )
{ {
p_aout->i_format = AOUT_FMT_AC3; p_aout->i_format = AOUT_FMT_AC3;
p_aout->i_channels = 1; p_aout->i_channels = 1;
...@@ -133,13 +132,13 @@ aout_thread_t *aout_CreateThread( int *pi_status ) ...@@ -133,13 +132,13 @@ aout_thread_t *aout_CreateThread( int *pi_status )
if ( p_aout->pf_setformat( p_aout ) ) if ( p_aout->pf_setformat( p_aout ) )
{ {
p_aout->pf_close( p_aout ); p_aout->pf_close( p_aout );
module_Unneed( p_main->p_bank, p_aout->p_module ); module_Unneed( p_aout->p_module );
free( p_aout ); free( p_aout );
return( NULL ); return( NULL );
} }
/* Initialize the volume level */ /* Initialize the volume level */
p_aout->vol = VOLUME_DEFAULT; p_aout->i_vol = VOLUME_DEFAULT;
/* FIXME: maybe it would be cleaner to change SpawnThread prototype /* FIXME: maybe it would be cleaner to change SpawnThread prototype
* see vout to handle status correctly ?? however, it is not critical since * see vout to handle status correctly ?? however, it is not critical since
...@@ -147,7 +146,7 @@ aout_thread_t *aout_CreateThread( int *pi_status ) ...@@ -147,7 +146,7 @@ aout_thread_t *aout_CreateThread( int *pi_status )
if( aout_SpawnThread( p_aout ) ) if( aout_SpawnThread( p_aout ) )
{ {
p_aout->pf_close( p_aout ); p_aout->pf_close( p_aout );
module_Unneed( p_main->p_bank, p_aout->p_module ); module_Unneed( p_aout->p_module );
free( p_aout ); free( p_aout );
return( NULL ); return( NULL );
} }
...@@ -337,7 +336,7 @@ void aout_DestroyThread( aout_thread_t * p_aout, int *pi_status ) ...@@ -337,7 +336,7 @@ void aout_DestroyThread( aout_thread_t * p_aout, int *pi_status )
p_aout->pf_close( p_aout ); p_aout->pf_close( p_aout );
/* Release the aout module */ /* Release the aout module */
module_Unneed( p_main->p_bank, p_aout->p_module ); module_Unneed( p_aout->p_module );
/* Free structure */ /* Free structure */
free( p_aout ); free( p_aout );
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
* decoders. * decoders.
***************************************************************************** *****************************************************************************
* Copyright (C) 1998, 1999, 2000 VideoLAN * Copyright (C) 1998, 1999, 2000 VideoLAN
* $Id: input.c,v 1.103 2001/04/28 23:19:19 henri Exp $ * $Id: input.c,v 1.104 2001/05/01 04:18:18 sam Exp $
* *
* Authors: Christophe Massiot <massiot@via.ecp.fr> * Authors: Christophe Massiot <massiot@via.ecp.fr>
* *
...@@ -144,7 +144,6 @@ input_thread_t *input_CreateThread ( playlist_item_t *p_item, int *pi_status ) ...@@ -144,7 +144,6 @@ input_thread_t *input_CreateThread ( playlist_item_t *p_item, int *pi_status )
p_input->stream.control.b_bw = 0; p_input->stream.control.b_bw = 0;
/* Initialize default settings for spawned decoders */ /* Initialize default settings for spawned decoders */
p_input->p_default_aout = p_main->p_aout;
p_input->p_default_vout = p_main->p_vout; p_input->p_default_vout = p_main->p_vout;
/* Create thread and set locks. */ /* Create thread and set locks. */
...@@ -318,8 +317,7 @@ static int InitThread( input_thread_t * p_input ) ...@@ -318,8 +317,7 @@ static int InitThread( input_thread_t * p_input )
p_input->c_packets_trashed = 0; p_input->c_packets_trashed = 0;
#endif #endif
p_input->p_input_module = module_Need( p_main->p_bank, p_input->p_input_module = module_Need( MODULE_CAPABILITY_INPUT,
MODULE_CAPABILITY_INPUT,
(probedata_t *)p_input ); (probedata_t *)p_input );
if( p_input->p_input_module == NULL ) if( p_input->p_input_module == NULL )
...@@ -350,7 +348,7 @@ static int InitThread( input_thread_t * p_input ) ...@@ -350,7 +348,7 @@ static int InitThread( input_thread_t * p_input )
{ {
/* We barfed -- exit nicely */ /* We barfed -- exit nicely */
p_input->pf_close( p_input ); p_input->pf_close( p_input );
module_Unneed( p_main->p_bank, p_input->p_input_module ); module_Unneed( p_input->p_input_module );
return( -1 ); return( -1 );
} }
...@@ -360,7 +358,7 @@ static int InitThread( input_thread_t * p_input ) ...@@ -360,7 +358,7 @@ static int InitThread( input_thread_t * p_input )
{ {
/* We barfed -- exit nicely */ /* We barfed -- exit nicely */
p_input->pf_close( p_input ); p_input->pf_close( p_input );
module_Unneed( p_main->p_bank, p_input->p_input_module ); module_Unneed( p_input->p_input_module );
return( -1 ); return( -1 );
} }
...@@ -414,7 +412,7 @@ static void EndThread( input_thread_t * p_input ) ...@@ -414,7 +412,7 @@ static void EndThread( input_thread_t * p_input )
p_input->pf_close( p_input ); p_input->pf_close( p_input );
/* Release modules */ /* Release modules */
module_Unneed( p_main->p_bank, p_input->p_input_module ); module_Unneed( p_input->p_input_module );
} }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* input_programs.c: es_descriptor_t, pgrm_descriptor_t management * input_programs.c: es_descriptor_t, pgrm_descriptor_t management
***************************************************************************** *****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN * Copyright (C) 1999, 2000 VideoLAN
* $Id: input_programs.c,v 1.53 2001/04/29 02:48:51 stef Exp $ * $Id: input_programs.c,v 1.54 2001/05/01 04:18:18 sam Exp $
* *
* Authors: Christophe Massiot <massiot@via.ecp.fr> * Authors: Christophe Massiot <massiot@via.ecp.fr>
* *
...@@ -174,8 +174,6 @@ pgrm_descriptor_t * input_AddProgram( input_thread_t * p_input, ...@@ -174,8 +174,6 @@ pgrm_descriptor_t * input_AddProgram( input_thread_t * p_input,
p_input->stream.pp_programs[i_pgrm_index]->p_vout p_input->stream.pp_programs[i_pgrm_index]->p_vout
= p_input->p_default_vout; = p_input->p_default_vout;
p_input->stream.pp_programs[i_pgrm_index]->p_aout
= p_input->p_default_aout;
if( i_data_len ) if( i_data_len )
{ {
...@@ -580,7 +578,7 @@ static adec_config_t * GetAdecConfig( input_thread_t * p_input, ...@@ -580,7 +578,7 @@ static adec_config_t * GetAdecConfig( input_thread_t * p_input,
intf_ErrMsg( "Unable to allocate memory in GetAdecConfig" ); intf_ErrMsg( "Unable to allocate memory in GetAdecConfig" );
return( NULL ); return( NULL );
} }
p_config->p_aout = p_input->p_default_aout;
if( InitDecConfig( p_input, p_es, &p_config->decoder_config ) == -1 ) if( InitDecConfig( p_input, p_es, &p_config->decoder_config ) == -1 )
{ {
free( p_config ); free( p_config );
...@@ -661,13 +659,13 @@ int input_SelectES( input_thread_t * p_input, es_descriptor_t * p_es ) ...@@ -661,13 +659,13 @@ int input_SelectES( input_thread_t * p_input, es_descriptor_t * p_es )
case AC3_AUDIO_ES: case AC3_AUDIO_ES:
if( p_main->b_audio ) if( p_main->b_audio )
{ {
if( !p_main->b_spdif ) if( main_GetIntVariable( AOUT_SPDIF_VAR, 0 ) )
{ {
decoder.pf_create_thread = ac3dec_CreateThread; decoder.pf_create_thread = spdif_CreateThread;
} }
else else
{ {
decoder.pf_create_thread = spdif_CreateThread; decoder.pf_create_thread = ac3dec_CreateThread;
} }
p_config = (void *)GetAdecConfig( p_input, p_es ); p_config = (void *)GetAdecConfig( p_input, p_es );
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
* interface, such as command line. * interface, such as command line.
***************************************************************************** *****************************************************************************
* Copyright (C) 1998, 1999, 2000 VideoLAN * Copyright (C) 1998, 1999, 2000 VideoLAN
* $Id: interface.c,v 1.74 2001/04/30 15:00:59 massiot Exp $ * $Id: interface.c,v 1.75 2001/05/01 04:18:18 sam Exp $
* *
* Authors: Vincent Seguin <seguin@via.ecp.fr> * Authors: Vincent Seguin <seguin@via.ecp.fr>
* *
...@@ -81,8 +81,7 @@ intf_thread_t* intf_Create( void ) ...@@ -81,8 +81,7 @@ intf_thread_t* intf_Create( void )
} }
/* Choose the best module */ /* Choose the best module */
p_intf->p_module = module_Need( p_main->p_bank, p_intf->p_module = module_Need( MODULE_CAPABILITY_INTF, NULL );
MODULE_CAPABILITY_INTF, NULL );
if( p_intf->p_module == NULL ) if( p_intf->p_module == NULL )
{ {
...@@ -111,7 +110,7 @@ intf_thread_t* intf_Create( void ) ...@@ -111,7 +110,7 @@ intf_thread_t* intf_Create( void )
if( p_intf->pf_open( p_intf ) ) if( p_intf->pf_open( p_intf ) )
{ {
intf_ErrMsg("intf error: cannot create interface"); intf_ErrMsg("intf error: cannot create interface");
module_Unneed( p_main->p_bank, p_intf->p_module ); module_Unneed( p_intf->p_module );
free( p_intf ); free( p_intf );
return( NULL ); return( NULL );
} }
...@@ -142,7 +141,7 @@ static void intf_Manage( intf_thread_t *p_intf ) ...@@ -142,7 +141,7 @@ static void intf_Manage( intf_thread_t *p_intf )
intf_FlushMsg(); intf_FlushMsg();
/* Manage module bank */ /* Manage module bank */
module_ManageBank( p_main->p_bank ); module_ManageBank( );
if( ( p_intf->p_input != NULL ) && if( ( p_intf->p_input != NULL ) &&
( p_intf->p_input->b_error || p_intf->p_input->b_eof ) ) ( p_intf->p_input->b_error || p_intf->p_input->b_eof ) )
...@@ -205,7 +204,7 @@ void intf_Destroy( intf_thread_t *p_intf ) ...@@ -205,7 +204,7 @@ void intf_Destroy( intf_thread_t *p_intf )
} }
/* Unlock module */ /* Unlock module */
module_Unneed( p_main->p_bank, p_intf->p_module ); module_Unneed( p_intf->p_module );
vlc_mutex_destroy( &p_intf->change_lock ); vlc_mutex_destroy( &p_intf->change_lock );
...@@ -336,21 +335,21 @@ int intf_ProcessKey( intf_thread_t *p_intf, int g_key ) ...@@ -336,21 +335,21 @@ int intf_ProcessKey( intf_thread_t *p_intf, int g_key )
* half handled directly by the plugins. We should decide what to do. */ * half handled directly by the plugins. We should decide what to do. */
break; break;
case INTF_KEY_INC_VOLUME: /* volume + */ case INTF_KEY_INC_VOLUME: /* volume + */
if( (p_main->p_aout != NULL) && (p_main->p_aout->vol < VOLUME_MAX) ) if( (p_main->p_aout != NULL) && (p_main->p_aout->i_vol < VOLUME_MAX) )
p_main->p_aout->vol += VOLUME_STEP; p_main->p_aout->i_vol += VOLUME_STEP;
break; break;
case INTF_KEY_DEC_VOLUME: /* volume - */ case INTF_KEY_DEC_VOLUME: /* volume - */
if( (p_main->p_aout != NULL) && (p_main->p_aout->vol > VOLUME_STEP) ) if( (p_main->p_aout != NULL) && (p_main->p_aout->i_vol > VOLUME_STEP) )
p_main->p_aout->vol -= VOLUME_STEP; p_main->p_aout->i_vol -= VOLUME_STEP;
break; break;
case INTF_KEY_TOGGLE_VOLUME: /* toggle mute */ case INTF_KEY_TOGGLE_VOLUME: /* toggle mute */
if( (p_main->p_aout != NULL) && (p_main->p_aout->vol)) if( (p_main->p_aout != NULL) && (p_main->p_aout->i_vol))
{ {
i_volbackup = p_main->p_aout->vol; i_volbackup = p_main->p_aout->i_vol;
p_main->p_aout->vol = 0; p_main->p_aout->i_vol = 0;
} }
else if( (p_main->p_aout != NULL) && (!p_main->p_aout->vol)) else if( (p_main->p_aout != NULL) && (!p_main->p_aout->i_vol))
p_main->p_aout->vol = i_volbackup; p_main->p_aout->i_vol = i_volbackup;
break; break;
case INTF_KEY_DEC_GAMMA: /* gamma - */ case INTF_KEY_DEC_GAMMA: /* gamma - */
if( (p_main->p_vout != NULL) && (p_main->p_vout->f_gamma > -INTF_GAMMA_LIMIT) ) if( (p_main->p_vout != NULL) && (p_main->p_vout->f_gamma > -INTF_GAMMA_LIMIT) )
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
* and spawn threads. * and spawn threads.
***************************************************************************** *****************************************************************************
* Copyright (C) 1998, 1999, 2000 VideoLAN * Copyright (C) 1998, 1999, 2000 VideoLAN
* $Id: main.c,v 1.90 2001/04/29 02:48:51 stef Exp $ * $Id: main.c,v 1.91 2001/05/01 04:18:18 sam Exp $
* *
* Authors: Vincent Seguin <seguin@via.ecp.fr> * Authors: Vincent Seguin <seguin@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org> * Samuel Hocevar <sam@zoy.org>
...@@ -182,9 +182,11 @@ static const struct option longopts[] = ...@@ -182,9 +182,11 @@ static const struct option longopts[] =
static const char *psz_shortopts = "hHvgt:T:u:a:s:c:I:A:V:"; static const char *psz_shortopts = "hHvgt:T:u:a:s:c:I:A:V:";
/***************************************************************************** /*****************************************************************************
* Global variable program_data - this is the one and only, see main.h * Global variable program_data - these are the only ones, see main.h and
* modules.h
*****************************************************************************/ *****************************************************************************/
main_t *p_main; main_t *p_main;
bank_t *p_bank;
/***************************************************************************** /*****************************************************************************
* Local prototypes * Local prototypes
...@@ -214,8 +216,18 @@ static int CPUCapabilities ( void ); ...@@ -214,8 +216,18 @@ static int CPUCapabilities ( void );
int main( int i_argc, char *ppsz_argv[], char *ppsz_env[] ) int main( int i_argc, char *ppsz_argv[], char *ppsz_env[] )
{ {
main_t main_data; /* root of all data - see main.h */ main_t main_data; /* root of all data - see main.h */
bank_t module_bank;
p_main = &main_data; /* set up the global variable */ p_main = &main_data; /* set up the global variables */
p_bank = &module_bank;
/*
* Initialize the main structure
*/
p_main->i_cpu_capabilities = CPUCapabilities();
p_main->p_aout = NULL;
p_main->p_vout = NULL;
/* /*
* System specific initialization code * System specific initialization code
...@@ -224,8 +236,6 @@ int main( int i_argc, char *ppsz_argv[], char *ppsz_env[] ) ...@@ -224,8 +236,6 @@ int main( int i_argc, char *ppsz_argv[], char *ppsz_env[] )
system_Create( &i_argc, ppsz_argv, ppsz_env ); system_Create( &i_argc, ppsz_argv, ppsz_env );
#endif #endif
p_main->i_cpu_capabilities = CPUCapabilities();
/* /*
* Test if our code is likely to run on this CPU * Test if our code is likely to run on this CPU
*/ */
...@@ -272,7 +282,7 @@ int main( int i_argc, char *ppsz_argv[], char *ppsz_env[] ) ...@@ -272,7 +282,7 @@ int main( int i_argc, char *ppsz_argv[], char *ppsz_env[] )
/* /*
* Initialize playlist and get commandline files * Initialize playlist and get commandline files
*/ */
p_main->p_playlist = intf_PlaylistCreate( ); p_main->p_playlist = intf_PlaylistCreate();
if( !p_main->p_playlist ) if( !p_main->p_playlist )
{ {
intf_ErrMsg( "playlist error: playlist initialization failed" ); intf_ErrMsg( "playlist error: playlist initialization failed" );
...@@ -289,15 +299,7 @@ int main( int i_argc, char *ppsz_argv[], char *ppsz_env[] ) ...@@ -289,15 +299,7 @@ int main( int i_argc, char *ppsz_argv[], char *ppsz_env[] )
/* /*
* Initialize module bank * Initialize module bank
*/ */
p_main->p_bank = module_CreateBank( ); module_InitBank();
if( !p_main->p_bank )
{
intf_ErrMsg( "module error: module bank initialization failed" );
intf_PlaylistDestroy( p_main->p_playlist );
intf_MsgDestroy();
return( errno );
}
module_InitBank( p_main->p_bank );
/* /*
* Initialize shared resources and libraries * Initialize shared resources and libraries
...@@ -317,7 +319,7 @@ int main( int i_argc, char *ppsz_argv[], char *ppsz_env[] ) ...@@ -317,7 +319,7 @@ int main( int i_argc, char *ppsz_argv[], char *ppsz_env[] )
if( !p_main->p_intf ) if( !p_main->p_intf )
{ {
intf_ErrMsg( "intf error: interface initialization failed" ); intf_ErrMsg( "intf error: interface initialization failed" );
module_DestroyBank( p_main->p_bank ); module_EndBank();
intf_PlaylistDestroy( p_main->p_playlist ); intf_PlaylistDestroy( p_main->p_playlist );
intf_MsgDestroy(); intf_MsgDestroy();
return( errno ); return( errno );
...@@ -328,58 +330,28 @@ int main( int i_argc, char *ppsz_argv[], char *ppsz_env[] ) ...@@ -328,58 +330,28 @@ int main( int i_argc, char *ppsz_argv[], char *ppsz_env[] )
*/ */
InitSignalHandler(); InitSignalHandler();
/*
* Open audio device and start aout thread
*/
if( p_main->b_audio )
{
p_main->p_aout = aout_CreateThread( NULL );
if( p_main->p_aout == NULL )
{
/* On error during audio initialization, switch off audio */
intf_ErrMsg( "aout error: audio initialization failed,"
" audio is deactivated" );
p_main->b_audio = 0;
}
}
/*
* Open video device and start vout thread
*/
if( p_main->b_video )
{
p_main->p_vout = vout_CreateThread( NULL );
if( p_main->p_vout == NULL )
{
/* On error during video initialization, switch off video */
intf_ErrMsg( "vout error: video initialization failed,"
" video is deactivated" );
p_main->b_video = 0;
}
}
/* Flush messages before entering the main loop */
intf_FlushMsg();
/* /*
* This is the main loop * This is the main loop
*/ */
p_main->p_intf->pf_run( p_main->p_intf ); p_main->p_intf->pf_run( p_main->p_intf );
/*
* Finished, destroy the interface
*/
intf_Destroy( p_main->p_intf ); intf_Destroy( p_main->p_intf );
/* /*
* Close video device * Close all video devices
*/ */
if( p_main->b_video ) if( p_main->p_vout != NULL )
{ {
vout_DestroyThread( p_main->p_vout, NULL ); vout_DestroyThread( p_main->p_vout, NULL );
} }
/* /*
* Close audio device * Close all audio devices
*/ */
if( p_main->b_audio ) if( p_main->p_aout != NULL )
{ {
aout_DestroyThread( p_main->p_aout, NULL ); aout_DestroyThread( p_main->p_aout, NULL );
} }
...@@ -395,7 +367,7 @@ int main( int i_argc, char *ppsz_argv[], char *ppsz_env[] ) ...@@ -395,7 +367,7 @@ int main( int i_argc, char *ppsz_argv[], char *ppsz_env[] )
/* /*
* Free module bank * Free module bank
*/ */
module_DestroyBank( p_main->p_bank ); module_EndBank();
/* /*
* Free playlist * Free playlist
...@@ -524,7 +496,6 @@ static int GetConfiguration( int *pi_argc, char *ppsz_argv[], char *ppsz_env[] ) ...@@ -524,7 +496,6 @@ static int GetConfiguration( int *pi_argc, char *ppsz_argv[], char *ppsz_env[] )
p_main->b_audio = 1; p_main->b_audio = 1;
p_main->b_video = 1; p_main->b_video = 1;
p_main->b_channels = 0; p_main->b_channels = 0;
p_main->b_spdif = 0;
p_main->i_warning_level = 4; p_main->i_warning_level = 4;
...@@ -609,7 +580,7 @@ static int GetConfiguration( int *pi_argc, char *ppsz_argv[], char *ppsz_env[] ) ...@@ -609,7 +580,7 @@ static int GetConfiguration( int *pi_argc, char *ppsz_argv[], char *ppsz_env[] )
main_PutIntVariable( AOUT_STEREO_VAR, 0 ); main_PutIntVariable( AOUT_STEREO_VAR, 0 );
break; break;
case OPT_SPDIF: /* --spdif */ case OPT_SPDIF: /* --spdif */
p_main->b_spdif = 1; main_PutIntVariable( AOUT_SPDIF_VAR, 1 );
break; break;
/* Video options */ /* Video options */
...@@ -763,7 +734,7 @@ static void Usage( int i_fashion ) ...@@ -763,7 +734,7 @@ static void Usage( int i_fashion )
"\n --noaudio \tdisable audio" "\n --noaudio \tdisable audio"
"\n -A, --aout <module> \taudio output method" "\n -A, --aout <module> \taudio output method"
"\n --stereo, --mono \tstereo/mono audio" "\n --stereo, --mono \tstereo/mono audio"
"\n --spdif \tac3 pass-through mode" "\n --spdif \tAC3 pass-through mode"
"\n" "\n"
"\n --novideo \tdisable video" "\n --novideo \tdisable video"
"\n -V, --vout <module> \tvideo output method" "\n -V, --vout <module> \tvideo output method"
...@@ -809,6 +780,7 @@ static void Usage( int i_fashion ) ...@@ -809,6 +780,7 @@ static void Usage( int i_fashion )
"\n " AOUT_METHOD_VAR "=<method name> \taudio method" "\n " AOUT_METHOD_VAR "=<method name> \taudio method"
"\n " AOUT_DSP_VAR "=<filename> \tdsp device path" "\n " AOUT_DSP_VAR "=<filename> \tdsp device path"
"\n " AOUT_STEREO_VAR "={1|0} \tstereo or mono output" "\n " AOUT_STEREO_VAR "={1|0} \tstereo or mono output"
"\n " AOUT_SPDIF_VAR "={1|0} \tAC3 pass-through mode"
"\n " AOUT_RATE_VAR "=<rate> \toutput rate" ); "\n " AOUT_RATE_VAR "=<rate> \toutput rate" );
/* Video parameters */ /* Video parameters */
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* lpcm_decoder_thread.c: lpcm decoder thread * lpcm_decoder_thread.c: lpcm decoder thread
***************************************************************************** *****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN * Copyright (C) 1999, 2000 VideoLAN
* $Id: lpcm_decoder_thread.c,v 1.13 2001/04/06 09:15:48 sam Exp $ * $Id: lpcm_decoder_thread.c,v 1.14 2001/05/01 04:18:18 sam Exp $
* *
* Authors: Samuel Hocevar <sam@zoy.org> * Authors: Samuel Hocevar <sam@zoy.org>
* *
...@@ -84,7 +84,6 @@ vlc_thread_t lpcmdec_CreateThread (adec_config_t * p_config) ...@@ -84,7 +84,6 @@ vlc_thread_t lpcmdec_CreateThread (adec_config_t * p_config)
/* /*
* Initialize the output properties * Initialize the output properties
*/ */
p_lpcmdec->p_aout = p_config->p_aout;
p_lpcmdec->p_aout_fifo = NULL; p_lpcmdec->p_aout_fifo = NULL;
/* Spawn the lpcm decoder thread */ /* Spawn the lpcm decoder thread */
...@@ -105,7 +104,6 @@ vlc_thread_t lpcmdec_CreateThread (adec_config_t * p_config) ...@@ -105,7 +104,6 @@ vlc_thread_t lpcmdec_CreateThread (adec_config_t * p_config)
*****************************************************************************/ *****************************************************************************/
static int InitThread (lpcmdec_thread_t * p_lpcmdec) static int InitThread (lpcmdec_thread_t * p_lpcmdec)
{ {
aout_fifo_t aout_fifo;
lpcm_byte_stream_t * byte_stream; lpcm_byte_stream_t * byte_stream;
intf_DbgMsg ( "LPCM Debug: initializing lpcm decoder thread %p", p_lpcmdec ); intf_DbgMsg ( "LPCM Debug: initializing lpcm decoder thread %p", p_lpcmdec );
...@@ -127,14 +125,11 @@ static int InitThread (lpcmdec_thread_t * p_lpcmdec) ...@@ -127,14 +125,11 @@ static int InitThread (lpcmdec_thread_t * p_lpcmdec)
byte_stream->info = p_lpcmdec; byte_stream->info = p_lpcmdec;
vlc_mutex_unlock (&p_lpcmdec->p_fifo->data_lock); vlc_mutex_unlock (&p_lpcmdec->p_fifo->data_lock);
aout_fifo.i_type = AOUT_ADEC_STEREO_FIFO;
aout_fifo.i_channels = 2;
aout_fifo.b_stereo = 1;
aout_fifo.l_frame_size = LPCMDEC_FRAME_SIZE;
/* Creating the audio output fifo */ /* Creating the audio output fifo */
if ((p_lpcmdec->p_aout_fifo = aout_CreateFifo(p_lpcmdec->p_aout, &aout_fifo)) == NULL) { p_lpcmdec->p_aout_fifo = aout_CreateFifo( AOUT_ADEC_STEREO_FIFO, 2, 0, 0,
LPCMDEC_FRAME_SIZE, NULL );
if ( p_lpcmdec->p_aout_fifo == NULL )
{
return -1; return -1;
} }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* lpcm_decoder_thread.h : lpcm decoder thread interface * lpcm_decoder_thread.h : lpcm decoder thread interface
***************************************************************************** *****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN * Copyright (C) 1999, 2000 VideoLAN
* $Id: lpcm_decoder_thread.h,v 1.4 2001/03/21 13:42:34 sam Exp $ * $Id: lpcm_decoder_thread.h,v 1.5 2001/05/01 04:18:18 sam Exp $
* *
* Authors: Samuel Hocevar <sam@zoy.org> * Authors: Samuel Hocevar <sam@zoy.org>
* *
...@@ -43,14 +43,12 @@ typedef struct lpcmdec_thread_s ...@@ -43,14 +43,12 @@ typedef struct lpcmdec_thread_s
/* /*
* Decoder properties * Decoder properties
*/ */
lpcmdec_t lpcm_decoder; lpcmdec_t lpcm_decoder;
/* /*
* Output properties * Output properties
*/ */
aout_fifo_t * p_aout_fifo; /* stores the decompressed audio frames */ aout_fifo_t * p_aout_fifo; /* stores the decompressed audio frames */
aout_thread_t * p_aout; /* needed to create the audio fifo */
} lpcmdec_thread_t; } lpcmdec_thread_t;
...@@ -58,3 +56,4 @@ typedef struct lpcmdec_thread_s ...@@ -58,3 +56,4 @@ typedef struct lpcmdec_thread_s
* Prototypes * Prototypes
*****************************************************************************/ *****************************************************************************/
vlc_thread_t lpcmdec_CreateThread( adec_config_t * p_config ); vlc_thread_t lpcmdec_CreateThread( adec_config_t * p_config );
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* modules.c : Built-in and plugin modules management functions * modules.c : Built-in and plugin modules management functions
***************************************************************************** *****************************************************************************
* Copyright (C) 2001 VideoLAN * Copyright (C) 2001 VideoLAN
* $Id: modules.c,v 1.27 2001/04/28 03:36:25 sam Exp $ * $Id: modules.c,v 1.28 2001/05/01 04:18:18 sam Exp $
* *
* Authors: Samuel Hocevar <sam@zoy.org> * Authors: Samuel Hocevar <sam@zoy.org>
* Ethan C. Baldridge <BaldridgeE@cadmus.com> * Ethan C. Baldridge <BaldridgeE@cadmus.com>
...@@ -60,19 +60,18 @@ ...@@ -60,19 +60,18 @@
#include "intf_msg.h" #include "intf_msg.h"
#include "modules.h" #include "modules.h"
#ifdef HAVE_DYNAMIC_PLUGINS #ifdef HAVE_DYNAMIC_PLUGINS
#include "modules_core.h" # include "modules_core.h"
#endif #endif
#include "modules_builtin.h" #include "modules_builtin.h"
/* Local prototypes */ /* Local prototypes */
#ifdef HAVE_DYNAMIC_PLUGINS #ifdef HAVE_DYNAMIC_PLUGINS
static int AllocatePluginModule ( module_bank_t *, char * ); static int AllocatePluginModule ( char * );
#endif #endif
static int AllocateBuiltinModule( module_bank_t *, static int AllocateBuiltinModule( int ( * ) ( module_t * ),
int ( * ) ( module_t * ),
int ( * ) ( module_t * ), int ( * ) ( module_t * ),
int ( * ) ( module_t * ) ); int ( * ) ( module_t * ) );
static int DeleteModule ( module_bank_t * p_bank, module_t * ); static int DeleteModule ( module_t * );
static int LockModule ( module_t * ); static int LockModule ( module_t * );
static int UnlockModule ( module_t * ); static int UnlockModule ( module_t * );
#ifdef HAVE_DYNAMIC_PLUGINS #ifdef HAVE_DYNAMIC_PLUGINS
...@@ -80,27 +79,13 @@ static int HideModule ( module_t * ); ...@@ -80,27 +79,13 @@ static int HideModule ( module_t * );
static int CallSymbol ( module_t *, char * ); static int CallSymbol ( module_t *, char * );
#endif #endif
/*****************************************************************************
* module_CreateBank: create the module bank.
*****************************************************************************
* This function creates a module bank structure.
*****************************************************************************/
module_bank_t * module_CreateBank( void )
{
module_bank_t * p_bank;
p_bank = malloc( sizeof( module_bank_t ) );
return( p_bank );
}
/***************************************************************************** /*****************************************************************************
* module_InitBank: create the module bank. * module_InitBank: create the module bank.
***************************************************************************** *****************************************************************************
* This function creates a module bank structure and fills it with the * This function creates a module bank structure and fills it with the
* built-in modules, as well as all the plugin modules it can find. * built-in modules, as well as all the plugin modules it can find.
*****************************************************************************/ *****************************************************************************/
void module_InitBank( module_bank_t * p_bank ) void module_InitBank( )
{ {
#ifdef HAVE_DYNAMIC_PLUGINS #ifdef HAVE_DYNAMIC_PLUGINS
static char * path[] = { ".", "lib", PLUGIN_PATH, NULL, NULL }; static char * path[] = { ".", "lib", PLUGIN_PATH, NULL, NULL };
...@@ -120,8 +105,6 @@ void module_InitBank( module_bank_t * p_bank ) ...@@ -120,8 +105,6 @@ void module_InitBank( module_bank_t * p_bank )
p_bank->first = NULL; p_bank->first = NULL;
vlc_mutex_init( &p_bank->lock ); vlc_mutex_init( &p_bank->lock );
intf_WarnMsg( 1, "module: module bank initialized" );
intf_WarnMsg( 2, "module: checking built-in modules" ); intf_WarnMsg( 2, "module: checking built-in modules" );
ALLOCATE_ALL_BUILTINS(); ALLOCATE_ALL_BUILTINS();
...@@ -178,7 +161,7 @@ void module_InitBank( module_bank_t * p_bank ) ...@@ -178,7 +161,7 @@ void module_InitBank( module_bank_t * p_bank )
/* We created a nice filename -- now we just try to load /* We created a nice filename -- now we just try to load
* it as a plugin module. */ * it as a plugin module. */
AllocatePluginModule( p_bank, psz_file ); AllocatePluginModule( psz_file );
/* We don't care if the allocation succeeded */ /* We don't care if the allocation succeeded */
free( psz_file ); free( psz_file );
...@@ -198,22 +181,24 @@ void module_InitBank( module_bank_t * p_bank ) ...@@ -198,22 +181,24 @@ void module_InitBank( module_bank_t * p_bank )
} }
#endif /* HAVE_DYNAMIC_PLUGINS */ #endif /* HAVE_DYNAMIC_PLUGINS */
intf_WarnMsg( 1, "module: module bank initialized" );
return; return;
} }
/***************************************************************************** /*****************************************************************************
* module_DestroyBank: destroy the module bank. * module_EndBank: destroy the module bank.
***************************************************************************** *****************************************************************************
* This function unloads all unused plugin modules and removes the module * This function unloads all unused plugin modules and removes the module
* bank in case of success. * bank in case of success.
*****************************************************************************/ *****************************************************************************/
void module_DestroyBank( module_bank_t * p_bank ) void module_EndBank( )
{ {
module_t * p_next; module_t * p_next;
while( p_bank->first != NULL ) while( p_bank->first != NULL )
{ {
if( DeleteModule( p_bank, p_bank->first ) ) if( DeleteModule( p_bank->first ) )
{ {
/* Module deletion failed */ /* Module deletion failed */
intf_ErrMsg( "module error: `%s' can't be removed. trying harder.", intf_ErrMsg( "module error: `%s' can't be removed. trying harder.",
...@@ -229,9 +214,6 @@ void module_DestroyBank( module_bank_t * p_bank ) ...@@ -229,9 +214,6 @@ void module_DestroyBank( module_bank_t * p_bank )
/* Destroy the lock */ /* Destroy the lock */
vlc_mutex_destroy( &p_bank->lock ); vlc_mutex_destroy( &p_bank->lock );
/* We can free the module bank */
free( p_bank );
return; return;
} }
...@@ -241,7 +223,7 @@ void module_DestroyBank( module_bank_t * p_bank ) ...@@ -241,7 +223,7 @@ void module_DestroyBank( module_bank_t * p_bank )
* This function resets the module bank by unloading all unused plugin * This function resets the module bank by unloading all unused plugin
* modules. * modules.
*****************************************************************************/ *****************************************************************************/
void module_ResetBank( module_bank_t * p_bank ) void module_ResetBank( )
{ {
intf_ErrMsg( "FIXME: module_ResetBank unimplemented" ); intf_ErrMsg( "FIXME: module_ResetBank unimplemented" );
return; return;
...@@ -253,7 +235,7 @@ void module_ResetBank( module_bank_t * p_bank ) ...@@ -253,7 +235,7 @@ void module_ResetBank( module_bank_t * p_bank )
* This function parses the module bank and hides modules that have been * This function parses the module bank and hides modules that have been
* unused for a while. * unused for a while.
*****************************************************************************/ *****************************************************************************/
void module_ManageBank( module_bank_t * p_bank ) void module_ManageBank( )
{ {
#ifdef HAVE_DYNAMIC_PLUGINS #ifdef HAVE_DYNAMIC_PLUGINS
module_t * p_module; module_t * p_module;
...@@ -297,8 +279,7 @@ void module_ManageBank( module_bank_t * p_bank ) ...@@ -297,8 +279,7 @@ void module_ManageBank( module_bank_t * p_bank )
***************************************************************************** *****************************************************************************
* This function returns the module that best fits the asked capabilities. * This function returns the module that best fits the asked capabilities.
*****************************************************************************/ *****************************************************************************/
module_t * module_Need( module_bank_t *p_bank, module_t * module_Need( int i_capabilities, void *p_data )
int i_capabilities, void *p_data )
{ {
module_t * p_module; module_t * p_module;
module_t * p_bestmodule = NULL; module_t * p_bestmodule = NULL;
...@@ -379,7 +360,7 @@ module_t * module_Need( module_bank_t *p_bank, ...@@ -379,7 +360,7 @@ module_t * module_Need( module_bank_t *p_bank,
* This function must be called by the thread that called module_Need, to * This function must be called by the thread that called module_Need, to
* decrease the reference count and allow for hiding of modules. * decrease the reference count and allow for hiding of modules.
*****************************************************************************/ *****************************************************************************/
void module_Unneed( module_bank_t * p_bank, module_t * p_module ) void module_Unneed( module_t * p_module )
{ {
/* We take the global lock */ /* We take the global lock */
vlc_mutex_lock( &p_bank->lock ); vlc_mutex_lock( &p_bank->lock );
...@@ -408,7 +389,7 @@ void module_Unneed( module_bank_t * p_bank, module_t * p_module ) ...@@ -408,7 +389,7 @@ void module_Unneed( module_bank_t * p_bank, module_t * p_module )
* for its information data. The module can then be handled by module_Need, * for its information data. The module can then be handled by module_Need,
* module_Unneed and HideModule. It can be removed by DeleteModule. * module_Unneed and HideModule. It can be removed by DeleteModule.
*****************************************************************************/ *****************************************************************************/
static int AllocatePluginModule( module_bank_t * p_bank, char * psz_filename ) static int AllocatePluginModule( char * psz_filename )
{ {
module_t * p_module, * p_othermodule; module_t * p_module, * p_othermodule;
module_handle_t handle; module_handle_t handle;
...@@ -527,8 +508,7 @@ static int AllocatePluginModule( module_bank_t * p_bank, char * psz_filename ) ...@@ -527,8 +508,7 @@ static int AllocatePluginModule( module_bank_t * p_bank, char * psz_filename )
* for its information data. The module can then be handled by module_Need, * for its information data. The module can then be handled by module_Need,
* module_Unneed and HideModule. It can be removed by DeleteModule. * module_Unneed and HideModule. It can be removed by DeleteModule.
*****************************************************************************/ *****************************************************************************/
static int AllocateBuiltinModule( module_bank_t * p_bank, static int AllocateBuiltinModule( int ( *pf_init ) ( module_t * ),
int ( *pf_init ) ( module_t * ),
int ( *pf_activate ) ( module_t * ), int ( *pf_activate ) ( module_t * ),
int ( *pf_deactivate ) ( module_t * ) ) int ( *pf_deactivate ) ( module_t * ) )
{ {
...@@ -627,7 +607,7 @@ static int AllocateBuiltinModule( module_bank_t * p_bank, ...@@ -627,7 +607,7 @@ static int AllocateBuiltinModule( module_bank_t * p_bank,
***************************************************************************** *****************************************************************************
* This function can only be called if i_usage <= 0. * This function can only be called if i_usage <= 0.
*****************************************************************************/ *****************************************************************************/
static int DeleteModule( module_bank_t * p_bank, module_t * p_module ) static int DeleteModule( module_t * p_module )
{ {
/* If the module is not in use but is still in memory, we first have /* If the module is not in use but is still in memory, we first have
* to hide it and remove it from memory before we can free the * to hide it and remove it from memory before we can free the
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
* thread, and destroy a previously oppened video output thread. * thread, and destroy a previously oppened video output thread.
***************************************************************************** *****************************************************************************
* Copyright (C) 2000 VideoLAN * Copyright (C) 2000 VideoLAN
* $Id: video_output.c,v 1.121 2001/04/27 19:29:11 massiot Exp $ * $Id: video_output.c,v 1.122 2001/05/01 04:18:18 sam Exp $
* *
* Authors: Vincent Seguin <seguin@via.ecp.fr> * Authors: Vincent Seguin <seguin@via.ecp.fr>
* *
...@@ -109,8 +109,7 @@ vout_thread_t * vout_CreateThread ( int *pi_status ) ...@@ -109,8 +109,7 @@ vout_thread_t * vout_CreateThread ( int *pi_status )
} }
/* Choose the best module */ /* Choose the best module */
p_vout->p_module = module_Need( p_main->p_bank, p_vout->p_module = module_Need( MODULE_CAPABILITY_VOUT, NULL );
MODULE_CAPABILITY_VOUT, NULL );
if( p_vout->p_module == NULL ) if( p_vout->p_module == NULL )
{ {
...@@ -197,7 +196,7 @@ vout_thread_t * vout_CreateThread ( int *pi_status ) ...@@ -197,7 +196,7 @@ vout_thread_t * vout_CreateThread ( int *pi_status )
* own error messages */ * own error messages */
if( p_vout->pf_create( p_vout ) ) if( p_vout->pf_create( p_vout ) )
{ {
module_Unneed( p_main->p_bank, p_vout->p_module ); module_Unneed( p_vout->p_module );
free( p_vout ); free( p_vout );
return( NULL ); return( NULL );
} }
...@@ -1312,7 +1311,7 @@ static void DestroyThread( vout_thread_t *p_vout, int i_status ) ...@@ -1312,7 +1311,7 @@ static void DestroyThread( vout_thread_t *p_vout, int i_status )
vlc_mutex_destroy( &p_vout->change_lock ); vlc_mutex_destroy( &p_vout->change_lock );
/* Release the module */ /* Release the module */
module_Unneed( p_main->p_bank, p_vout->p_module ); module_Unneed( p_vout->p_module );
/* Free structure */ /* Free structure */
free( p_vout ); free( p_vout );
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
* These functions set up YUV tables for colorspace conversion * These functions set up YUV tables for colorspace conversion
***************************************************************************** *****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN * Copyright (C) 1999, 2000 VideoLAN
* $Id: video_yuv.c,v 1.47 2001/03/21 13:42:35 sam Exp $ * $Id: video_yuv.c,v 1.48 2001/05/01 04:18:18 sam Exp $
* *
* Authors: Vincent Seguin <seguin@via.ecp.fr> * Authors: Vincent Seguin <seguin@via.ecp.fr>
* *
...@@ -45,8 +45,6 @@ ...@@ -45,8 +45,6 @@
#include "intf_msg.h" #include "intf_msg.h"
#include "main.h"
/***************************************************************************** /*****************************************************************************
* vout_InitYUV: allocate and initialize translation tables * vout_InitYUV: allocate and initialize translation tables
***************************************************************************** *****************************************************************************
...@@ -56,8 +54,7 @@ ...@@ -56,8 +54,7 @@
int vout_InitYUV( vout_thread_t *p_vout ) int vout_InitYUV( vout_thread_t *p_vout )
{ {
/* Choose the best module */ /* Choose the best module */
p_vout->yuv.p_module = module_Need( p_main->p_bank, p_vout->yuv.p_module = module_Need( MODULE_CAPABILITY_YUV, NULL );
MODULE_CAPABILITY_YUV, NULL );
if( p_vout->yuv.p_module == NULL ) if( p_vout->yuv.p_module == NULL )
{ {
...@@ -94,6 +91,6 @@ int vout_ResetYUV( vout_thread_t *p_vout ) ...@@ -94,6 +91,6 @@ int vout_ResetYUV( vout_thread_t *p_vout )
void vout_EndYUV( vout_thread_t *p_vout ) void vout_EndYUV( vout_thread_t *p_vout )
{ {
p_vout->yuv.pf_end( p_vout ); p_vout->yuv.pf_end( p_vout );
module_Unneed( p_main->p_bank, p_vout->yuv.p_module ); module_Unneed( p_vout->yuv.p_module );
} }
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* video_parser.c : video parser thread * video_parser.c : video parser thread
***************************************************************************** *****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN * Copyright (C) 1999, 2000 VideoLAN
* $Id: video_parser.c,v 1.81 2001/04/29 14:52:42 stef Exp $ * $Id: video_parser.c,v 1.82 2001/05/01 04:18:18 sam Exp $
* *
* Authors: Christophe Massiot <massiot@via.ecp.fr> * Authors: Christophe Massiot <massiot@via.ecp.fr>
* Samuel Hocevar <sam@via.ecp.fr> * Samuel Hocevar <sam@via.ecp.fr>
...@@ -60,17 +60,14 @@ ...@@ -60,17 +60,14 @@
#include "../video_decoder/video_parser.h" #include "../video_decoder/video_parser.h"
#include "../video_decoder/video_fifo.h" #include "../video_decoder/video_fifo.h"
#include "main.h"
/* /*
* Local prototypes * Local prototypes
*/ */
static int InitThread ( vpar_thread_t *p_vpar ); static int InitThread ( vpar_thread_t * );
static void RunThread ( vpar_thread_t *p_vpar ); static void RunThread ( vpar_thread_t * );
static void ErrorThread ( vpar_thread_t *p_vpar ); static void ErrorThread ( vpar_thread_t * );
static void EndThread ( vpar_thread_t *p_vpar ); static void EndThread ( vpar_thread_t * );
static void BitstreamCallback ( bit_stream_t *p_bit_stream, static void BitstreamCallback ( bit_stream_t *, boolean_t );
boolean_t b_new_pes );
/***************************************************************************** /*****************************************************************************
* vpar_CreateThread: create a generic parser thread * vpar_CreateThread: create a generic parser thread
...@@ -103,8 +100,7 @@ vlc_thread_t vpar_CreateThread( vdec_config_t * p_config ) ...@@ -103,8 +100,7 @@ vlc_thread_t vpar_CreateThread( vdec_config_t * p_config )
/* /*
* Choose the best motion compensation module * Choose the best motion compensation module
*/ */
p_vpar->p_motion_module = module_Need( p_main->p_bank, p_vpar->p_motion_module = module_Need( MODULE_CAPABILITY_MOTION, NULL );
MODULE_CAPABILITY_MOTION, NULL );
if( p_vpar->p_motion_module == NULL ) if( p_vpar->p_motion_module == NULL )
{ {
...@@ -113,69 +109,68 @@ vlc_thread_t vpar_CreateThread( vdec_config_t * p_config ) ...@@ -113,69 +109,68 @@ vlc_thread_t vpar_CreateThread( vdec_config_t * p_config )
return( 0 ); return( 0 );
} }
#define m ( p_vpar->pppf_motion ) #define M ( p_vpar->pppf_motion )
#define s ( p_vpar->ppf_motion_skipped ) #define S ( p_vpar->ppf_motion_skipped )
#define f ( p_vpar->p_motion_module->p_functions->motion.functions.motion ) #define F ( p_vpar->p_motion_module->p_functions->motion.functions.motion )
m[0][0][0] = m[0][0][1] = m[0][0][2] = m[0][0][3] = NULL; M[0][0][0] = M[0][0][1] = M[0][0][2] = M[0][0][3] = NULL;
m[0][1][0] = m[0][1][1] = m[0][1][2] = m[0][1][3] = NULL; M[0][1][0] = M[0][1][1] = M[0][1][2] = M[0][1][3] = NULL;
m[1][0][0] = NULL; M[1][0][0] = NULL;
m[1][1][0] = NULL; M[1][1][0] = NULL;
m[2][0][0] = NULL; M[2][0][0] = NULL;
m[2][1][0] = NULL; M[2][1][0] = NULL;
m[3][0][0] = NULL; M[3][0][0] = NULL;
m[3][1][0] = NULL; M[3][1][0] = NULL;
m[1][0][1] = f.pf_field_field_420; M[1][0][1] = F.pf_field_field_420;
m[1][1][1] = f.pf_frame_field_420; M[1][1][1] = F.pf_frame_field_420;
m[2][0][1] = f.pf_field_field_422; M[2][0][1] = F.pf_field_field_422;
m[2][1][1] = f.pf_frame_field_422; M[2][1][1] = F.pf_frame_field_422;
m[3][0][1] = f.pf_field_field_444; M[3][0][1] = F.pf_field_field_444;
m[3][1][1] = f.pf_frame_field_444; M[3][1][1] = F.pf_frame_field_444;
m[1][0][2] = f.pf_field_16x8_420; M[1][0][2] = F.pf_field_16x8_420;
m[1][1][2] = f.pf_frame_frame_420; M[1][1][2] = F.pf_frame_frame_420;
m[2][0][2] = f.pf_field_16x8_422; M[2][0][2] = F.pf_field_16x8_422;
m[2][1][2] = f.pf_frame_frame_422; M[2][1][2] = F.pf_frame_frame_422;
m[3][0][2] = f.pf_field_16x8_444; M[3][0][2] = F.pf_field_16x8_444;
m[3][1][2] = f.pf_frame_frame_444; M[3][1][2] = F.pf_frame_frame_444;
m[1][0][3] = f.pf_field_dmv_420; M[1][0][3] = F.pf_field_dmv_420;
m[1][1][3] = f.pf_frame_dmv_420; M[1][1][3] = F.pf_frame_dmv_420;
m[2][0][3] = f.pf_field_dmv_422; M[2][0][3] = F.pf_field_dmv_422;
m[2][1][3] = f.pf_frame_dmv_422; M[2][1][3] = F.pf_frame_dmv_422;
m[3][0][3] = f.pf_field_dmv_444; M[3][0][3] = F.pf_field_dmv_444;
m[3][1][3] = f.pf_frame_dmv_444; M[3][1][3] = F.pf_frame_dmv_444;
s[0][0] = s[0][1] = s[0][2] = s[0][3] = NULL; S[0][0] = S[0][1] = S[0][2] = S[0][3] = NULL;
s[1][0] = NULL; S[1][0] = NULL;
s[2][0] = NULL; S[2][0] = NULL;
s[3][0] = NULL; S[3][0] = NULL;
s[1][1] = f.pf_field_field_420; S[1][1] = F.pf_field_field_420;
s[2][1] = f.pf_field_field_422; S[2][1] = F.pf_field_field_422;
s[3][1] = f.pf_field_field_444; S[3][1] = F.pf_field_field_444;
s[1][2] = f.pf_field_field_420; S[1][2] = F.pf_field_field_420;
s[2][2] = f.pf_field_field_422; S[2][2] = F.pf_field_field_422;
s[3][2] = f.pf_field_field_444; S[3][2] = F.pf_field_field_444;
s[1][3] = f.pf_frame_frame_420; S[1][3] = F.pf_frame_frame_420;
s[2][3] = f.pf_frame_frame_422; S[2][3] = F.pf_frame_frame_422;
s[3][3] = f.pf_frame_frame_444; S[3][3] = F.pf_frame_frame_444;
#undef f #undef F
#undef s #undef S
#undef m #undef M
/* /*
* Choose the best IDCT module * Choose the best IDCT module
*/ */
p_vpar->p_idct_module = module_Need( p_main->p_bank, p_vpar->p_idct_module = module_Need( MODULE_CAPABILITY_IDCT, NULL );
MODULE_CAPABILITY_IDCT, NULL );
if( p_vpar->p_idct_module == NULL ) if( p_vpar->p_idct_module == NULL )
{ {
intf_ErrMsg( "vpar error: no suitable IDCT module" ); intf_ErrMsg( "vpar error: no suitable IDCT module" );
module_Unneed( p_main->p_bank, p_vpar->p_motion_module ); module_Unneed( p_vpar->p_motion_module );
free( p_vpar ); free( p_vpar );
return( 0 ); return( 0 );
} }
...@@ -192,8 +187,8 @@ vlc_thread_t vpar_CreateThread( vdec_config_t * p_config ) ...@@ -192,8 +187,8 @@ vlc_thread_t vpar_CreateThread( vdec_config_t * p_config )
(vlc_thread_func_t)RunThread, (void *)p_vpar ) ) (vlc_thread_func_t)RunThread, (void *)p_vpar ) )
{ {
intf_ErrMsg("vpar error: can't spawn video parser thread"); intf_ErrMsg("vpar error: can't spawn video parser thread");
module_Unneed( p_main->p_bank, p_vpar->p_idct_module ); module_Unneed( p_vpar->p_idct_module );
module_Unneed( p_main->p_bank, p_vpar->p_motion_module ); module_Unneed( p_vpar->p_motion_module );
free( p_vpar ); free( p_vpar );
return( 0 ); return( 0 );
} }
...@@ -506,8 +501,8 @@ static void EndThread( vpar_thread_t *p_vpar ) ...@@ -506,8 +501,8 @@ static void EndThread( vpar_thread_t *p_vpar )
vlc_mutex_destroy( &(p_vpar->synchro.fifo_lock) ); vlc_mutex_destroy( &(p_vpar->synchro.fifo_lock) );
module_Unneed( p_main->p_bank, p_vpar->p_idct_module ); module_Unneed( p_vpar->p_idct_module );
module_Unneed( p_main->p_bank, p_vpar->p_motion_module ); module_Unneed( p_vpar->p_motion_module );
free( p_vpar ); free( p_vpar );
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* vpar_headers.c : headers parsing * vpar_headers.c : headers parsing
***************************************************************************** *****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN * Copyright (C) 1999, 2000 VideoLAN
* $Id: vpar_headers.c,v 1.82 2001/04/28 03:36:26 sam Exp $ * $Id: vpar_headers.c,v 1.83 2001/05/01 04:18:18 sam Exp $
* *
* Authors: Christophe Massiot <massiot@via.ecp.fr> * Authors: Christophe Massiot <massiot@via.ecp.fr>
* Stphane Borel <stef@via.ecp.fr> * Stphane Borel <stef@via.ecp.fr>
...@@ -53,6 +53,8 @@ ...@@ -53,6 +53,8 @@
#include "../video_decoder/video_parser.h" #include "../video_decoder/video_parser.h"
#include "../video_decoder/video_fifo.h" #include "../video_decoder/video_fifo.h"
#include "main.h" /* XXX REMOVE THIS */
/* /*
* Local prototypes * Local prototypes
*/ */
...@@ -448,6 +450,13 @@ static void SequenceHeader( vpar_thread_t * p_vpar ) ...@@ -448,6 +450,13 @@ static void SequenceHeader( vpar_thread_t * p_vpar )
/* Extension and User data */ /* Extension and User data */
ExtensionAndUserData( p_vpar ); ExtensionAndUserData( p_vpar );
/* XXX: The vout request and fifo opening will eventually be here */
if( p_main->p_vout == NULL )
{
intf_Msg( "vpar: no vout present, spawning one" );
p_main->p_vout = p_vpar->p_vout = vout_CreateThread( NULL );
}
} }
/***************************************************************************** /*****************************************************************************
......
Name: vlc Name: vlc
Version: 0.2.73 Version: 0.2.73
Release: 1 Release: 2
Copyright: GPL Copyright: GPL
Url: http://www.videolan.org/ Url: http://www.videolan.org/
Group: X11/Applications/Graphics Group: X11/Applications/Graphics
Source0: http://www.videolan.org/packages/0.2.73/vlc-0.2.73.tar.gz Source0: http://www.videolan.org/packages/0.2.73/vlc-0.2.73.tar.gz
Prefix: /usr
Packager: Samuel Hocevar <sam@zoy.org> Packager: Samuel Hocevar <sam@zoy.org>
Buildroot: /tmp/vlc-build Buildroot: /tmp/vlc-build
Summary: VideoLAN Client. Summary: VideoLAN Client.
Summary(fr): Client VideoLAN.
%changelog %changelog
* Mon Apr 30 2001 Arnaud Gomes-do-Vale <arnaud@glou.org>
Added relocation support and compile fixes for Red Hat 7.x.
* Sat Apr 28 2001 Henri Fallon <henri@videolan.org> * Sat Apr 28 2001 Henri Fallon <henri@videolan.org>
New upstream release (0.2.73) New upstream release (0.2.73)
...@@ -42,21 +47,37 @@ a free network-aware MPEG and DVD player ...@@ -42,21 +47,37 @@ a free network-aware MPEG and DVD player
The VideoLAN Client allows to play MPEG2 Transport Streams from the The VideoLAN Client allows to play MPEG2 Transport Streams from the
network or from a file, as well as direct DVD playback. network or from a file, as well as direct DVD playback.
%description -l fr
Un lecteur MPEG et DVD utilisable en rseau.
VideoLAN est un lecteur MPEG1/2. Le client VideoLAN permet la lecture de
flux MPEG2 depuis le rseau ou depuis un fichier, en plus de la lecture
directe des DVD.
%prep %prep
%setup %setup
%build %build
./configure --prefix=/usr --with-sdl --enable-esd --enable-gnome --enable-qt if [ -x %{prefix}/bin/kgcc ] ;
make then
CC=%{prefix}/bin/kgcc ./configure --prefix=%{prefix} --with-sdl --enable-esd --enable-gnome --enable-qt
else
./configure --prefix=%{prefix} --with-sdl --enable-esd --enable-gnome --enable-qt
fi
if [ -x %{prefix}/bin/kgcc ] ;
then
CC=%{prefix}/bin/kgcc make
else
make
fi
%install %install
mkdir -p $RPM_BUILD_ROOT/usr/lib mkdir -p $RPM_BUILD_ROOT%{prefix}/lib
mkdir -p $RPM_BUILD_ROOT/usr/bin mkdir -p $RPM_BUILD_ROOT%{prefix}/bin
make install prefix=$RPM_BUILD_ROOT/usr make install prefix=$RPM_BUILD_ROOT%{prefix}
%files %files
%attr(-, root, root) /usr/bin/vlc %attr(-, root, root) %{prefix}/bin/vlc
%attr(-, root, root) /usr/share/videolan %attr(-, root, root) %{prefix}/share/videolan
%attr(-, root, root) /usr/lib/videolan %attr(-, root, root) %{prefix}/lib/videolan
%attr(-, root, root) %doc ChangeLog AUTHORS COPYING INSTALL README TODO doc %attr(-, root, root) %doc ChangeLog AUTHORS COPYING INSTALL README TODO doc
%clean %clean
rm -rf $RPM_BUILD_ROOT rm -rf $RPM_BUILD_ROOT
......
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