Use MSTRTIME_MAX_SIZE instead.
* This header provides structures to read the stream descriptors and
* control the pace of reading.
*****************************************************************************
* This header provides structures to read the stream descriptors and
* control the pace of reading.
*****************************************************************************
- * Copyright (C) 1999, 2000 VideoLAN
- * $Id: input_ext-intf.h,v 1.101 2003/11/29 18:36:13 massiot Exp $
+ * Copyright (C) 1999, 2000, 2003 VideoLAN
+ * $Id: input_ext-intf.h,v 1.102 2003/12/03 13:27:51 rocky Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
#define REQUESTED_DTS 4
#define REQUESTED_NOAUDIO 255
#define REQUESTED_DTS 4
#define REQUESTED_NOAUDIO 255
-#define OFFSETTOTIME_MAX_SIZE 10
-
/*****************************************************************************
* es_descriptor_t: elementary stream descriptor
*****************************************************************************
/*****************************************************************************
* es_descriptor_t: elementary stream descriptor
*****************************************************************************
/*****************************************************************************
* display.c: Gtk+ tools for main interface
*****************************************************************************
/*****************************************************************************
* display.c: Gtk+ tools for main interface
*****************************************************************************
- * Copyright (C) 1999, 2000 VideoLAN
- * $Id: display.c,v 1.11 2003/08/03 23:11:21 gbazin Exp $
+ * Copyright (C) 1999, 2000, 2003 VideoLAN
+ * $Id: display.c,v 1.12 2003/12/03 13:27:51 rocky Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
* Stéphane Borel <stef@via.ecp.fr>
*
* Authors: Samuel Hocevar <sam@zoy.org>
* Stéphane Borel <stef@via.ecp.fr>
if( p_intf->p_sys->p_input )
{
#define p_area p_intf->p_sys->p_input->stream.p_selected_area
if( p_intf->p_sys->p_input )
{
#define p_area p_intf->p_sys->p_input->stream.p_selected_area
- char psz_time[ OFFSETTOTIME_MAX_SIZE ];
+ char psz_time[ MSTRTIME_MAX_SIZE ];
gtk_frame_set_label( GTK_FRAME( p_intf->p_sys->p_slider_frame ),
input_OffsetToTime( p_intf->p_sys->p_input, psz_time,
gtk_frame_set_label( GTK_FRAME( p_intf->p_sys->p_slider_frame ),
input_OffsetToTime( p_intf->p_sys->p_input, psz_time,
* timer.cpp : wxWindows plugin for vlc
*****************************************************************************
* Copyright (C) 2000-2003 VideoLAN
* timer.cpp : wxWindows plugin for vlc
*****************************************************************************
* Copyright (C) 2000-2003 VideoLAN
- * $Id: timer.cpp,v 1.35 2003/11/23 22:29:27 ipkiss Exp $
+ * $Id: timer.cpp,v 1.36 2003/12/03 13:27:51 rocky Exp $
*
* Authors: Gildas Bazin <gbazin@netcourrier.com>
*
*
* Authors: Gildas Bazin <gbazin@netcourrier.com>
*
if( p_intf->p_sys->b_slider_free )
{
vlc_value_t pos;
if( p_intf->p_sys->b_slider_free )
{
vlc_value_t pos;
- char psz_time[ OFFSETTOTIME_MAX_SIZE ];
+ char psz_time[ MSTRTIME_MAX_SIZE ];
vlc_value_t time;
mtime_t i_seconds;
vlc_value_t time;
mtime_t i_seconds;
var_Get( p_intf->p_sys->p_input, "time", &time );
i_seconds = time.i_time / 1000000;
var_Get( p_intf->p_sys->p_input, "time", &time );
i_seconds = time.i_time / 1000000;
- snprintf( psz_time, OFFSETTOTIME_MAX_SIZE,
- "%d:%02d:%02d",
- (int) (i_seconds / (60 * 60)),
- (int) (i_seconds / 60 % 60),
- (int) (i_seconds % 60) );
+ secstotimestr ( psz_time, i_seconds );
p_main_interface->slider_box->SetLabel( wxU(psz_time) );
}
p_main_interface->slider_box->SetLabel( wxU(psz_time) );
}
/*****************************************************************************
* input_ext-intf.c: services to the interface
*****************************************************************************
/*****************************************************************************
* input_ext-intf.c: services to the interface
*****************************************************************************
- * Copyright (C) 1998-2001 VideoLAN
- * $Id: input_ext-intf.c,v 1.52 2003/11/24 00:39:02 fenrir Exp $
+ * Copyright (C) 1998-2001,2003 VideoLAN
+ * $Id: input_ext-intf.c,v 1.53 2003/12/03 13:27:51 rocky Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
{
input_thread_t *p_input;
{
input_thread_t *p_input;
- char psz_time1[OFFSETTOTIME_MAX_SIZE];
- char psz_time2[OFFSETTOTIME_MAX_SIZE];
+ char psz_time1[MSTRTIME_MAX_SIZE];
+ char psz_time2[MSTRTIME_MAX_SIZE];
p_input = vlc_object_find( p_this, VLC_OBJECT_INPUT, FIND_PARENT );
p_input = vlc_object_find( p_this, VLC_OBJECT_INPUT, FIND_PARENT );
if( p_input->stream.i_mux_rate )
{
i_seconds = i_offset / 50 / p_input->stream.i_mux_rate;
if( p_input->stream.i_mux_rate )
{
i_seconds = i_offset / 50 / p_input->stream.i_mux_rate;
- snprintf( psz_buffer, OFFSETTOTIME_MAX_SIZE, "%d:%02d:%02d",
- (int) (i_seconds / (60 * 60)),
- (int) (i_seconds / 60 % 60),
- (int) (i_seconds % 60) );
- return( psz_buffer );
+ return secstotimestr( psz_buffer, i_seconds );
*****************************************************************************/
void input_DumpStream( input_thread_t * p_input )
{
*****************************************************************************/
void input_DumpStream( input_thread_t * p_input )
{
- char psz_time1[OFFSETTOTIME_MAX_SIZE];
- char psz_time2[OFFSETTOTIME_MAX_SIZE];
+ char psz_time1[MSTRTIME_MAX_SIZE];
+ char psz_time2[MSTRTIME_MAX_SIZE];
unsigned int i, j;
#define S p_input->stream
unsigned int i, j;
#define S p_input->stream
/*****************************************************************************
/*****************************************************************************
- * mtime.c: high rezolution time management functions
+ * mtime.c: high resolution time management functions
* Functions are prototyped in mtime.h.
*****************************************************************************
* Functions are prototyped in mtime.h.
*****************************************************************************
- * Copyright (C) 1998-2001 VideoLAN
- * $Id: mtime.c,v 1.37 2003/12/02 01:54:30 rocky Exp $
+ * Copyright (C) 1998-2001, 2003 VideoLAN
+ * $Id: mtime.c,v 1.38 2003/12/03 13:27:51 rocky Exp $
*
* Authors: Vincent Seguin <seguin@via.ecp.fr>
*
*
* Authors: Vincent Seguin <seguin@via.ecp.fr>
*
* \param psz_buffer should be a buffer at least MSTRTIME_MAX_SIZE characters
* \return psz_buffer is returned so this can be used as printf parameter.
*/
* \param psz_buffer should be a buffer at least MSTRTIME_MAX_SIZE characters
* \return psz_buffer is returned so this can be used as printf parameter.
*/
-char *secstotimestr( char *psz_buffer, int secs )
+char *secstotimestr( char *psz_buffer, int i_seconds )
{
snprintf( psz_buffer, MSTRTIME_MAX_SIZE, "%d:%2.2d:%2.2d",
{
snprintf( psz_buffer, MSTRTIME_MAX_SIZE, "%d:%2.2d:%2.2d",
- (int) (secs / 3600), (int)(( secs % 3600 ) / 60),
- (int)(secs % 60) );
+ (int) (i_seconds / (60 *60)),
+ (int) ((i_seconds / 60) % 60),
+ (int) (i_seconds % 60) );