Commit 3d727062 authored by Christophe Massiot's avatar Christophe Massiot

Change --enable-debug into --enable-trace. Same with DEBUG_*.

--enable-debug still exists, but only activates -g and additional
safety checks.

I hope I didn't break anything :))
parent 092858e0
...@@ -34,6 +34,7 @@ ARCH = @ARCH@ ...@@ -34,6 +34,7 @@ ARCH = @ARCH@
# #
DEBUG = @DEBUG@ DEBUG = @DEBUG@
STATS = @STATS@ STATS = @STATS@
TRACE = @TRACE@
OPTIMS = @OPTIMS@ OPTIMS = @OPTIMS@
GETOPT = @GETOPT@ GETOPT = @GETOPT@
...@@ -89,8 +90,12 @@ ifeq ($(DEBUG),1) ...@@ -89,8 +90,12 @@ ifeq ($(DEBUG),1)
PROGRAM_OPTIONS += DEBUG PROGRAM_OPTIONS += DEBUG
DEFINE += -DDEBUG DEFINE += -DDEBUG
endif endif
ifeq ($(TRACE),1)
PROGRAM_OPTIONS += TRACE
DEFINE += -DTRACE
endif
ifeq ($(STATS),1) ifeq ($(STATS),1)
PROGRAM_OPTIONS += DEBUG PROGRAM_OPTIONS += STATS
DEFINE += -DSTATS DEFINE += -DSTATS
endif endif
...@@ -161,7 +166,9 @@ endif ...@@ -161,7 +166,9 @@ endif
ifeq ($(OPTIMS),1) ifeq ($(OPTIMS),1)
CFLAGS += -O3 CFLAGS += -O3
CFLAGS += -ffast-math -funroll-loops CFLAGS += -ffast-math -funroll-loops
ifneq ($(DEBUG),1)
CFLAGS += -fomit-frame-pointer CFLAGS += -fomit-frame-pointer
endif
# Optimizations for x86 familiy # Optimizations for x86 familiy
ifneq (,$(findstring 86,$(ARCH))) ifneq (,$(findstring 86,$(ARCH)))
...@@ -219,9 +226,9 @@ endif ...@@ -219,9 +226,9 @@ endif
endif endif
# #
# Debugging and profiling support (unless optimisations are active) # Debugging and profiling support
# #
ifneq ($(OPTIMS),1) ifeq ($(TRACE),1)
CFLAGS += -g CFLAGS += -g
endif endif
This diff is collapsed.
...@@ -202,6 +202,13 @@ AC_ARG_ENABLE(stats, ...@@ -202,6 +202,13 @@ AC_ARG_ENABLE(stats,
[ --enable-stats Enable printing of statistics (default disabled)], [ --enable-stats Enable printing of statistics (default disabled)],
[ if test x$enableval = xyes; then STATS=1; fi ]) [ if test x$enableval = xyes; then STATS=1; fi ])
dnl
dnl Trace mode
dnl
AC_ARG_ENABLE(trace,
[ --enable-trace Enable trace mode (default disabled)],
[ if test x$enableval = xyes; then TRACE=1; fi ])
dnl dnl
dnl Enable/disable optimizations dnl Enable/disable optimizations
dnl dnl
...@@ -458,6 +465,7 @@ AC_SUBST(DEFINE) ...@@ -458,6 +465,7 @@ AC_SUBST(DEFINE)
AC_SUBST(INCLUDE) AC_SUBST(INCLUDE)
AC_SUBST(DEBUG) AC_SUBST(DEBUG)
AC_SUBST(STATS) AC_SUBST(STATS)
AC_SUBST(TRACE)
AC_SUBST(OPTIMS) AC_SUBST(OPTIMS)
AC_SUBST(CSS) AC_SUBST(CSS)
...@@ -495,6 +503,7 @@ system : ${SYS} ...@@ -495,6 +503,7 @@ system : ${SYS}
architecture : ${ARCH} architecture : ${ARCH}
debug mode : ${DEBUG} debug mode : ${DEBUG}
statistics : ${STATS} statistics : ${STATS}
trace mode : ${TRACE}
optimizations : ${OPTIMS} optimizations : ${OPTIMS}
CSS decryption : ${CSS} CSS decryption : ${CSS}
need builtin getopt : ${GETOPT} need builtin getopt : ${GETOPT}
......
...@@ -66,23 +66,23 @@ ...@@ -66,23 +66,23 @@
/***************************************************************************** /*****************************************************************************
* Debugging options - define or undefine symbols * Debugging options - define or undefine symbols
*****************************************************************************/ *****************************************************************************/
#ifdef DEBUG #ifdef TRACE
/* General debugging support, which depends of the DEBUG define, is determined /* General trace support, which depends of the TRACE define, is determined
* in the Makefile */ * in the Makefile */
/* Modules specific debugging - this will produce a lot of output, but can be /* Modules specific debugging - this will produce a lot of output, but can be
* useful to track a bug */ * useful to track a bug */
//#define DEBUG_INTF //#define TRACE_INTF
//#define DEBUG_INPUT //#define TRACE_INPUT
//#define DEBUG_AUDIO //#define TRACE_AUDIO
#define DEBUG_VOUT #define TRACE_VOUT
#define DEBUG_VPAR #define TRACE_VPAR
/* Debugging log file - if defined, a file can be used to store all messages. If /* Trace log file - if defined, a file can be used to store all messages. If
* DEBUG_LOG_ONLY is defined, debug messages will only be printed to the log and * TRACE_LOG_ONLY is defined, debug messages will only be printed to the log and
* will not appear on the screen */ * will not appear on the screen */
#define DEBUG_LOG "vlc-debug.log" #define TRACE_LOG "vlc-trace.log"
#define DEBUG_LOG_ONLY #define TRACE_LOG_ONLY
#endif #endif
...@@ -443,7 +443,7 @@ ...@@ -443,7 +443,7 @@
* when debugging, since it allows messages which would not be printed * when debugging, since it allows messages which would not be printed
* due to a crash to be printed anyway */ * due to a crash to be printed anyway */
#ifndef DEBUG #ifndef DEBUG
//#define INTF_MSG_QUEUE #define INTF_MSG_QUEUE
#endif #endif
/* Format of the header for debug messages. The arguments following this header /* Format of the header for debug messages. The arguments following this header
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
* interface, such as message output. See config.h for output configuration. * interface, such as message output. See config.h for output configuration.
***************************************************************************** *****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN * Copyright (C) 1999, 2000 VideoLAN
* $Id: intf_msg.h,v 1.11 2001/03/21 13:42:33 sam Exp $ * $Id: intf_msg.h,v 1.12 2001/04/27 19:29:11 massiot Exp $
* *
* Authors: Vincent Seguin <seguin@via.ecp.fr> * Authors: Vincent Seguin <seguin@via.ecp.fr>
* *
...@@ -30,11 +30,11 @@ ...@@ -30,11 +30,11 @@
* compiler extensions and print the file, the function and the line number * compiler extensions and print the file, the function and the line number
* from which they have been called. They call _intf_DbgMsg*() functions after * from which they have been called. They call _intf_DbgMsg*() functions after
* having added debugging informations. * having added debugging informations.
* Outside DEBUG mode, intf_DbgMsg* functions do nothing. * Outside trace mode, intf_DbgMsg* functions do nothing.
*****************************************************************************/ *****************************************************************************/
#ifdef DEBUG #ifdef TRACE
/* DEBUG mode */ /* TRACE mode */
void _intf_DbgMsg ( char *psz_file, char *psz_function, int i_line, void _intf_DbgMsg ( char *psz_file, char *psz_function, int i_line,
char *psz_format, ... ); char *psz_format, ... );
void _intf_DbgMsgImm ( char *psz_file, char *psz_function, int i_line, void _intf_DbgMsgImm ( char *psz_file, char *psz_function, int i_line,
...@@ -47,7 +47,7 @@ void _intf_DbgMsgImm ( char *psz_file, char *psz_function, int i_line, ...@@ -47,7 +47,7 @@ void _intf_DbgMsgImm ( char *psz_file, char *psz_function, int i_line,
#else #else
/* Non-DEBUG mode */ /* Non-TRACE mode */
#define intf_DbgMsg( format, args... ) #define intf_DbgMsg( format, args... )
#define intf_DbgMsgImm( format, args...) #define intf_DbgMsgImm( format, args...)
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
* -dvd_udf to find files * -dvd_udf to find files
***************************************************************************** *****************************************************************************
* Copyright (C) 1998-2001 VideoLAN * Copyright (C) 1998-2001 VideoLAN
* $Id: input_dvd.c,v 1.49 2001/04/22 00:08:25 stef Exp $ * $Id: input_dvd.c,v 1.50 2001/04/27 19:29:11 massiot Exp $
* *
* Author: Stphane Borel <stef@via.ecp.fr> * Author: Stphane Borel <stef@via.ecp.fr>
* *
...@@ -742,7 +742,6 @@ static int DVDSetArea( input_thread_t * p_input, input_area_t * p_area ) ...@@ -742,7 +742,6 @@ static int DVDSetArea( input_thread_t * p_input, input_area_t * p_area )
for( i = 1 ; i <= vts.manager_inf.i_audio_nb ; i++ ) for( i = 1 ; i <= vts.manager_inf.i_audio_nb ; i++ )
{ {
#ifdef DEBUG
intf_WarnMsg( 1, "Audio %d: %x %x %x %x %x %x %x %x %x %x %x %x", i, intf_WarnMsg( 1, "Audio %d: %x %x %x %x %x %x %x %x %x %x %x %x", i,
vts.manager_inf.p_audio_attr[i-1].i_num_channels, vts.manager_inf.p_audio_attr[i-1].i_num_channels,
vts.manager_inf.p_audio_attr[i-1].i_coding_mode, vts.manager_inf.p_audio_attr[i-1].i_coding_mode,
...@@ -756,7 +755,6 @@ static int DVDSetArea( input_thread_t * p_input, input_area_t * p_area ) ...@@ -756,7 +755,6 @@ static int DVDSetArea( input_thread_t * p_input, input_area_t * p_area )
vts.manager_inf.p_audio_attr[i-1].i_sample_freq, vts.manager_inf.p_audio_attr[i-1].i_sample_freq,
vts.manager_inf.p_audio_attr[i-1].i_lang_code, vts.manager_inf.p_audio_attr[i-1].i_lang_code,
vts.manager_inf.p_audio_attr[i-1].i_caption ); vts.manager_inf.p_audio_attr[i-1].i_caption );
#endif
switch( vts.manager_inf.p_audio_attr[i-1].i_coding_mode ) switch( vts.manager_inf.p_audio_attr[i-1].i_coding_mode )
{ {
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* input_ps.c: PS demux and packet management * input_ps.c: PS demux and packet management
***************************************************************************** *****************************************************************************
* Copyright (C) 1998, 1999, 2000 VideoLAN * Copyright (C) 1998, 1999, 2000 VideoLAN
* $Id: input_ps.c,v 1.17 2001/04/22 00:08:26 stef Exp $ * $Id: input_ps.c,v 1.18 2001/04/27 19:29:11 massiot Exp $
* *
* Authors: Christophe Massiot <massiot@via.ecp.fr> * Authors: Christophe Massiot <massiot@via.ecp.fr>
* Cyril Deguet <asmax@via.ecp.fr> * Cyril Deguet <asmax@via.ecp.fr>
...@@ -547,11 +547,14 @@ static struct data_packet_s * NewPacket( void * p_packet_cache, ...@@ -547,11 +547,14 @@ static struct data_packet_s * NewPacket( void * p_packet_cache,
data_packet_t * p_data; data_packet_t * p_data;
long l_index; long l_index;
#ifdef DEBUG
if ( (p_cache = (packet_cache_t *)p_packet_cache) == NULL ) if ( (p_cache = (packet_cache_t *)p_packet_cache) == NULL )
{ {
intf_ErrMsg( "PPacket cache not initialized" ); intf_ErrMsg( "PPacket cache not initialized" );
return NULL; return NULL;
} }
#endif
/* Safety check */ /* Safety check */
if( l_size > INPUT_MAX_PACKET_SIZE ) if( l_size > INPUT_MAX_PACKET_SIZE )
{ {
...@@ -565,10 +568,12 @@ static struct data_packet_s * NewPacket( void * p_packet_cache, ...@@ -565,10 +568,12 @@ static struct data_packet_s * NewPacket( void * p_packet_cache,
/* Allocates a new packet */ /* Allocates a new packet */
if ( (p_data = malloc( sizeof(data_packet_t) )) == NULL ) if ( (p_data = malloc( sizeof(data_packet_t) )) == NULL )
{ {
intf_DbgMsg( "Out of memory" ); intf_ErrMsg( "Out of memory" );
return NULL; return NULL;
} }
intf_WarnMsg( 1, "PS input: data packet allocated" ); #ifdef TRACE_INPUT
intf_DbgMsg( "PS input: data packet allocated" );
#endif
} }
else else
{ {
...@@ -576,7 +581,7 @@ static struct data_packet_s * NewPacket( void * p_packet_cache, ...@@ -576,7 +581,7 @@ static struct data_packet_s * NewPacket( void * p_packet_cache,
if( (p_data = p_cache->data.p_stack[ -- p_cache->data.l_index ]) if( (p_data = p_cache->data.p_stack[ -- p_cache->data.l_index ])
== NULL ) == NULL )
{ {
intf_DbgMsg( "NULL packet in the data cache" ); intf_ErrMsg( "NULL packet in the data cache" );
return NULL; return NULL;
} }
} }
...@@ -595,7 +600,9 @@ static struct data_packet_s * NewPacket( void * p_packet_cache, ...@@ -595,7 +600,9 @@ static struct data_packet_s * NewPacket( void * p_packet_cache,
free( p_data ); free( p_data );
return NULL; return NULL;
} }
intf_WarnMsg( 1, "PS input: small buffer allocated" ); #ifdef TRACE_INPUT
intf_DbgMsg( "PS input: small buffer allocated" );
#endif
p_data->l_size = l_size; p_data->l_size = l_size;
} }
else else
...@@ -605,7 +612,7 @@ static struct data_packet_s * NewPacket( void * p_packet_cache, ...@@ -605,7 +612,7 @@ static struct data_packet_s * NewPacket( void * p_packet_cache,
if( (p_data->p_buffer = p_cache->small.p_stack[l_index].p_data) if( (p_data->p_buffer = p_cache->small.p_stack[l_index].p_data)
== NULL ) == NULL )
{ {
intf_DbgMsg( "NULL packet in the small buffer cache" ); intf_ErrMsg( "NULL packet in the small buffer cache" );
free( p_data ); free( p_data );
return NULL; return NULL;
} }
...@@ -632,11 +639,13 @@ static struct data_packet_s * NewPacket( void * p_packet_cache, ...@@ -632,11 +639,13 @@ static struct data_packet_s * NewPacket( void * p_packet_cache,
/* Allocates a new packet */ /* Allocates a new packet */
if ( (p_data->p_buffer = malloc( l_size )) == NULL ) if ( (p_data->p_buffer = malloc( l_size )) == NULL )
{ {
intf_DbgMsg( "Out of memory" ); intf_ErrMsg( "Out of memory" );
free( p_data ); free( p_data );
return NULL; return NULL;
} }
intf_WarnMsg( 1, "PS input: large buffer allocated" ); #ifdef TRACE_INPUT
intf_DbgMsg( "PS input: large buffer allocated" );
#endif
p_data->l_size = l_size; p_data->l_size = l_size;
} }
else else
...@@ -646,7 +655,7 @@ static struct data_packet_s * NewPacket( void * p_packet_cache, ...@@ -646,7 +655,7 @@ static struct data_packet_s * NewPacket( void * p_packet_cache,
if( (p_data->p_buffer = p_cache->large.p_stack[l_index].p_data) if( (p_data->p_buffer = p_cache->large.p_stack[l_index].p_data)
== NULL ) == NULL )
{ {
intf_DbgMsg( "NULL packet in the small buffer cache" ); intf_ErrMsg( "NULL packet in the small buffer cache" );
free( p_data ); free( p_data );
return NULL; return NULL;
} }
...@@ -683,11 +692,14 @@ static pes_packet_t * NewPES( void * p_packet_cache ) ...@@ -683,11 +692,14 @@ static pes_packet_t * NewPES( void * p_packet_cache )
packet_cache_t * p_cache; packet_cache_t * p_cache;
pes_packet_t * p_pes; pes_packet_t * p_pes;
#ifdef DEBUG
if ( (p_cache = (packet_cache_t *)p_packet_cache) == NULL ) if ( (p_cache = (packet_cache_t *)p_packet_cache) == NULL )
{ {
intf_ErrMsg( "Packet cache not initialized" ); intf_ErrMsg( "Packet cache not initialized" );
return NULL; return NULL;
} }
#endif
/* Checks whether the PES cache is empty */ /* Checks whether the PES cache is empty */
if( p_cache->pes.l_index == 0 ) if( p_cache->pes.l_index == 0 )
{ {
...@@ -697,7 +709,9 @@ static pes_packet_t * NewPES( void * p_packet_cache ) ...@@ -697,7 +709,9 @@ static pes_packet_t * NewPES( void * p_packet_cache )
intf_DbgMsg( "Out of memory" ); intf_DbgMsg( "Out of memory" );
return NULL; return NULL;
} }
intf_WarnMsg( 1, "PS input: PES packet allocated" ); #ifdef TRACE_INPUT
intf_DbgMsg( "PS input: PES packet allocated" );
#endif
} }
else else
{ {
...@@ -705,7 +719,7 @@ static pes_packet_t * NewPES( void * p_packet_cache ) ...@@ -705,7 +719,7 @@ static pes_packet_t * NewPES( void * p_packet_cache )
if( (p_pes = p_cache->pes.p_stack[ -- p_cache->pes.l_index ]) if( (p_pes = p_cache->pes.p_stack[ -- p_cache->pes.l_index ])
== NULL ) == NULL )
{ {
intf_DbgMsg( "NULL packet in the data cache" ); intf_ErrMsg( "NULL packet in the data cache" );
return NULL; return NULL;
} }
} }
...@@ -727,11 +741,13 @@ static void DeletePacket( void * p_packet_cache, ...@@ -727,11 +741,13 @@ static void DeletePacket( void * p_packet_cache,
{ {
packet_cache_t * p_cache; packet_cache_t * p_cache;
#ifdef DEBUG
if ( (p_cache = (packet_cache_t *)p_packet_cache) == NULL ) if ( (p_cache = (packet_cache_t *)p_packet_cache) == NULL )
{ {
intf_ErrMsg( "Packet cache not initialized" ); intf_ErrMsg( "Packet cache not initialized" );
return; return;
} }
#endif
ASSERT( p_data ); ASSERT( p_data );
...@@ -755,7 +771,9 @@ static void DeletePacket( void * p_packet_cache, ...@@ -755,7 +771,9 @@ static void DeletePacket( void * p_packet_cache,
{ {
ASSERT( p_data->p_buffer ); ASSERT( p_data->p_buffer );
free( p_data->p_buffer ); free( p_data->p_buffer );
intf_WarnMsg( 1, "PS input: small buffer freed" ); #ifdef TRACE_INPUT
intf_DbgMsg( "PS input: small buffer freed" );
#endif
} }
} }
else else
...@@ -772,7 +790,9 @@ static void DeletePacket( void * p_packet_cache, ...@@ -772,7 +790,9 @@ static void DeletePacket( void * p_packet_cache,
{ {
ASSERT( p_data->p_buffer ); ASSERT( p_data->p_buffer );
free( p_data->p_buffer ); free( p_data->p_buffer );
intf_WarnMsg( 1, "PS input: large buffer freed" ); #ifdef TRACE_INPUT
intf_DbgMsg( "PS input: large buffer freed" );
#endif
} }
} }
} }
...@@ -781,7 +801,9 @@ static void DeletePacket( void * p_packet_cache, ...@@ -781,7 +801,9 @@ static void DeletePacket( void * p_packet_cache,
/* Cache full: the packet must be freed */ /* Cache full: the packet must be freed */
free( p_data->p_buffer ); free( p_data->p_buffer );
free( p_data ); free( p_data );
intf_WarnMsg( 1, "PS input: data packet freed" ); #ifdef TRACE_INPUT
intf_DbgMsg( "PS input: data packet freed" );
#endif
} }
} }
...@@ -795,11 +817,13 @@ static void DeletePES( void * p_packet_cache, pes_packet_t * p_pes ) ...@@ -795,11 +817,13 @@ static void DeletePES( void * p_packet_cache, pes_packet_t * p_pes )
data_packet_t * p_data; data_packet_t * p_data;
data_packet_t * p_next; data_packet_t * p_next;
#ifdef DEBUG
if ( (p_cache = (packet_cache_t *)p_packet_cache) == NULL ) if ( (p_cache = (packet_cache_t *)p_packet_cache) == NULL )
{ {
intf_ErrMsg( "Packet cache not initialized" ); intf_ErrMsg( "Packet cache not initialized" );
return; return;
} }
#endif
ASSERT( p_pes); ASSERT( p_pes);
...@@ -822,7 +846,9 @@ static void DeletePES( void * p_packet_cache, pes_packet_t * p_pes ) ...@@ -822,7 +846,9 @@ static void DeletePES( void * p_packet_cache, pes_packet_t * p_pes )
{ {
/* Cache full: the packet must be freed */ /* Cache full: the packet must be freed */
free( p_pes ); free( p_pes );
intf_WarnMsg( 1, "PS input: PES packet freed" ); #ifdef TRACE_INPUT
intf_DbgMsg( "PS input: PES packet freed" );
#endif
} }
} }
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* vout_x11.c: X11 video output display method * vout_x11.c: X11 video output display method
***************************************************************************** *****************************************************************************
* Copyright (C) 1998, 1999, 2000 VideoLAN * Copyright (C) 1998, 1999, 2000 VideoLAN
* $Id: vout_x11.c,v 1.20 2001/04/21 22:49:24 sam Exp $ * $Id: vout_x11.c,v 1.21 2001/04/27 19:29:11 massiot 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>
...@@ -532,13 +532,11 @@ static int vout_Manage( vout_thread_t *p_vout ) ...@@ -532,13 +532,11 @@ static int vout_Manage( vout_thread_t *p_vout )
X11TogglePointer( p_vout ); X11TogglePointer( p_vout );
} }
} }
#ifdef DEBUG
/* Other event */ /* Other event */
else else
{ {
intf_DbgMsg( "vout: unhandled event %d received", xevent.type ); intf_WarnMsg( 1, "vout: unhandled event %d received", xevent.type );
} }
#endif
} }
/* ClientMessage event - only WM_PROTOCOLS with WM_DELETE_WINDOW data /* ClientMessage event - only WM_PROTOCOLS with WM_DELETE_WINDOW data
......
...@@ -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.11 2001/04/26 03:55:44 sam Exp $ * $Id: vout_xvideo.c,v 1.12 2001/04/27 19:29:11 massiot 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>
...@@ -483,14 +483,12 @@ static int vout_Manage( vout_thread_t *p_vout ) ...@@ -483,14 +483,12 @@ static int vout_Manage( vout_thread_t *p_vout )
p_vout->p_sys->b_mouse_pointer_visible = 1; p_vout->p_sys->b_mouse_pointer_visible = 1;
XVideoSetMousePointer( p_vout ); XVideoSetMousePointer( p_vout );
} }
#ifdef DEBUG
/* Other event */ /* Other event */
else else
{ {
intf_DbgMsg( "%p -> unhandled event type %d received", intf_WarnMsg( 1, "%p -> unhandled event type %d received",
p_vout, xevent.type ); p_vout, xevent.type );
} }
#endif
} }
/* Handle events for YUV video output sub-window */ /* Handle events for YUV video output sub-window */
......
...@@ -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.50 2001/04/22 00:08:26 stef Exp $ * $Id: input_programs.c,v 1.51 2001/04/27 19:29:11 massiot Exp $
* *
* Authors: Christophe Massiot <massiot@via.ecp.fr> * Authors: Christophe Massiot <massiot@via.ecp.fr>
* *
...@@ -613,7 +613,7 @@ int input_SelectES( input_thread_t * p_input, es_descriptor_t * p_es ) ...@@ -613,7 +613,7 @@ int input_SelectES( input_thread_t * p_input, es_descriptor_t * p_es )
return -1; return -1;
} }
#ifdef DEBUG_INPUT #ifdef TRACE_INPUT
intf_DbgMsg( "Selecting ES 0x%x", p_es->i_id ); intf_DbgMsg( "Selecting ES 0x%x", p_es->i_id );
#endif #endif
...@@ -711,7 +711,7 @@ int input_UnselectES( input_thread_t * p_input, es_descriptor_t * p_es ) ...@@ -711,7 +711,7 @@ int input_UnselectES( input_thread_t * p_input, es_descriptor_t * p_es )
return -1; return -1;
} }
#ifdef DEBUG_INPUT #ifdef TRACE_INPUT
intf_DbgMsg( "Unselecting ES 0x%x", p_es->i_id ); intf_DbgMsg( "Unselecting ES 0x%x", p_es->i_id );
#endif #endif
...@@ -744,7 +744,7 @@ int input_UnselectES( input_thread_t * p_input, es_descriptor_t * p_es ) ...@@ -744,7 +744,7 @@ int input_UnselectES( input_thread_t * p_input, es_descriptor_t * p_es )
if( p_input->stream.pp_selected_es == NULL ) if( p_input->stream.pp_selected_es == NULL )
{ {
#ifdef DEBUG_INPUT #ifdef TRACE_INPUT
intf_DbgMsg( "No more selected ES in input_UnselectES" ); intf_DbgMsg( "No more selected ES in input_UnselectES" );
#endif #endif
return( 1 ); return( 1 );
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
* interface, such as message output. See config.h for output configuration. * interface, such as message output. See config.h for output configuration.
***************************************************************************** *****************************************************************************
* Copyright (C) 1998, 1999, 2000 VideoLAN * Copyright (C) 1998, 1999, 2000 VideoLAN
* $Id: intf_msg.c,v 1.30 2001/04/25 09:31:14 sam Exp $ * $Id: intf_msg.c,v 1.31 2001/04/27 19:29:11 massiot Exp $
* *
* Authors: Vincent Seguin <seguin@via.ecp.fr> * Authors: Vincent Seguin <seguin@via.ecp.fr>
* *
...@@ -51,7 +51,7 @@ ...@@ -51,7 +51,7 @@
* intf_msg_item_t * intf_msg_item_t
***************************************************************************** *****************************************************************************
* Store a single message. Messages have a maximal size of INTF_MSG_MSGSIZE. * Store a single message. Messages have a maximal size of INTF_MSG_MSGSIZE.
* If DEBUG is defined, messages have a date field and debug messages are * If TRACE is defined, messages have a date field and debug messages are
* printed with a date to allow more precise profiling. * printed with a date to allow more precise profiling.
*****************************************************************************/ *****************************************************************************/
typedef struct typedef struct
...@@ -59,8 +59,8 @@ typedef struct ...@@ -59,8 +59,8 @@ typedef struct
int i_type; /* message type, see below */ int i_type; /* message type, see below */
char * psz_msg; /* the message itself */ char * psz_msg; /* the message itself */
#ifdef DEBUG #ifdef TRACE
/* Debugging informations - in DEBUG mode, debug messages have calling /* Debugging informations - in TRACE mode, debug messages have calling
* location informations printed */ * location informations printed */
mtime_t date; /* date of the message */ mtime_t date; /* date of the message */
char * psz_file; /* file in which the function was called */ char * psz_file; /* file in which the function was called */
...@@ -92,12 +92,12 @@ typedef struct intf_msg_s ...@@ -92,12 +92,12 @@ typedef struct intf_msg_s
intf_msg_item_t msg[INTF_MSG_QSIZE]; /* message queue */ intf_msg_item_t msg[INTF_MSG_QSIZE]; /* message queue */
#endif #endif
#ifdef DEBUG_LOG #ifdef TRACE_LOG
/* Log file */ /* Log file */
FILE * p_log_file; /* log file */ FILE * p_log_file; /* log file */
#endif #endif
#if !defined(INTF_MSG_QUEUE) && !defined(DEBUG_LOG) #if !defined(INTF_MSG_QUEUE) && !defined(TRACE_LOG)
/* If neither messages queue, neither log file is used, then the structure /* If neither messages queue, neither log file is used, then the structure
* is empty. However, empty structures are not allowed in C. Therefore, a * is empty. However, empty structures are not allowed in C. Therefore, a
* dummy integer is used to fill it. */ * dummy integer is used to fill it. */
...@@ -112,7 +112,7 @@ typedef struct intf_msg_s ...@@ -112,7 +112,7 @@ typedef struct intf_msg_s
static void QueueMsg ( intf_msg_t *p_msg, int i_type, static void QueueMsg ( intf_msg_t *p_msg, int i_type,
char *psz_format, va_list ap ); char *psz_format, va_list ap );
static void PrintMsg ( intf_msg_item_t *p_msg ); static void PrintMsg ( intf_msg_item_t *p_msg );
#ifdef DEBUG #ifdef TRACE
static void QueueDbgMsg ( intf_msg_t *p_msg, char *psz_file, static void QueueDbgMsg ( intf_msg_t *p_msg, char *psz_file,
char *psz_function, int i_line, char *psz_function, int i_line,
char *psz_format, va_list ap ); char *psz_format, va_list ap );
...@@ -147,11 +147,11 @@ p_intf_msg_t intf_MsgCreate( void ) ...@@ -147,11 +147,11 @@ p_intf_msg_t intf_MsgCreate( void )
#endif #endif
#ifdef DEBUG_LOG #ifdef TRACE_LOG
/* Log file initialization - on failure, file pointer will be null, /* Log file initialization - on failure, file pointer will be null,
* and no log will be issued, but this is not considered as an * and no log will be issued, but this is not considered as an
* error */ * error */
p_msg->p_log_file = fopen( DEBUG_LOG, "w" ); p_msg->p_log_file = fopen( TRACE_LOG, "w" );
#endif #endif
} }
return( p_msg ); return( p_msg );
...@@ -168,7 +168,7 @@ void intf_MsgDestroy( void ) ...@@ -168,7 +168,7 @@ void intf_MsgDestroy( void )
{ {
intf_FlushMsg(); /* print all remaining messages */ intf_FlushMsg(); /* print all remaining messages */
#ifdef DEBUG_LOG #ifdef TRACE_LOG
/* Close log file if any */ /* Close log file if any */
if( p_main->p_msg->p_log_file != NULL ) if( p_main->p_msg->p_log_file != NULL )
{ {
...@@ -258,11 +258,11 @@ void intf_IntfMsg(char *psz_format, ...) ...@@ -258,11 +258,11 @@ void intf_IntfMsg(char *psz_format, ...)
* _intf_DbgMsg: print a debugging message (ok ?) * _intf_DbgMsg: print a debugging message (ok ?)
***************************************************************************** *****************************************************************************
* This function prints a debugging message. Compared to other intf_*Msg * This function prints a debugging message. Compared to other intf_*Msg
* functions, it is only defined if DEBUG is defined and require a file name, * functions, it is only defined if TRACE is defined and require a file name,
* a function name and a line number as additionnal debugging informations. It * a function name and a line number as additionnal debugging informations. It
* also prints a debugging header for each received line. * also prints a debugging header for each received line.
*****************************************************************************/ *****************************************************************************/
#ifdef DEBUG #ifdef TRACE
void _intf_DbgMsg( char *psz_file, char *psz_function, int i_line, void _intf_DbgMsg( char *psz_file, char *psz_function, int i_line,
char *psz_format, ...) char *psz_format, ...)
{ {
...@@ -335,7 +335,7 @@ void intf_WarnMsgImm( int i_level, char *psz_format, ... ) ...@@ -335,7 +335,7 @@ void intf_WarnMsgImm( int i_level, char *psz_format, ... )
* message immediately. It should only be called through the macro * message immediately. It should only be called through the macro
* intf_DbgMsgImm(). * intf_DbgMsgImm().
*****************************************************************************/ *****************************************************************************/
#ifdef DEBUG #ifdef TRACE
void _intf_DbgMsgImm( char *psz_file, char *psz_function, int i_line, void _intf_DbgMsgImm( char *psz_file, char *psz_function, int i_line,
char *psz_format, ...) char *psz_format, ...)
{ {
...@@ -461,7 +461,7 @@ static void QueueMsg( intf_msg_t *p_msg, int i_type, char *psz_format, va_list a ...@@ -461,7 +461,7 @@ static void QueueMsg( intf_msg_t *p_msg, int i_type, char *psz_format, va_list a
*/ */
p_msg_item->i_type = i_type; p_msg_item->i_type = i_type;
p_msg_item->psz_msg = psz_str; p_msg_item->psz_msg = psz_str;
#ifdef DEBUG #ifdef TRACE
p_msg_item->date = mdate(); p_msg_item->date = mdate();
#endif #endif
...@@ -477,9 +477,9 @@ static void QueueMsg( intf_msg_t *p_msg, int i_type, char *psz_format, va_list a ...@@ -477,9 +477,9 @@ static void QueueMsg( intf_msg_t *p_msg, int i_type, char *psz_format, va_list a
* QueueDbgMsg: add a message to a queue with debugging informations * QueueDbgMsg: add a message to a queue with debugging informations
***************************************************************************** *****************************************************************************
* This function is the same as QueueMsg, except that it is only defined when * This function is the same as QueueMsg, except that it is only defined when
* DEBUG is define, and require additionnal debugging informations. * TRACE is define, and require additionnal debugging informations.
*****************************************************************************/ *****************************************************************************/
#ifdef DEBUG #ifdef TRACE
static void QueueDbgMsg(intf_msg_t *p_msg, char *psz_file, char *psz_function, static void QueueDbgMsg(intf_msg_t *p_msg, char *psz_file, char *psz_function,
int i_line, char *psz_format, va_list ap) int i_line, char *psz_format, va_list ap)
{ {
...@@ -566,11 +566,11 @@ static void FlushLockedMsg ( intf_msg_t *p_msg ) ...@@ -566,11 +566,11 @@ static void FlushLockedMsg ( intf_msg_t *p_msg )
* PrintMsg: print a message (ok ?) * PrintMsg: print a message (ok ?)
***************************************************************************** *****************************************************************************
* Print a single message. The message data is not freed. This function exists * Print a single message. The message data is not freed. This function exists
* in two version. The DEBUG version prints a date with each message, and is * in two version. The TRACE version prints a date with each message, and is
* able to log messages (if DEBUG_LOG is defined). * able to log messages (if TRACE_LOG is defined).
* The normal one just prints messages to the screen. * The normal one just prints messages to the screen.
*****************************************************************************/ *****************************************************************************/
#ifdef DEBUG #ifdef TRACE
static void PrintMsg( intf_msg_item_t *p_msg ) static void PrintMsg( intf_msg_item_t *p_msg )
{ {
...@@ -626,7 +626,7 @@ static void PrintMsg( intf_msg_item_t *p_msg ) ...@@ -626,7 +626,7 @@ static void PrintMsg( intf_msg_item_t *p_msg )
break; break;
case INTF_MSG_ERR: /* error messages */ case INTF_MSG_ERR: /* error messages */
case INTF_MSG_WARN: case INTF_MSG_WARN:
#ifndef DEBUG_LOG_ONLY #ifndef TRACE_LOG_ONLY
case INTF_MSG_DBG: /* debugging messages */ case INTF_MSG_DBG: /* debugging messages */
#endif #endif
fprintf( stderr, "%s\n", psz_msg ); fprintf( stderr, "%s\n", psz_msg );
...@@ -636,7 +636,7 @@ static void PrintMsg( intf_msg_item_t *p_msg ) ...@@ -636,7 +636,7 @@ static void PrintMsg( intf_msg_item_t *p_msg )
break; break;
} }
#ifdef DEBUG_LOG #ifdef TRACE_LOG
/* Append all messages to log file */ /* Append all messages to log file */
if( p_main->p_msg->p_log_file != NULL ) if( p_main->p_msg->p_log_file != NULL )
{ {
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
* can be anything, including pictures, audio streams, and so on. * can be anything, including pictures, audio streams, and so on.
***************************************************************************** *****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN * Copyright (C) 1999, 2000 VideoLAN
* $Id: rsc_files.c,v 1.9 2001/03/21 13:42:34 sam Exp $ * $Id: rsc_files.c,v 1.10 2001/04/27 19:29:11 massiot Exp $
* *
* Authors: Vincent Seguin <seguin@via.ecp.fr> * Authors: Vincent Seguin <seguin@via.ecp.fr>
* *
...@@ -204,13 +204,11 @@ int UpdateResourceFile( resource_file_t *p_file ) ...@@ -204,13 +204,11 @@ int UpdateResourceFile( resource_file_t *p_file )
byte_t p_buffer[50]; /* buffer */ byte_t p_buffer[50]; /* buffer */
int i_index; /* resource index */ int i_index; /* resource index */
#ifdef DEBUG
if( p_file->b_read_only ) if( p_file->b_read_only )
{ {
intf_DbgMsg("rsc debug 103-1: can't update a read-only file"); intf_ErrMsg("rsc debug 103-1: can't update a read-only file");
return( -1 ); return( -1 );
} }
#endif
/* Seek beginning of file */ /* Seek beginning of file */
if( lseek( p_file->i_file, 0, SEEK_SET ) ) if( lseek( p_file->i_file, 0, SEEK_SET ) )
...@@ -375,13 +373,11 @@ int vlc_WriteResource( resource_file_t *p_file, char *psz_name, int i_type, ...@@ -375,13 +373,11 @@ int vlc_WriteResource( resource_file_t *p_file, char *psz_name, int i_type,
int i_tmp_index; /* temporary resource index */ int i_tmp_index; /* temporary resource index */
u64 i_offset; /* offset */ u64 i_offset; /* offset */
#ifdef DEBUG
if( p_file->b_read_only ) if( p_file->b_read_only )
{ {
intf_DbgMsg("rsc debug 107-1: can not write to a read-only resource file"); intf_ErrMsg("rsc debug 107-1: can not write to a read-only resource file");
return( -1 ); return( -1 );
} }
#endif
/* Look for an empty place in the resources table */ /* Look for an empty place in the resources table */
i_index = -1; i_index = -1;
......
This diff is collapsed.
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* video_text.c : text manipulation functions * video_text.c : text manipulation functions
***************************************************************************** *****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN * Copyright (C) 1999, 2000 VideoLAN
* $Id: video_text.c,v 1.24 2001/04/25 09:31:14 sam Exp $ * $Id: video_text.c,v 1.25 2001/04/27 19:29:11 massiot 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>
...@@ -415,7 +415,7 @@ void vout_TextSize( vout_font_t *p_font, int i_style, const char *psz_text, int ...@@ -415,7 +415,7 @@ void vout_TextSize( vout_font_t *p_font, int i_style, const char *psz_text, int
break; break;
#ifdef DEBUG #ifdef DEBUG
default: default:
intf_DbgMsg("error: unknown font type %d", p_font->i_type ); intf_ErrMsg("error: unknown font type %d", p_font->i_type );
break; break;
#endif #endif
} }
...@@ -530,7 +530,7 @@ void vout_Print( vout_font_t *p_font, byte_t *p_pic, int i_bytes_per_pixel, int ...@@ -530,7 +530,7 @@ void vout_Print( vout_font_t *p_font, byte_t *p_pic, int i_bytes_per_pixel, int
break; break;
#ifdef DEBUG #ifdef DEBUG
default: default:
intf_DbgMsg("error: unknown font type %d", p_font->i_type ); intf_ErrMsg("error: unknown font type %d", p_font->i_type );
break; break;
#endif #endif
} }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* vpar_synchro.c : frame dropping routines * vpar_synchro.c : frame dropping routines
***************************************************************************** *****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN * Copyright (C) 1999, 2000 VideoLAN
* $Id: vpar_synchro.c,v 1.87 2001/04/06 09:15:48 sam Exp $ * $Id: vpar_synchro.c,v 1.88 2001/04/27 19:29:11 massiot 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>
...@@ -224,7 +224,7 @@ boolean_t vpar_SynchroChoose( vpar_thread_t * p_vpar, int i_coding_type, ...@@ -224,7 +224,7 @@ boolean_t vpar_SynchroChoose( vpar_thread_t * p_vpar, int i_coding_type,
mtime_t now, period, tau_yuv; mtime_t now, period, tau_yuv;
mtime_t pts = 0; mtime_t pts = 0;
boolean_t b_decode = 0; boolean_t b_decode = 0;
#ifdef DEBUG_VPAR #ifdef TRACE_VPAR
char p_date[MSTRTIME_MAX_SIZE]; char p_date[MSTRTIME_MAX_SIZE];
#endif #endif
...@@ -321,7 +321,7 @@ boolean_t vpar_SynchroChoose( vpar_thread_t * p_vpar, int i_coding_type, ...@@ -321,7 +321,7 @@ boolean_t vpar_SynchroChoose( vpar_thread_t * p_vpar, int i_coding_type,
#ifdef VDEC_SMP #ifdef VDEC_SMP
vlc_mutex_unlock( &p_vpar->synchro.fifo_lock ); vlc_mutex_unlock( &p_vpar->synchro.fifo_lock );
#endif #endif
#ifdef DEBUG_VPAR #ifdef TRACE_VPAR
intf_DbgMsg("vpar synchro debug: %s picture scheduled for %s, %s (%lld)", intf_DbgMsg("vpar synchro debug: %s picture scheduled for %s, %s (%lld)",
i_coding_type == B_CODING_TYPE ? "B" : i_coding_type == B_CODING_TYPE ? "B" :
(i_coding_type == P_CODING_TYPE ? "P" : "I"), (i_coding_type == P_CODING_TYPE ? "P" : "I"),
...@@ -414,7 +414,7 @@ void vpar_SynchroEnd( vpar_thread_t * p_vpar, int i_garbage ) ...@@ -414,7 +414,7 @@ void vpar_SynchroEnd( vpar_thread_t * p_vpar, int i_garbage )
} }
} }
#ifdef DEBUG_VPAR #ifdef TRACE_VPAR
intf_DbgMsg("vpar synchro debug: finished decoding %s (%lld)", intf_DbgMsg("vpar synchro debug: finished decoding %s (%lld)",
i_coding_type == B_CODING_TYPE ? "B" : i_coding_type == B_CODING_TYPE ? "B" :
(i_coding_type == P_CODING_TYPE ? "P" : "I"), tau); (i_coding_type == P_CODING_TYPE ? "P" : "I"), tau);
......
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