Commit e96ffed1 authored by Gildas Bazin's avatar Gildas Bazin

* include/vlc/vlc.h, include/vlc/control.h, src/control/util.c: introduced...

* include/vlc/vlc.h, include/vlc/control.h, src/control/util.c: introduced vlc_int64_t in the libvlc headers instead of using long long which isn't portable + fixed a function prototype in control.h. Thanks to Brian Robb (vascy at hotmail) for pointing out the problem.
parent ebe12068
This diff is collapsed.
...@@ -46,6 +46,12 @@ typedef int vlc_bool_t; ...@@ -46,6 +46,12 @@ typedef int vlc_bool_t;
typedef struct vlc_list_t vlc_list_t; typedef struct vlc_list_t vlc_list_t;
typedef struct vlc_object_t vlc_object_t; typedef struct vlc_object_t vlc_object_t;
#if (defined( WIN32 ) || defined( UNDER_CE )) && !defined( __MINGW32__ )
typedef signed __int64 vlc_int64_t;
# else
typedef signed long long vlc_int64_t;
#endif
/** /**
* \defgroup var_type Variable types * \defgroup var_type Variable types
* These are the different types a vlc variable can have. * These are the different types a vlc variable can have.
...@@ -79,12 +85,7 @@ typedef union ...@@ -79,12 +85,7 @@ typedef union
void * p_address; void * p_address;
vlc_object_t * p_object; vlc_object_t * p_object;
vlc_list_t * p_list; vlc_list_t * p_list;
vlc_int64_t i_time;
#if (defined( WIN32 ) || defined( UNDER_CE )) && !defined( __MINGW32__ )
signed __int64 i_time;
# else
signed long long i_time;
#endif
struct { char *psz_name; int i_object_id; } var; struct { char *psz_name; int i_object_id; } var;
......
...@@ -55,10 +55,10 @@ ...@@ -55,10 +55,10 @@
#define RAISE( c, m ) exception->code = c; \ #define RAISE( c, m ) exception->code = c; \
exception->message = strdup(m); exception->message = strdup(m);
long long mediacontrol_unit_convert( input_thread_t *p_input, vlc_int64_t mediacontrol_unit_convert( input_thread_t *p_input,
mediacontrol_PositionKey from, mediacontrol_PositionKey from,
mediacontrol_PositionKey to, mediacontrol_PositionKey to,
long long value ) vlc_int64_t value )
{ {
if( to == from ) if( to == from )
return value; return value;
...@@ -101,12 +101,12 @@ long long mediacontrol_unit_convert( input_thread_t *p_input, ...@@ -101,12 +101,12 @@ long long mediacontrol_unit_convert( input_thread_t *p_input,
{ {
/* FIXME */ /* FIXME */
/* vlc < 0.8 API */ /* vlc < 0.8 API */
/* return ( long long )( value * 50 * p_input->stream.i_mux_rate / f_fps ); */ /* return ( vlc_int64_t )( value * 50 * p_input->stream.i_mux_rate / f_fps ); */
return 0; return 0;
} }
if( to == mediacontrol_MediaTime ) if( to == mediacontrol_MediaTime )
return( long long )( value * 1000.0 / ( double )f_fps ); return( vlc_int64_t )( value * 1000.0 / ( double )f_fps );
/* Cannot happen */ /* Cannot happen */
break; break;
...@@ -124,7 +124,7 @@ long long mediacontrol_unit_convert( input_thread_t *p_input, ...@@ -124,7 +124,7 @@ long long mediacontrol_unit_convert( input_thread_t *p_input,
// i_mux_rate : the rate we read the stream (in units of 50 bytes/s) ; // i_mux_rate : the rate we read the stream (in units of 50 bytes/s) ;
// 0 if undef */ // 0 if undef */
// if( to == mediacontrol_MediaTime ) // if( to == mediacontrol_MediaTime )
// return ( long long )( 1000 * value / 50 / p_input->stream.i_mux_rate ); // return ( vlc_int64_t )( 1000 * value / 50 / p_input->stream.i_mux_rate );
// //
// if( to == mediacontrol_SampleCount ) // if( to == mediacontrol_SampleCount )
// { // {
...@@ -132,7 +132,7 @@ long long mediacontrol_unit_convert( input_thread_t *p_input, ...@@ -132,7 +132,7 @@ long long mediacontrol_unit_convert( input_thread_t *p_input,
// if( demux2_Control( p_input->input.p_demux, DEMUX_GET_FPS, &f_fps ) || f_fps < 0.1 ) // if( demux2_Control( p_input->input.p_demux, DEMUX_GET_FPS, &f_fps ) || f_fps < 0.1 )
// return 0; // return 0;
// else // else
// return ( long long )( value * f_fps / 50 / p_input->stream.i_mux_rate ); // return ( vlc_int64_t )( value * f_fps / 50 / p_input->stream.i_mux_rate );
// } // }
/* Cannot happen */ /* Cannot happen */
break; break;
...@@ -143,7 +143,7 @@ long long mediacontrol_unit_convert( input_thread_t *p_input, ...@@ -143,7 +143,7 @@ long long mediacontrol_unit_convert( input_thread_t *p_input,
/* Converts a mediacontrol_Position into a time in microseconds in /* Converts a mediacontrol_Position into a time in microseconds in
movie clock time */ movie clock time */
long long vlc_int64_t
mediacontrol_position2microsecond( input_thread_t* p_input, const mediacontrol_Position * pos ) mediacontrol_position2microsecond( input_thread_t* p_input, const mediacontrol_Position * pos )
{ {
switch( pos->origin ) switch( pos->origin )
...@@ -156,7 +156,7 @@ mediacontrol_position2microsecond( input_thread_t* p_input, const mediacontrol_P ...@@ -156,7 +156,7 @@ mediacontrol_position2microsecond( input_thread_t* p_input, const mediacontrol_P
break; break;
case mediacontrol_RelativePosition: case mediacontrol_RelativePosition:
{ {
long long l_pos; vlc_int64_t l_pos;
vlc_value_t val; vlc_value_t val;
val.i_time = 0; val.i_time = 0;
...@@ -174,7 +174,7 @@ mediacontrol_position2microsecond( input_thread_t* p_input, const mediacontrol_P ...@@ -174,7 +174,7 @@ mediacontrol_position2microsecond( input_thread_t* p_input, const mediacontrol_P
} }
case mediacontrol_ModuloPosition: case mediacontrol_ModuloPosition:
{ {
long long l_pos; vlc_int64_t l_pos;
vlc_value_t val; vlc_value_t val;
val.i_time = 0; val.i_time = 0;
...@@ -273,7 +273,7 @@ mediacontrol_exception_free( mediacontrol_Exception *exception ) ...@@ -273,7 +273,7 @@ mediacontrol_exception_free( mediacontrol_Exception *exception )
} }
mediacontrol_RGBPicture* mediacontrol_RGBPicture*
_mediacontrol_createRGBPicture( int i_width, int i_height, long i_chroma, long long l_date, _mediacontrol_createRGBPicture( int i_width, int i_height, long i_chroma, vlc_int64_t l_date,
char* p_data, int i_datasize ) char* p_data, int i_datasize )
{ {
mediacontrol_RGBPicture *retval; mediacontrol_RGBPicture *retval;
......
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