Commit d53d9b9d authored by Laurent Aimar's avatar Laurent Aimar

* control/*.c: use var_Set/Get "state"/"position"/"rate" instead of old functions.

parent 4f49b52c
...@@ -330,6 +330,11 @@ mediacontrol_set_media_position(mediacontrol_Instance *self, ...@@ -330,6 +330,11 @@ mediacontrol_set_media_position(mediacontrol_Instance *self,
return; return;
} }
/* FIXME FIXME FIXME input_Seek is deprecated, and I don't know how to fix that --fenrir */
/* You need to do a var_SetFloat( p_input, pos ); where pos is a float between 0.0 and 1.0 */
RAISE(mediacontrol_InvalidPosition, "mediacontrol_set_media_position is not usable for now");
return
#if 0
l_offset_destination = a_position->value; l_offset_destination = a_position->value;
i_whence |= INPUT_SEEK_BYTES; i_whence |= INPUT_SEEK_BYTES;
...@@ -358,6 +363,7 @@ mediacontrol_set_media_position(mediacontrol_Instance *self, ...@@ -358,6 +363,7 @@ mediacontrol_set_media_position(mediacontrol_Instance *self,
function (cf input_ext-intf.c) */ function (cf input_ext-intf.c) */
input_Seek (p_input, l_offset_destination, i_whence); input_Seek (p_input, l_offset_destination, i_whence);
return; return;
#endif
} }
/* Starts playing a stream */ /* Starts playing a stream */
...@@ -409,14 +415,12 @@ mediacontrol_pause(mediacontrol_Instance *self, ...@@ -409,14 +415,12 @@ mediacontrol_pause(mediacontrol_Instance *self,
exception=mediacontrol_exception_init(exception); exception=mediacontrol_exception_init(exception);
if (p_input != NULL) if (p_input != NULL)
{ {
input_SetStatus( p_input, INPUT_STATUS_PAUSE ); var_SetInteger( p_input, "state", PAUSE_S );
} }
else else
{ {
RAISE(mediacontrol_InternalException, "No input"); RAISE(mediacontrol_InternalException, "No input");
} }
return;
} }
void void
...@@ -430,14 +434,12 @@ mediacontrol_resume(mediacontrol_Instance *self, ...@@ -430,14 +434,12 @@ mediacontrol_resume(mediacontrol_Instance *self,
exception=mediacontrol_exception_init(exception); exception=mediacontrol_exception_init(exception);
if (p_input != NULL) if (p_input != NULL)
{ {
input_SetStatus( p_input, INPUT_STATUS_PAUSE ); var_SetInteger( p_input, "state", PAUSE_S );
} }
else else
{ {
RAISE(mediacontrol_InternalException, "No input"); RAISE(mediacontrol_InternalException, "No input");
} }
return;
} }
void void
......
...@@ -547,8 +547,8 @@ static int Forward(intf_thread_t *p_intf) ...@@ -547,8 +547,8 @@ static int Forward(intf_thread_t *p_intf)
if(p_intf->p_sys->p_input) if(p_intf->p_sys->p_input)
{ {
msg_Dbg(p_intf,"seeking %f seconds",p_intf->p_sys->f_seconds); msg_Dbg(p_intf,"seeking %f seconds",p_intf->p_sys->f_seconds);
input_Seek( p_intf->p_sys->p_input, p_intf->p_sys->f_seconds, var_SetTime( p_intf->p_sys->p_input, "time-offset",
INPUT_SEEK_SECONDS | INPUT_SEEK_CUR); (int64_t)p_intf->p_sys->f_seconds * I64C(1000000) );
return 0; return 0;
} }
return -1; return -1;
...@@ -560,8 +560,9 @@ static int Back(intf_thread_t *p_intf) ...@@ -560,8 +560,9 @@ static int Back(intf_thread_t *p_intf)
if(p_intf->p_sys->p_input) if(p_intf->p_sys->p_input)
{ {
msg_Dbg(p_intf,"seeking -%f seconds",p_intf->p_sys->f_seconds); msg_Dbg(p_intf,"seeking -%f seconds",p_intf->p_sys->f_seconds);
input_Seek( p_intf->p_sys->p_input, -(p_intf->p_sys->f_seconds),
INPUT_SEEK_SECONDS | INPUT_SEEK_CUR ); var_SetTime( p_intf->p_sys->p_input, "time-offset",
-(int64_t)p_intf->p_sys->f_seconds * I64C(1000000) );
return 0; return 0;
} }
return -1; return -1;
...@@ -572,7 +573,7 @@ static int Play(intf_thread_t *p_intf) ...@@ -572,7 +573,7 @@ static int Play(intf_thread_t *p_intf)
{ {
if(p_intf->p_sys->p_input) if(p_intf->p_sys->p_input)
{ {
input_SetStatus( p_intf->p_sys->p_input, INPUT_STATUS_PAUSE ); var_SetInteger( p_input, "state", PAUSE_S );
return 0; return 0;
} }
return -1; return -1;
......
...@@ -481,7 +481,8 @@ static void Run( intf_thread_t *p_intf ) ...@@ -481,7 +481,8 @@ static void Run( intf_thread_t *p_intf )
p_input->stream.p_selected_area->i_part = i_chapter; p_input->stream.p_selected_area->i_part = i_chapter;
vlc_mutex_unlock( &p_input->stream.stream_lock ); vlc_mutex_unlock( &p_input->stream.stream_lock );
input_ChangeArea( p_input, p_area ); input_ChangeArea( p_input, p_area );
input_SetStatus( p_input, INPUT_STATUS_PLAY );
var_SetInteger( p_input, "state", PLAYING_S );
vlc_mutex_lock( &p_input->stream.stream_lock ); vlc_mutex_lock( &p_input->stream.stream_lock );
} }
vlc_mutex_unlock( &p_input->stream.stream_lock ); vlc_mutex_unlock( &p_input->stream.stream_lock );
......
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