Commit d532cf3c authored by Gildas Bazin's avatar Gildas Bazin

* ALL: using "%ll" in printf format strings is not portable (notably on win32) so
   we now use the I64Fx familly of macros to print 64 bits numbers (x being
   replaced by d,i,o,u,x or X).
   eg: msg_Dbg( p_this, "sample is "I64Fi" late", ll_time );

* src/misc/messages.c: got rid of ConvertPrintfFormatString().
parent f01f0a38
......@@ -3,7 +3,7 @@
* Collection of useful common types and macros definitions
*****************************************************************************
* Copyright (C) 1998, 1999, 2000 VideoLAN
* $Id: vlc_common.h,v 1.34 2002/11/07 22:56:08 sam Exp $
* $Id: vlc_common.h,v 1.35 2002/11/08 10:26:52 gbazin Exp $
*
* Authors: Samuel Hocevar <sam@via.ecp.fr>
* Vincent Seguin <seguin@via.ecp.fr>
......@@ -472,8 +472,29 @@ static inline uint64_t U64_AT( void * _p )
char * strndup( const char *s, size_t n );
#endif
#define I64C(x) x##LL
/* Format type specifiers for 64 bits numbers */
#if !defined(WIN32)
# define I64Fd "%lld"
# define I64Fi "%lli"
# define I64Fo "%llo"
# define I64Fu "%llu"
# define I64Fx "%llx"
# define I64FX "%llX"
#else
# define I64Fd "%I64d"
# define I64Fi "%I64i"
# define I64Fo "%I64o"
# define I64Fu "%I64u"
# define I64Fx "%I64x"
# define I64FX "%I64X"
#endif /* defined(WIN32) */
/* 64 bits integer constant suffix */
#if !defined(WIN32)
# define I64C(x) x##LL
#else
# define I64C(x) x##i64
#endif /* defined(WIN32) */
#ifdef WIN32
/* win32, cl and icl support */
......@@ -487,8 +508,6 @@ char * strndup( const char *s, size_t n );
# define S_ISCHR(m) (0)
# define S_ISFIFO(m) (((m)&_S_IFMT) == _S_IFIFO)
# define S_ISREG(m) (((m)&_S_IFMT) == _S_IFREG)
# undef I64C
# define I64C(x) x##i64
# endif
/* several type definitions */
......
......@@ -8,7 +8,7 @@
* -udf.* to find files
*****************************************************************************
* Copyright (C) 1998-2001 VideoLAN
* $Id: access.c,v 1.3 2002/10/26 15:24:19 gbazin Exp $
* $Id: access.c,v 1.4 2002/11/08 10:26:52 gbazin Exp $
*
* Author: Stphane Borel <stef@via.ecp.fr>
*
......@@ -628,7 +628,7 @@ static void DVDSeek( input_thread_t * p_input, off_t i_off )
p_input->stream.p_selected_area->i_tell = DVDTell;
vlc_mutex_unlock( &p_input->stream.stream_lock );
msg_Dbg( p_input, "program cell: %d cell: %d chapter: %d tell %lld",
msg_Dbg( p_input, "program cell: %d cell: %d chapter: %d tell "I64Fd,
p_dvd->i_prg_cell, p_dvd->i_map_cell, p_dvd->i_chapter, DVDTell );
return;
......
......@@ -2,7 +2,7 @@
* ifo.c: Functions for ifo parsing
*****************************************************************************
* Copyright (C) 1999-2001 VideoLAN
* $Id: ifo.c,v 1.2 2002/08/08 00:35:10 sam Exp $
* $Id: ifo.c,v 1.3 2002/11/08 10:26:52 gbazin Exp $
*
* Authors: Stphane Borel <stef@via.ecp.fr>
* German Tischler <tanis@gaspode.franken.de>
......@@ -529,7 +529,7 @@ int IfoTitleSet( ifo_t * p_ifo, int i_title )
for( i = 0 ; i < 8 ; i++ )
{
i_temp = ReadQuad( p_ifo, p_buf, &p_tmp );
/*fprintf( stderr, "Audio %d: %llx\n", i, i_temp ); */
/*fprintf( stderr, "Audio %d: "I64Fx"\n", i, i_temp ); */
i_temp >>= 8;
MGINF.p_audio_attr[i].i_bar = i_temp & 0xff;
i_temp >>= 8;
......@@ -564,7 +564,7 @@ int IfoTitleSet( ifo_t * p_ifo, int i_title )
{
ReadBytes( p_ifo, p_buf, &p_tmp, (u8*)(&i_temp), 6 );
i_temp = hton64( i_temp ) >> 16;
/*fprintf( stderr, "Subpic %d: %llx\n", i, i_temp ); */
/*fprintf( stderr, "Subpic %d: "I64Fx"\n", i, i_temp ); */
MGINF.p_spu_attr[i].i_caption = i_temp & 0xff;
i_temp >>= 8;
MGINF.p_spu_attr[i].i_foo = i_temp & 0xff;
......
......@@ -2,7 +2,7 @@
* intf.c: interface for DVD video manager
*****************************************************************************
* Copyright (C) 2002 VideoLAN
* $Id: intf.c,v 1.3 2002/11/06 18:07:57 sam Exp $
* $Id: intf.c,v 1.4 2002/11/08 10:26:52 gbazin Exp $
*
* Authors: Stphane Borel <stef@via.ecp.fr>
*
......@@ -330,7 +330,7 @@ int dvdIntfStillTime( intf_thread_t *p_intf, int i_sec )
if( i_sec == 0xff )
{
p_intf->p_sys->m_still_time = (mtime_t)(-1);
msg_Warn( p_intf, "%lld", p_intf->p_sys->m_still_time );
msg_Warn( p_intf, I64Fd, p_intf->p_sys->m_still_time );
}
else
{
......
......@@ -6,7 +6,7 @@
* It depends on: libdvdread for ifo files and block reading.
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* $Id: input.c,v 1.7 2002/11/05 18:25:43 gbazin Exp $
* $Id: input.c,v 1.8 2002/11/08 10:26:52 gbazin Exp $
*
* Author: Stphane Borel <stef@via.ecp.fr>
*
......@@ -555,7 +555,7 @@ static int DvdReadSetArea( input_thread_t * p_input, input_area_t * p_area )
p_dvd->i_end_block = p_pgc->cell_playback[ i_cell ].last_sector;
p_area->i_size = LB2OFF( p_dvd->i_end_block )- p_area->i_start;
msg_Dbg( p_input, "start %lld size %lld end %d",
msg_Dbg( p_input, "start "I64Fd" size "I64Fd" end %d",
p_area->i_start , p_area->i_size, p_dvd->i_end_block );
/*
......
......@@ -2,7 +2,7 @@
* http.c: HTTP access plug-in
*****************************************************************************
* Copyright (C) 2001, 2002 VideoLAN
* $Id: http.c,v 1.6 2002/11/07 16:54:39 gbazin Exp $
* $Id: http.c,v 1.7 2002/11/08 10:26:52 gbazin Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
......@@ -118,7 +118,7 @@ static int HTTPConnect( input_thread_t * p_input, off_t i_tell )
{
snprintf( psz_buffer, sizeof(psz_buffer),
"%s"
"Range: bytes=%lld-\r\n"
"Range: bytes="I64Fd"-\r\n"
HTTP_USERAGENT HTTP_END,
p_access_data->psz_buffer, i_tell );
}
......@@ -506,7 +506,7 @@ static void Seek( input_thread_t * p_input, off_t i_pos )
{
_input_socket_t *p_access_data = (_input_socket_t*)p_input->p_access_data;
close( p_access_data->_socket.i_handle );
msg_Dbg( p_input, "seeking to position %lld", i_pos );
msg_Dbg( p_input, "seeking to position "I64Fd, i_pos );
HTTPConnect( p_input, i_pos );
}
......@@ -2,7 +2,7 @@
* arts.c : aRts module
*****************************************************************************
* Copyright (C) 2001-2002 VideoLAN
* $Id: arts.c,v 1.14 2002/10/20 12:23:47 massiot Exp $
* $Id: arts.c,v 1.15 2002/11/08 10:26:53 gbazin Exp $
*
* Authors: Emmanuel Blindauer <manu@agat.net>
* Samuel Hocevar <sam@zoy.org>
......@@ -201,7 +201,7 @@ fprintf(stderr, "after sleep: can write %i\n", arts_stream_get( p_sys->stream, A
if ( p_buffer != NULL )
{
fprintf(stderr, "buffer duration %lld, bytes %i\n", p_buffer->end_date - p_buffer->start_date, p_buffer->i_nb_bytes);
fprintf(stderr, "buffer duration "I64Fd", bytes %i\n", p_buffer->end_date - p_buffer->start_date, p_buffer->i_nb_bytes);
p_bytes = p_buffer->p_buffer;
i_size = p_buffer->i_nb_bytes;
}
......@@ -214,7 +214,7 @@ fprintf(stderr, "buffer duration %lld, bytes %i\n", p_buffer->end_date - p_buffe
fprintf(stderr, "WRITING %i bytes\n", i_size);
i_tmp = arts_write( p_sys->stream, p_bytes, i_size );
fprintf(stderr, "mdate: %lld\n", mdate() - calldate);
fprintf(stderr, "mdate: "I64Fd"\n", mdate() - calldate);
calldate = mdate();
fprintf(stderr, "can write %i\n", arts_stream_get( p_sys->stream, ARTS_P_BUFFER_SPACE ) );
......
......@@ -2,7 +2,7 @@
* vpar_synchro.c : frame dropping routines
*****************************************************************************
* Copyright (C) 1999-2001 VideoLAN
* $Id: synchro.c,v 1.3 2002/10/20 12:23:47 massiot Exp $
* $Id: synchro.c,v 1.4 2002/11/08 10:26:53 gbazin Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
* Samuel Hocevar <sam@via.ecp.fr>
......@@ -241,7 +241,7 @@ vlc_bool_t vpar_SynchroChoose( vpar_thread_t * p_vpar, int i_coding_type,
}
if( !b_decode )
msg_Warn( p_vpar->p_fifo,
"synchro trashing I (%lld)", pts - now );
"synchro trashing I ("I64Fd")", pts - now );
break;
case P_CODING_TYPE:
......@@ -386,7 +386,8 @@ void vpar_SynchroNewPicture( vpar_thread_t * p_vpar, int i_coding_type,
if( p_vpar->synchro.i_type == VPAR_SYNCHRO_DEFAULT )
{
msg_Dbg( p_vpar->p_fifo, "I(%lld) P(%lld)[%d] B(%lld)[%d] YUV(%lld) : trashed %d:%d/%d",
msg_Dbg( p_vpar->p_fifo, "I("I64Fd") P("I64Fd")[%d] B("I64Fd")"
"[%d] YUV("I64Fd") : trashed %d:%d/%d",
p_vpar->synchro.p_tau[I_CODING_TYPE],
p_vpar->synchro.p_tau[P_CODING_TYPE],
p_vpar->synchro.i_n_p,
......@@ -437,8 +438,8 @@ void vpar_SynchroNewPicture( vpar_thread_t * p_vpar, int i_coding_type,
|| p_vpar->synchro.current_pts - p_vpar->sequence.next_pts
> PTS_THRESHOLD )
{
msg_Warn( p_vpar->p_fifo,
"vpar synchro warning: pts != current_date (%lld)",
msg_Warn( p_vpar->p_fifo, "vpar synchro warning: pts != "
"current_date ("I64Fd")",
p_vpar->synchro.current_pts
- p_vpar->sequence.next_pts );
}
......@@ -459,7 +460,7 @@ void vpar_SynchroNewPicture( vpar_thread_t * p_vpar, int i_coding_type,
|| p_vpar->synchro.backward_pts - p_vpar->sequence.next_dts
> PTS_THRESHOLD) )
{
msg_Warn( p_vpar->p_fifo, "backward_pts != dts (%lld)",
msg_Warn( p_vpar->p_fifo, "backward_pts != dts ("I64Fd")",
p_vpar->sequence.next_dts
- p_vpar->synchro.backward_pts );
}
......@@ -469,7 +470,7 @@ void vpar_SynchroNewPicture( vpar_thread_t * p_vpar, int i_coding_type,
> PTS_THRESHOLD )
{
msg_Warn( p_vpar->p_fifo,
"backward_pts != current_pts (%lld)",
"backward_pts != current_pts ("I64Fd")",
p_vpar->synchro.current_pts
- p_vpar->synchro.backward_pts );
}
......@@ -483,7 +484,7 @@ void vpar_SynchroNewPicture( vpar_thread_t * p_vpar, int i_coding_type,
|| p_vpar->synchro.current_pts - p_vpar->sequence.next_dts
> PTS_THRESHOLD )
{
msg_Warn( p_vpar->p_fifo, "dts != current_pts (%lld)",
msg_Warn( p_vpar->p_fifo, "dts != current_pts ("I64Fd")",
p_vpar->synchro.current_pts
- p_vpar->sequence.next_dts );
}
......@@ -507,7 +508,7 @@ void vpar_SynchroNewPicture( vpar_thread_t * p_vpar, int i_coding_type,
{
/* We cannot be _that_ late, something must have happened, reinit
* the dates. */
msg_Warn( p_vpar->p_fifo, "PTS << now (%lld), resetting",
msg_Warn( p_vpar->p_fifo, "PTS << now ("I64Fd"), resetting",
now - p_vpar->synchro.current_pts - DEFAULT_PTS_DELAY );
p_vpar->synchro.current_pts = now + DEFAULT_PTS_DELAY;
}
......
......@@ -2,7 +2,7 @@
* libasf.c :
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* $Id: libasf.c,v 1.3 2002/10/26 19:14:45 fenrir Exp $
* $Id: libasf.c,v 1.4 2002/11/08 10:26:53 gbazin Exp $
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
*
* This program is free software; you can redistribute it and/or modify
......@@ -178,7 +178,7 @@ int ASF_ReadObjectCommon( input_thread_t *p_input,
p_common->p_next = NULL;
#ifdef ASF_DEBUG
msg_Dbg(p_input,
"Found Object guid: " GUID_FMT " size:%lld",
"Found Object guid: " GUID_FMT " size:"I64Fd,
GUID_PRINT( p_common->i_object_id ),
p_common->i_object_size );
#endif
......@@ -293,7 +293,8 @@ int ASF_ReadObject_Data( input_thread_t *p_input,
p_data->i_reserved = GetWLE( p_peek + 48 );
#ifdef ASF_DEBUG
msg_Dbg( p_input,
"Read \"Data Object\" file_id:" GUID_FMT " total data packet:%lld reserved:%d",
"Read \"Data Object\" file_id:" GUID_FMT " total data packet:"
I64Fd" reserved:%d",
GUID_PRINT( p_data->i_file_id ),
p_data->i_total_data_packets,
p_data->i_reserved );
......@@ -320,7 +321,9 @@ int ASF_ReadObject_Index( input_thread_t *p_input,
#ifdef ASF_DEBUG
msg_Dbg( p_input,
"Read \"Index Object\" file_id:" GUID_FMT " index_entry_time_interval:%lld max_packet_count:%d index_entry_count:%d",
"Read \"Index Object\" file_id:" GUID_FMT
" index_entry_time_interval:"I64Fd" max_packet_count:%d "
"index_entry_count:%d",
GUID_PRINT( p_index->i_file_id ),
p_index->i_max_packet_count,
p_index->i_index_entry_count );
......@@ -360,7 +363,11 @@ int ASF_ReadObject_file_properties( input_thread_t *p_input,
#ifdef ASF_DEBUG
msg_Dbg( p_input,
"Read \"File Properties Object\" file_id:" GUID_FMT " file_size:%lld creation_date:%lld data_packets_count:%lld play_duration:%lld send_duration:%lld preroll:%lld flags:%d min_data_packet_size:%d max_data_packet_size:%d max_bitrate:%d",
"Read \"File Properties Object\" file_id:" GUID_FMT
" file_size:"I64Fd" creation_date:"I64Fd" data_packets_count:"
I64Fd" play_duration:"I64Fd" send_duration:"I64Fd" preroll:"
I64Fd" flags:%d min_data_packet_size:%d max_data_packet_size:%d "
"max_bitrate:%d",
GUID_PRINT( p_fp->i_file_id ),
p_fp->i_file_size,
p_fp->i_creation_date,
......@@ -463,7 +470,10 @@ int ASF_ReadObject_stream_properties( input_thread_t *p_input,
#ifdef ASF_DEBUG
msg_Dbg( p_input,
"Read \"Stream Properties Object\" stream_type:" GUID_FMT " error_correction_type:" GUID_FMT " time_offset:%lld type_specific_data_length:%d error_correction_data_length:%d flags:0x%x stream_number:%d",
"Read \"Stream Properties Object\" stream_type:" GUID_FMT
" error_correction_type:" GUID_FMT " time_offset:"I64Fd
" type_specific_data_length:%d error_correction_data_length:%d"
" flags:0x%x stream_number:%d",
GUID_PRINT( p_sp->i_stream_type ),
GUID_PRINT( p_sp->i_error_correction_type ),
p_sp->i_time_offset,
......
......@@ -2,7 +2,7 @@
* avi.c : AVI file Stream input module for vlc
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* $Id: avi.c,v 1.10 2002/11/06 14:44:30 sam Exp $
* $Id: avi.c,v 1.11 2002/11/08 10:26:53 gbazin Exp $
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
*
* This program is free software; you can redistribute it and/or modify
......@@ -710,7 +710,7 @@ static mtime_t AVI_MovieGetLength( input_thread_t *p_input, demux_sys_t *p_avi
}
msg_Dbg( p_input,
"stream[%d] length:%lld (based on index)",
"stream[%d] length:"I64Fd" (based on index)",
i_stream,
i_length );
i_maxlength = __MAX( i_maxlength, i_length );
......@@ -1357,7 +1357,7 @@ static int AVI_StreamSeek( input_thread_t *p_input,
/* search key frame */
msg_Dbg( p_input,
"old:%lld %s new %lld",
"old:"I64Fd" %s new "I64Fd,
i_oldpts,
i_oldpts > i_date ? ">" : "<",
i_date );
......@@ -1416,7 +1416,7 @@ static int AVISeek ( input_thread_t *p_input,
demux_sys_t *p_avi = p_input->p_demux_data;
int i_stream;
msg_Dbg( p_input,
"seek requested: %lld secondes %d%%",
"seek requested: "I64Fd" secondes %d%%",
i_date / 1000000,
i_percent );
......@@ -1481,7 +1481,7 @@ static int AVISeek ( input_thread_t *p_input,
}
i_date = AVI_GetPTS( p_stream );
/* TODO better support for i_samplesize != 0 */
msg_Dbg( p_input, "estimate date %lld", i_date );
msg_Dbg( p_input, "estimate date "I64Fd, i_date );
}
#define p_stream p_avi->pp_info[i_stream]
......@@ -1511,7 +1511,7 @@ static int AVISeek ( input_thread_t *p_input,
// p_avi->i_time = __MAX( AVI_GetPTS( p_stream ), p_avi->i_time );
}
}
msg_Dbg( p_input, "seek: %lld secondes", p_avi->i_time /1000000 );
msg_Dbg( p_input, "seek: "I64Fd" secondes", p_avi->i_time /1000000 );
/* set true movie time */
#endif
if( !p_avi->i_time )
......
......@@ -2,7 +2,7 @@
* libavi.c :
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* $Id: libavi.c,v 1.6 2002/11/06 14:44:30 sam Exp $
* $Id: libavi.c,v 1.7 2002/11/08 10:26:53 gbazin Exp $
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
*
* This program is free software; you can redistribute it and/or modify
......@@ -270,7 +270,7 @@ static int AVI_ChunkReadCommon( input_thread_t *p_input,
p_chk->common.p_next = NULL;
#ifdef AVI_DEBUG
msg_Dbg( p_input,
"Found Chunk fourcc:%c%c%c%c size:%lld pos:%lld",
"Found Chunk fourcc:%c%c%c%c size:"I64Fd" pos:"I64Fd,
AVIFOURCC_PRINT( p_chk->common.i_chunk_fourcc ),
p_chk->common.i_chunk_size,
p_chk->common.i_chunk_pos );
......@@ -971,7 +971,7 @@ static void AVI_ChunkDumpDebug_level( input_thread_t *p_input,
p_chk->common.i_chunk_fourcc == AVIFOURCC_LIST )
{
sprintf( str + i_level * 5,
"%c %c%c%c%c-%c%c%c%c size:%lld pos:%lld",
"%c %c%c%c%c-%c%c%c%c size:"I64Fu" pos:"I64Fu,
i_level ? '+' : '*',
AVIFOURCC_PRINT( p_chk->common.i_chunk_fourcc ),
AVIFOURCC_PRINT( p_chk->list.i_type ),
......@@ -981,7 +981,7 @@ static void AVI_ChunkDumpDebug_level( input_thread_t *p_input,
else
{
sprintf( str + i_level * 5,
"+ %c%c%c%c size:%lld pos:%lld",
"+ %c%c%c%c size:"I64Fu" pos:"I64Fu,
AVIFOURCC_PRINT( p_chk->common.i_chunk_fourcc ),
p_chk->common.i_chunk_size,
p_chk->common.i_chunk_pos );
......
......@@ -2,7 +2,7 @@
* input.c : internal management of input streams for the audio output
*****************************************************************************
* Copyright (C) 2002 VideoLAN
* $Id: input.c,v 1.17 2002/10/20 12:23:48 massiot Exp $
* $Id: input.c,v 1.18 2002/11/08 10:26:53 gbazin Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
......@@ -163,8 +163,8 @@ int aout_InputPlay( aout_instance_t * p_aout, aout_input_t * p_input,
/* The decoder is _very_ late. This can only happen if the user
* pauses the stream (or if the decoder is buggy, which cannot
* happen :). */
msg_Warn( p_aout, "computed PTS is out of range (%lld), clearing out",
mdate() - start_date );
msg_Warn( p_aout, "computed PTS is out of range ("I64Fd"), "
"clearing out", mdate() - start_date );
vlc_mutex_lock( &p_aout->input_fifos_lock );
aout_FifoSet( p_aout, &p_input->fifo, 0 );
vlc_mutex_unlock( &p_aout->input_fifos_lock );
......@@ -175,7 +175,7 @@ int aout_InputPlay( aout_instance_t * p_aout, aout_input_t * p_input,
{
/* The decoder gives us f*cked up PTS. It's its business, but we
* can't present it anyway, so drop the buffer. */
msg_Warn( p_aout, "PTS is out of range (%lld), dropping buffer",
msg_Warn( p_aout, "PTS is out of range ("I64Fd"), dropping buffer",
mdate() - p_buffer->start_date );
aout_BufferFree( p_buffer );
......@@ -202,7 +202,7 @@ int aout_InputPlay( aout_instance_t * p_aout, aout_input_t * p_input,
mtime_t old_duration;
mtime_t drift = p_buffer->start_date - start_date;
msg_Warn( p_aout, "buffer is %lld %s, resampling",
msg_Warn( p_aout, "buffer is "I64Fd" %s, resampling",
drift > 0 ? drift : -drift,
drift > 0 ? "in advance" : "late" );
old_duration = p_buffer->end_date - p_buffer->start_date;
......
......@@ -2,7 +2,7 @@
* mixer.c : audio output mixing operations
*****************************************************************************
* Copyright (C) 2002 VideoLAN
* $Id: mixer.c,v 1.18 2002/10/20 12:23:48 massiot Exp $
* $Id: mixer.c,v 1.19 2002/11/08 10:26:53 gbazin Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
......@@ -113,7 +113,7 @@ static int MixBuffer( aout_instance_t * p_aout )
/* The output is _very_ late. This can only happen if the user
* pauses the stream (or if the decoder is buggy, which cannot
* happen :). */
msg_Warn( p_aout, "output PTS is out of range (%lld), clearing out",
msg_Warn( p_aout, "output PTS is out of range ("I64Fd"), clearing out",
mdate() - start_date );
aout_FifoSet( p_aout, &p_aout->output.fifo, 0 );
aout_DateSet( &exact_start_date, 0 );
......@@ -138,8 +138,8 @@ static int MixBuffer( aout_instance_t * p_aout )
p_buffer = p_fifo->p_first;
while ( p_buffer != NULL && p_buffer->start_date < mdate() )
{
msg_Warn( p_aout, "input PTS is out of range (%lld), trashing",
mdate() - p_buffer->start_date );
msg_Warn( p_aout, "input PTS is out of range ("I64Fd"), "
"trashing", mdate() - p_buffer->start_date );
aout_BufferFree( aout_FifoPop( p_aout, p_fifo ) );
p_buffer = p_fifo->p_first;
}
......@@ -192,7 +192,7 @@ static int MixBuffer( aout_instance_t * p_aout )
while ( p_buffer != NULL && p_buffer->end_date < start_date )
{
aout_buffer_t * p_next = p_buffer->p_next;
msg_Err( p_aout, "the mixer got a packet in the past (%lld)",
msg_Err( p_aout, "the mixer got a packet in the past ("I64Fd")",
start_date - p_buffer->end_date );
aout_BufferFree( p_buffer );
p_fifo->p_first = p_buffer = p_next;
......@@ -255,7 +255,7 @@ static int MixBuffer( aout_instance_t * p_aout )
if ( prev_date != p_buffer->start_date )
{
msg_Warn( p_aout,
"buffer hole, dropping packets (%lld)",
"buffer hole, dropping packets ("I64Fd")",
p_buffer->start_date - prev_date );
b_drop_buffers = 1;
break;
......
......@@ -2,7 +2,7 @@
* output.c : internal management of output streams for the audio output
*****************************************************************************
* Copyright (C) 2002 VideoLAN
* $Id: output.c,v 1.21 2002/11/01 15:06:23 gbazin Exp $
* $Id: output.c,v 1.22 2002/11/08 10:26:53 gbazin Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
......@@ -183,8 +183,8 @@ aout_buffer_t * aout_OutputNextBuffer( aout_instance_t * p_aout,
p_buffer = p_aout->output.fifo.p_first;
while ( p_buffer && p_buffer->start_date < mdate() )
{
msg_Dbg( p_aout, "audio output is too slow (%lld), trashing %lldus",
mdate() - p_buffer->start_date,
msg_Dbg( p_aout, "audio output is too slow ("I64Fd"), "
"trashing "I64Fd"us", mdate() - p_buffer->start_date,
p_buffer->end_date - p_buffer->start_date );
p_buffer = p_buffer->p_next;
}
......@@ -217,8 +217,8 @@ aout_buffer_t * aout_OutputNextBuffer( aout_instance_t * p_aout,
{
vlc_mutex_unlock( &p_aout->output_fifo_lock );
if ( !p_aout->output.b_starving )
msg_Dbg( p_aout, "audio output is starving (%lld), playing silence",
p_buffer->start_date - start_date );
msg_Dbg( p_aout, "audio output is starving ("I64Fd"), "
"playing silence", p_buffer->start_date - start_date );
p_aout->output.b_starving = 1;
return NULL;
}
......@@ -232,7 +232,7 @@ aout_buffer_t * aout_OutputNextBuffer( aout_instance_t * p_aout,
/* Try to compensate the drift by doing some resampling. */
int i;
mtime_t difference = p_buffer->start_date - start_date;
msg_Warn( p_aout, "output date isn't PTS date, resampling (%lld)",
msg_Warn( p_aout, "output date isn't PTS date, resampling ("I64Fd")",
difference );
vlc_mutex_lock( &p_aout->input_fifos_lock );
......
......@@ -2,7 +2,7 @@
* input_ext-intf.c: services to the interface
*****************************************************************************
* Copyright (C) 1998-2001 VideoLAN
* $Id: input_ext-intf.c,v 1.40 2002/07/31 20:56:52 sam Exp $
* $Id: input_ext-intf.c,v 1.41 2002/11/08 10:26:53 gbazin Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
......@@ -194,7 +194,7 @@ void __input_Seek( vlc_object_t * p_this, off_t i_position, int i_whence )
A->i_seek = A->i_size;
}
msg_Dbg( p_input, "seeking position %lld/%lld (%s/%s)",
msg_Dbg( p_input, "seeking position "I64Fd"/"I64Fd" (%s/%s)",
A->i_seek, A->i_size,
input_OffsetToTime( p_input, psz_time1, i_position ),
input_OffsetToTime( p_input, psz_time2, A->i_size ) );
......@@ -281,7 +281,7 @@ void input_DumpStream( input_thread_t * p_input )
msg_Dbg( p_input, "dumping stream ID 0x%x [OK:%d/D:%d]", S.i_stream_id,
S.c_packets_read, S.c_packets_trashed );
if( S.b_seekable )
msg_Dbg( p_input, "seekable stream, position: %lld/%lld (%s/%s)",
msg_Dbg( p_input, "seekable stream, position: "I64Fd"/"I64Fd" (%s/%s)",
S.p_selected_area->i_tell, S.p_selected_area->i_size,
input_OffsetToTime( p_input, psz_time1,
S.p_selected_area->i_tell ),
......
......@@ -4,7 +4,7 @@
* modules, especially intf modules. See config.h for output configuration.
*****************************************************************************
* Copyright (C) 1998-2002 VideoLAN
* $Id: messages.c,v 1.19 2002/11/07 19:31:08 gbazin Exp $
* $Id: messages.c,v 1.20 2002/11/08 10:26:53 gbazin Exp $
*
* Authors: Vincent Seguin <seguin@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org>
......@@ -50,10 +50,6 @@ static void QueueMsg ( vlc_object_t *, int , const char *,
static void FlushMsg ( msg_bank_t * );
static void PrintMsg ( vlc_object_t *, msg_item_t * );
#if defined( WIN32 )
static char *ConvertPrintfFormatString ( const char *psz_format );
#endif
/*****************************************************************************
* msg_Create: initialize messages interface
*****************************************************************************
......@@ -236,9 +232,7 @@ static void QueueMsg( vlc_object_t *p_this, int i_type, const char *psz_module,
char * psz_str = NULL; /* formatted message string */
msg_item_t * p_item = NULL; /* pointer to message */
msg_item_t item; /* message in case of a full queue */
#ifdef WIN32
char * psz_temp;
#endif
#if !defined(HAVE_VASPRINTF) || defined(SYS_DARWIN)
int i_size = strlen(psz_format) + INTF_MAX_MSG_SIZE;
#endif
......@@ -262,18 +256,7 @@ static void QueueMsg( vlc_object_t *p_this, int i_type, const char *psz_module,
}
#if !defined(HAVE_VASPRINTF) || defined(SYS_DARWIN)
# ifdef WIN32
psz_temp = ConvertPrintfFormatString( psz_format );
if( !psz_temp )
{
fprintf( stderr, "main warning: couldn't print message\n" );
return;
}
vsnprintf( psz_str, i_size, psz_temp, args );
free( psz_temp );
# else
vsnprintf( psz_str, i_size, psz_format, args );
# endif
psz_str[ i_size - 1 ] = 0; /* Just in case */
#endif
......@@ -461,67 +444,7 @@ static void PrintMsg ( vlc_object_t * p_this, msg_item_t * p_item )
p_item->psz_msg );
}
#if defined(WIN32) && defined(DEBUG)
#if defined(WIN32)
fflush( stderr );
#endif
}
/*****************************************************************************
* ConvertPrintfFormatString: replace all occurrences of %ll with %I64 in the
* printf format string.
*****************************************************************************
* Win32 doesn't recognize the "%ll" format in a printf string, so we have
* to convert this string to something that win32 can handle.
* This is a REALLY UGLY HACK which won't even work in every situation,
* but hey I don't want to put an ifdef WIN32 each time I use printf with
* a "long long" type!!!
* By the way, if we don't do this we can sometimes end up with segfaults.
*****************************************************************************/
#if defined( WIN32 )
static char *ConvertPrintfFormatString( const char *psz_format )
{
int i, i_counter=0, i_pos=0;
char *psz_dest;
/* We first need to check how many occurences of %ll there are in the
* psz_format string. Once we'll know that we'll be able to malloc the
* destination string */
if( strlen( psz_format ) <= 3 )
return strdup( psz_format );
for( i=0; i <= (strlen(psz_format) - 3); i++ )
{
if( !strncmp( (char *)(psz_format + i), "%ll", 3 ) )
{
i_counter++;
}
}
/* malloc the destination string */
psz_dest = malloc( strlen(psz_format) + i_counter + 1 );
if( psz_dest == NULL )
{
fprintf( stderr, "main warning: ConvertPrintfFormatString failed\n" );
return NULL;
}
/* Now build the modified string */
i_counter = 0;
for( i=0; i <= (strlen(psz_format) - 3); i++ )
{
if( !strncmp( (char *)(psz_format + i), "%ll", 3 ) )
{
memcpy( psz_dest+i_pos+i_counter, psz_format+i_pos, i-i_pos+1);
*(psz_dest+i+i_counter+1)='I';
*(psz_dest+i+i_counter+2)='6';
*(psz_dest+i+i_counter+3)='4';
i_pos = i+3;
i_counter++;
}
}
strcpy( psz_dest+i_pos+i_counter, psz_format+i_pos );
return psz_dest;
}
#endif
......@@ -2,7 +2,7 @@
* win32_specific.c: Win32 specific features
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* $Id: win32_specific.c,v 1.17 2002/11/07 19:31:08 gbazin Exp $
* $Id: win32_specific.c,v 1.18 2002/11/08 10:26:53 gbazin Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
* Gildas Bazin <gbazin@netcourrier.com>
......@@ -71,6 +71,8 @@ void system_Configure( vlc_t *p_this )
else
msg_Dbg( p_this, "raised process priority" );
}
else
msg_Dbg( p_this, "raised process priority" );
}
/*****************************************************************************
......
......@@ -5,7 +5,7 @@
* thread, and destroy a previously oppened video output thread.
*****************************************************************************
* Copyright (C) 2000-2001 VideoLAN
* $Id: video_output.c,v 1.194 2002/11/02 11:53:17 gbazin Exp $
* $Id: video_output.c,v 1.195 2002/11/08 10:26:54 gbazin Exp $
*
* Authors: Vincent Seguin <seguin@via.ecp.fr>
*
......@@ -494,7 +494,7 @@ static void RunThread( vout_thread_t *p_vout)
p_picture->i_status = DESTROYED_PICTURE;
p_vout->i_heap_size--;
}
msg_Warn( p_vout, "late picture skipped (%lld)",
msg_Warn( p_vout, "late picture skipped ("I64Fd")",
current_date - display_date );
vlc_mutex_unlock( &p_vout->picture_lock );
......@@ -518,8 +518,8 @@ static void RunThread( vout_thread_t *p_vout)
p_picture->i_status = DESTROYED_PICTURE;
p_vout->i_heap_size--;
}
intf_WarnMsg( 1, "vout warning: early picture skipped (%lld)",
display_date - current_date );
intf_WarnMsg( 1, "vout warning: early picture skipped "
"("I64Fd")", display_date - current_date );
vlc_mutex_unlock( &p_vout->picture_lock );
continue;
......
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