Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Steve Lhomme
VLC
Commits
66f7daf3
Commit
66f7daf3
authored
Feb 08, 2001
by
Christophe Massiot
Browse files
* Pause function implemented ('p' key).
parent
34337317
Changes
5
Hide whitespace changes
Inline
Side-by-side
include/input_ext-intf.h
View file @
66f7daf3
...
...
@@ -4,7 +4,7 @@
* control the pace of reading.
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* $Id: input_ext-intf.h,v 1.1
5
2001/02/08
07:24:25 sam
Exp $
* $Id: input_ext-intf.h,v 1.1
6
2001/02/08
13:08:02 massiot
Exp $
*
* Authors:
*
...
...
@@ -158,6 +158,8 @@ typedef struct stream_descriptor_s
/* New status and rate requested by the interface */
int
i_new_status
,
i_new_rate
;
vlc_cond_t
stream_wait
;
/* interface -> input in case of a
* status change request */
/* Demultiplexer data */
void
*
p_demux_data
;
...
...
@@ -299,7 +301,7 @@ typedef struct input_config_s
*****************************************************************************/
struct
input_thread_s
*
input_CreateThread
(
struct
playlist_item_s
*
,
int
*
pi_status
);
void
input_DestroyThread
(
struct
input_thread_s
*
,
int
*
pi_status
);
void
input_DestroyThread
(
struct
input_thread_s
*
,
int
*
pi_status
);
void
input_Play
(
struct
input_thread_s
*
);
void
input_Pause
(
struct
input_thread_s
*
);
void
input_Forward
(
struct
input_thread_s
*
,
int
);
plugins/sdl/intf_sdl.c
View file @
66f7daf3
...
...
@@ -2,7 +2,7 @@
* intf_sdl.c: SDL interface plugin
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* $Id: intf_sdl.c,v 1.3
0
2001/02/08
04:43:27 sam
Exp $
* $Id: intf_sdl.c,v 1.3
1
2001/02/08
13:08:02 massiot
Exp $
*
* Authors:
*
...
...
@@ -145,13 +145,22 @@ void intf_SDLManage( intf_thread_t *p_intf )
/* FIXME : this is temporary */
case
SDLK_p
:
input_Play
(
p_intf
->
p_input
);
if
(
p_intf
->
p_input
->
stream
.
control
.
i_status
==
PLAYING_S
)
{
input_Pause
(
p_intf
->
p_input
);
}
else
{
input_Play
(
p_intf
->
p_input
);
}
break
;
case
SDLK_a
:
i_rate
=
p_intf
->
p_input
->
stream
.
control
.
i_rate
/
2
;
if
(
i_rate
>=
MINIMAL_RATE
)
{
input_Forward
(
p_intf
->
p_input
,
i_rate
);
}
break
;
case
SDLK_z
:
...
...
src/input/input.c
View file @
66f7daf3
...
...
@@ -4,7 +4,7 @@
* decoders.
*****************************************************************************
* Copyright (C) 1998, 1999, 2000 VideoLAN
* $Id: input.c,v 1.7
6
2001/02/08
07:24:25 sam
Exp $
* $Id: input.c,v 1.7
7
2001/02/08
13:08:02 massiot
Exp $
*
* Authors:
*
...
...
@@ -119,6 +119,7 @@ input_thread_t *input_CreateThread ( playlist_item_t *p_item, int *pi_status )
/* Create thread and set locks. */
vlc_mutex_init
(
&
p_input
->
stream
.
stream_lock
);
vlc_cond_init
(
&
p_input
->
stream
.
stream_wait
);
vlc_mutex_init
(
&
p_input
->
stream
.
control
.
control_lock
);
if
(
vlc_thread_create
(
&
p_input
->
thread_id
,
"input"
,
(
void
*
)
RunThread
,
(
void
*
)
p_input
)
)
...
...
@@ -161,6 +162,11 @@ void input_DestroyThread( input_thread_t *p_input, int *pi_status )
/* Request thread destruction */
p_input
->
b_die
=
1
;
/* Make the thread exit of an eventual vlc_cond_wait() */
vlc_mutex_lock
(
&
p_input
->
stream
.
stream_lock
);
vlc_cond_signal
(
&
p_input
->
stream
.
stream_wait
);
vlc_mutex_unlock
(
&
p_input
->
stream
.
stream_lock
);
/* If status is NULL, wait until thread has been destroyed */
if
(
pi_status
==
NULL
)
{
...
...
src/input/input_clock.c
View file @
66f7daf3
...
...
@@ -2,7 +2,7 @@
* input_clock.c: Clock/System date convertions, stream management
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* $Id: input_clock.c,v 1.
4
2001/02/0
7
1
7:56:21
massiot Exp $
* $Id: input_clock.c,v 1.
5
2001/02/0
8
1
3:08:03
massiot Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
...
...
@@ -217,15 +217,23 @@ void input_ClockManageRef( input_thread_t * p_input,
vlc_mutex_lock
(
&
p_input
->
stream
.
stream_lock
);
if
(
p_input
->
stream
.
i_new_status
!=
UNDEF_S
)
{
/* For the moment, only PLAYING_S and FORWARD_S are
* supported. */
input_ClockNewRef
(
p_input
,
p_pgrm
,
i_clock
,
ClockToSysdate
(
p_input
,
p_pgrm
,
i_clock
)
);
if
(
p_input
->
stream
.
i_new_status
==
PAUSE_S
)
{
vlc_cond_wait
(
&
p_input
->
stream
.
stream_wait
,
&
p_input
->
stream
.
stream_lock
);
input_ClockNewRef
(
p_input
,
p_pgrm
,
i_clock
,
mdate
()
);
}
else
{
input_ClockNewRef
(
p_input
,
p_pgrm
,
i_clock
,
ClockToSysdate
(
p_input
,
p_pgrm
,
i_clock
)
);
}
vlc_mutex_lock
(
&
p_input
->
stream
.
control
.
control_lock
);
p_input
->
stream
.
control
.
i_status
=
p_input
->
stream
.
i_new_status
;
if
(
p_input
->
stream
.
control
.
i_status
!=
PLAYING_S
)
if
(
p_input
->
stream
.
control
.
i_status
!=
PLAYING_S
&&
p_input
->
stream
.
control
.
i_status
!=
PAUSE_S
)
{
p_input
->
stream
.
control
.
i_rate
=
p_input
->
stream
.
i_new_rate
;
p_input
->
stream
.
control
.
b_mute
=
1
;
...
...
src/input/input_ext-intf.c
View file @
66f7daf3
...
...
@@ -46,6 +46,7 @@ void input_Play( input_thread_t * p_input )
intf_Msg
(
"input: playing at normal rate"
);
vlc_mutex_lock
(
&
p_input
->
stream
.
stream_lock
);
p_input
->
stream
.
i_new_status
=
PLAYING_S
;
vlc_cond_signal
(
&
p_input
->
stream
.
stream_wait
);
vlc_mutex_unlock
(
&
p_input
->
stream
.
stream_lock
);
}
...
...
@@ -74,6 +75,17 @@ void input_Forward( input_thread_t * p_input, int i_rate )
vlc_mutex_lock
(
&
p_input
->
stream
.
stream_lock
);
p_input
->
stream
.
i_new_status
=
FORWARD_S
;
p_input
->
stream
.
i_new_rate
=
i_rate
;
vlc_cond_signal
(
&
p_input
->
stream
.
stream_wait
);
vlc_mutex_unlock
(
&
p_input
->
stream
.
stream_lock
);
}
/*****************************************************************************
* input_Pause: temporarily stops the reading of the stream
*****************************************************************************/
void
input_Pause
(
input_thread_t
*
p_input
)
{
vlc_mutex_lock
(
&
p_input
->
stream
.
stream_lock
);
p_input
->
stream
.
i_new_status
=
PAUSE_S
;
vlc_cond_signal
(
&
p_input
->
stream
.
stream_wait
);
vlc_mutex_unlock
(
&
p_input
->
stream
.
stream_lock
);
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment