Commit d8c29705 authored by Rémi Duraffort's avatar Rémi Duraffort

Ue var_Get(Time|Address) when applicable.

parent 5f65c5c9
...@@ -584,17 +584,11 @@ void libvlc_media_player_play( libvlc_media_player_t *p_mi, ...@@ -584,17 +584,11 @@ void libvlc_media_player_play( libvlc_media_player_t *p_mi,
var_Create( p_input_thread, "drawable-hwnd", VLC_VAR_ADDRESS ); var_Create( p_input_thread, "drawable-hwnd", VLC_VAR_ADDRESS );
if( p_mi->drawable.hwnd != NULL ) if( p_mi->drawable.hwnd != NULL )
{ var_SetAddress( p_input_thread, "drawable-hwnd", p_mi->drawable.hwnd );
vlc_value_t val = { .p_address = p_mi->drawable.hwnd };
var_Set( p_input_thread, "drawable-hwnd", val );
}
var_Create( p_input_thread, "drawable-nsobject", VLC_VAR_ADDRESS ); var_Create( p_input_thread, "drawable-nsobject", VLC_VAR_ADDRESS );
if( p_mi->drawable.nsobject != NULL ) if( p_mi->drawable.nsobject != NULL )
{ var_SetAddress( p_input_thread, "drawable-nsobject", p_mi->drawable.nsobject );
vlc_value_t val = { .p_address = p_mi->drawable.nsobject };
var_Set( p_input_thread, "drawable-nsobject", val );
}
var_AddCallback( p_input_thread, "can-seek", input_seekable_changed, p_mi ); var_AddCallback( p_input_thread, "can-seek", input_seekable_changed, p_mi );
var_AddCallback( p_input_thread, "can-pause", input_pausable_changed, p_mi ); var_AddCallback( p_input_thread, "can-pause", input_pausable_changed, p_mi );
...@@ -798,16 +792,16 @@ libvlc_time_t libvlc_media_player_get_length( ...@@ -798,16 +792,16 @@ libvlc_time_t libvlc_media_player_get_length(
libvlc_exception_t *p_e ) libvlc_exception_t *p_e )
{ {
input_thread_t *p_input_thread; input_thread_t *p_input_thread;
vlc_value_t val; libvlc_time_t i_time;
p_input_thread = libvlc_get_input_thread ( p_mi, p_e); p_input_thread = libvlc_get_input_thread ( p_mi, p_e);
if( !p_input_thread ) if( !p_input_thread )
return -1; return -1;
var_Get( p_input_thread, "length", &val ); i_time = var_GetTime( p_input_thread, "length" );
vlc_object_release( p_input_thread ); vlc_object_release( p_input_thread );
return (val.i_time+500LL)/1000LL; return (i_time+500LL)/1000LL;
} }
libvlc_time_t libvlc_media_player_get_time( libvlc_time_t libvlc_media_player_get_time(
...@@ -815,20 +809,20 @@ libvlc_time_t libvlc_media_player_get_time( ...@@ -815,20 +809,20 @@ libvlc_time_t libvlc_media_player_get_time(
libvlc_exception_t *p_e ) libvlc_exception_t *p_e )
{ {
input_thread_t *p_input_thread; input_thread_t *p_input_thread;
vlc_value_t val; libvlc_time_t i_time;
p_input_thread = libvlc_get_input_thread ( p_mi, p_e ); p_input_thread = libvlc_get_input_thread ( p_mi, p_e );
if( !p_input_thread ) if( !p_input_thread )
return -1; return -1;
var_Get( p_input_thread , "time", &val ); i_time = var_GetTime( p_input_thread , "time" );
vlc_object_release( p_input_thread ); vlc_object_release( p_input_thread );
return (val.i_time+500LL)/1000LL; return (i_time+500LL)/1000LL;
} }
void libvlc_media_player_set_time( void libvlc_media_player_set_time(
libvlc_media_player_t *p_mi, libvlc_media_player_t *p_mi,
libvlc_time_t time, libvlc_time_t i_time,
libvlc_exception_t *p_e ) libvlc_exception_t *p_e )
{ {
input_thread_t *p_input_thread; input_thread_t *p_input_thread;
...@@ -837,7 +831,7 @@ void libvlc_media_player_set_time( ...@@ -837,7 +831,7 @@ void libvlc_media_player_set_time(
if( !p_input_thread ) if( !p_input_thread )
return; return;
var_SetTime( p_input_thread, "time", time*1000LL ); var_SetTime( p_input_thread, "time", i_time*1000LL );
vlc_object_release( p_input_thread ); vlc_object_release( p_input_thread );
} }
......
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