From 2e0eab4ca7a626b63263ec6d978c19ea0c3df22e Mon Sep 17 00:00:00 2001 From: Christophe Massiot Date: Thu, 6 Dec 2001 10:53:42 +0000 Subject: [PATCH] * mad plug-in is now built-in to avoid PIC/non-PIC collision ; * Updated documentation ; * New --desync option, to delay the video (in case of lip desynchronization) ; this is bad, but we have no other option for the moment ; * Clicking in vout now pauses the stream, patch courtesy of Peter Surda. --- configure | 2 +- configure.in | 2 +- doc/vlc.1 | 2 +- include/main.h | 3 ++- plugins/x11/vout_xvideo.c | 9 ++++++--- src/audio_output/aout_s16.c | 5 ++++- src/audio_output/aout_u8.c | 10 +++++++--- src/audio_output/audio_output.c | 4 ++-- src/input/input_clock.c | 7 +++++-- src/interface/main.c | 24 ++++++++++++++++++++---- 10 files changed, 49 insertions(+), 19 deletions(-) diff --git a/configure b/configure index 979184a70f..f1537ffbe0 100755 --- a/configure +++ b/configure @@ -4939,7 +4939,7 @@ fi CFLAGS=$save_CFLAGS LDFLAGS=$save_LDFLAGS - PLUGINS="${PLUGINS} mad_adec" + BUILTINS="${BUILTINS} mad_adec" fi fi diff --git a/configure.in b/configure.in index 4f23710c5d..2ff1cf0ee7 100644 --- a/configure.in +++ b/configure.in @@ -778,7 +778,7 @@ AC_ARG_WITH(libmad, ]) CFLAGS=$save_CFLAGS LDFLAGS=$save_LDFLAGS - PLUGINS="${PLUGINS} mad_adec" + BUILTINS="${BUILTINS} mad_adec" fi ]) dnl special case for BeOS diff --git a/doc/vlc.1 b/doc/vlc.1 index 8e3d54de80..a196fe34bc 100644 --- a/doc/vlc.1 +++ b/doc/vlc.1 @@ -40,7 +40,7 @@ must have been prepared beforehands. .B vcd: VCD device (for instance dvd:/dev/cdrom). .TP -.B udpstream:[:[]][@[][:]] +.B udpstream:[[:]][@[][:]] UDP stream, such as one sent by VideoLAN Server or VideoLAN miniserver. Usually "udpstream:" is enough. .TP diff --git a/include/main.h b/include/main.h index 4451efd1e6..69d8533cf6 100644 --- a/include/main.h +++ b/include/main.h @@ -3,7 +3,7 @@ * Declaration and extern access to global program object. ***************************************************************************** * Copyright (C) 1999, 2000 VideoLAN - * $Id: main.h,v 1.23 2001/12/03 16:18:37 sam Exp $ + * $Id: main.h,v 1.24 2001/12/06 10:53:42 massiot Exp $ * * Authors: Vincent Seguin * @@ -49,6 +49,7 @@ typedef struct main_s boolean_t b_audio; /* is audio output allowed ? */ boolean_t b_video; /* is video output allowed ? */ boolean_t b_ac3; + int i_desync; /* relative desync of the audio ouput */ /* memcpy plugin used */ struct module_s * p_memcpy_module; diff --git a/plugins/x11/vout_xvideo.c b/plugins/x11/vout_xvideo.c index dc90fd3f4d..d04c0119b7 100644 --- a/plugins/x11/vout_xvideo.c +++ b/plugins/x11/vout_xvideo.c @@ -2,7 +2,7 @@ * vout_xvideo.c: Xvideo video output display method ***************************************************************************** * Copyright (C) 1998-2001 VideoLAN - * $Id: vout_xvideo.c,v 1.34 2001/12/03 16:18:37 sam Exp $ + * $Id: vout_xvideo.c,v 1.35 2001/12/06 10:53:42 massiot Exp $ * * Authors: Shane Harper * Vincent Seguin @@ -531,8 +531,11 @@ static int vout_Manage( vout_thread_t *p_vout ) switch( ((XButtonEvent *)&xevent)->button ) { case Button1: - /* in this part we will eventually manage - * clicks for DVD navigation for instance */ + /* In this part we will eventually manage + * clicks for DVD navigation for instance. For the + * moment just pause the stream. */ + input_SetStatus( p_main->p_intf->p_input, + INPUT_STATUS_PAUSE ); break; } } diff --git a/src/audio_output/aout_s16.c b/src/audio_output/aout_s16.c index 9ffe1308e3..392399f742 100644 --- a/src/audio_output/aout_s16.c +++ b/src/audio_output/aout_s16.c @@ -38,6 +38,8 @@ #include "audio_output.h" #include "aout_common.h" +#include "main.h" + /***************************************************************************** * Local prototypes *****************************************************************************/ @@ -90,7 +92,8 @@ void aout_S16StereoThread( aout_thread_t * p_aout ) /* sizeof(s16) << (p_aout->b_stereo) == 4 */ p_aout->date = mdate() + ((((mtime_t)((l_bytes + 4 * p_aout->i_latency) / 4)) * 1000000) - / ((mtime_t)p_aout->l_rate)); + / ((mtime_t)p_aout->l_rate)) + + p_main->i_desync; p_aout->pf_play( p_aout, (byte_t *)p_aout->buffer, l_buffer_limit * sizeof(s16) ); diff --git a/src/audio_output/aout_u8.c b/src/audio_output/aout_u8.c index 2a863fda19..24196cce59 100644 --- a/src/audio_output/aout_u8.c +++ b/src/audio_output/aout_u8.c @@ -2,7 +2,7 @@ * aout_u8.c: 8 bit unsigned audio output functions ***************************************************************************** * Copyright (C) 1999-2001 VideoLAN - * $Id: aout_u8.c,v 1.7 2001/11/28 15:08:06 massiot Exp $ + * $Id: aout_u8.c,v 1.8 2001/12/06 10:53:42 massiot Exp $ * * Authors: Michel Kaempf * @@ -39,6 +39,8 @@ #include "audio_output.h" #include "aout_common.h" +#include "main.h" + /***************************************************************************** * Local prototypes *****************************************************************************/ @@ -84,7 +86,8 @@ void aout_U8MonoThread( aout_thread_t * p_aout ) l_bytes = p_aout->pf_getbufinfo( p_aout, l_buffer_limit ); /* sizeof(u8) << (p_aout->b_stereo) == 1 */ p_aout->date = mdate() + ((((mtime_t)((l_bytes + 4 * p_aout->i_latency) / 1)) * 1000000) - / ((mtime_t)p_aout->l_rate)); + / ((mtime_t)p_aout->l_rate)) + + p_main->i_desync; p_aout->pf_play( p_aout, (byte_t *)p_aout->buffer, l_buffer_limit * sizeof(u8) ); if ( l_bytes > (l_buffer_limit * sizeof(u8) * 2) ) /* There are 2 channels (left & right) */ @@ -138,7 +141,8 @@ void aout_U8StereoThread( aout_thread_t * p_aout ) l_bytes = p_aout->pf_getbufinfo( p_aout, l_buffer_limit ); /* sizeof(u8) << (p_aout->b_stereo) == 2 */ p_aout->date = mdate() + ((((mtime_t)((l_bytes + 4 * p_aout->i_latency) / 2)) * 1000000) - / ((mtime_t)p_aout->l_rate)); + / ((mtime_t)p_aout->l_rate)) + + p_main->i_desync; p_aout->pf_play( p_aout, (byte_t *)p_aout->buffer, l_buffer_limit * sizeof(u8) ); if ( l_bytes > (l_buffer_limit * sizeof(u8)) ) diff --git a/src/audio_output/audio_output.c b/src/audio_output/audio_output.c index 1452623873..093a2947be 100644 --- a/src/audio_output/audio_output.c +++ b/src/audio_output/audio_output.c @@ -2,7 +2,7 @@ * audio_output.c : audio output thread ***************************************************************************** * Copyright (C) 1999-2001 VideoLAN - * $Id: audio_output.c,v 1.66 2001/11/28 15:08:06 massiot Exp $ + * $Id: audio_output.c,v 1.67 2001/12/06 10:53:42 massiot Exp $ * * Authors: Michel Kaempf * @@ -312,7 +312,7 @@ static int aout_SpawnThread( aout_thread_t * p_aout ) } /* Rough estimate of the playing date */ - p_aout->date = mdate(); + p_aout->date = mdate() + p_main->i_desync; /* Launch the thread */ if ( vlc_thread_create( &p_aout->thread_id, "audio output", diff --git a/src/input/input_clock.c b/src/input/input_clock.c index b72b7db528..98be462711 100644 --- a/src/input/input_clock.c +++ b/src/input/input_clock.c @@ -2,7 +2,7 @@ * input_clock.c: Clock/System date convertions, stream management ***************************************************************************** * Copyright (C) 1999-2001 VideoLAN - * $Id: input_clock.c,v 1.25 2001/12/05 03:31:04 jobi Exp $ + * $Id: input_clock.c,v 1.26 2001/12/06 10:53:42 massiot Exp $ * * Authors: Christophe Massiot * @@ -40,6 +40,8 @@ #include "input_ext-dec.h" #include "input_ext-plugins.h" +#include "main.h" + /* * DISCUSSION : SYNCHRONIZATION METHOD * @@ -312,7 +314,8 @@ mtime_t input_ClockGetTS( input_thread_t * p_input, if( p_pgrm->i_synchro_state == SYNCHRO_OK ) { return( ClockToSysdate( p_input, p_pgrm, i_ts + p_pgrm->delta_cr ) - + DEFAULT_PTS_DELAY ); + + DEFAULT_PTS_DELAY + + (p_main->i_desync > 0 ? p_main->i_desync : 0) ); } else { diff --git a/src/interface/main.c b/src/interface/main.c index 9daa6dc329..f2427de233 100644 --- a/src/interface/main.c +++ b/src/interface/main.c @@ -4,7 +4,7 @@ * and spawn threads. ***************************************************************************** * Copyright (C) 1998-2001 VideoLAN - * $Id: main.c,v 1.130 2001/12/05 10:30:25 massiot Exp $ + * $Id: main.c,v 1.131 2001/12/06 10:53:42 massiot Exp $ * * Authors: Vincent Seguin * Samuel Hocevar @@ -112,6 +112,7 @@ #define OPT_MONO 152 #define OPT_SPDIF 153 #define OPT_VOLUME 154 +#define OPT_DESYNC 155 #define OPT_NOVIDEO 160 #define OPT_DISPLAY 161 @@ -187,6 +188,7 @@ static const struct option longopts[] = { "downmix", 1, 0, OPT_DOWNMIX }, { "imdct", 1, 0, OPT_IMDCT }, { "volume", 1, 0, OPT_VOLUME }, + { "desync", 1, 0, OPT_DESYNC }, /* Video options */ { "novideo", 0, 0, OPT_NOVIDEO }, @@ -596,6 +598,7 @@ static int GetConfiguration( int *pi_argc, char *ppsz_argv[], char *ppsz_env[] ) p_main->i_warning_level = 0; p_main->b_stats = 0; + p_main->i_desync = 0; /* No desynchronization by default */ p_main->p_channel = NULL; @@ -732,6 +735,9 @@ static int GetConfiguration( int *pi_argc, char *ppsz_argv[], char *ppsz_env[] ) case OPT_VOLUME: /* --volume */ main_PutIntVariable( AOUT_VOLUME_VAR, atoi(optarg) ); break; + case OPT_DESYNC: /* --desync */ + p_main->i_desync = atoi(optarg); + break; /* Video options */ case OPT_NOVIDEO: /* --novideo */ @@ -915,6 +921,7 @@ static void Usage( int i_fashion ) "\n --downmix \tAC3 downmix method" "\n --imdct \tAC3 IMDCT method" "\n --volume [0..1024] \tVLC output volume" + "\n --desync