Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc-2-2
Commits
3b7fe96c
Commit
3b7fe96c
authored
Jan 18, 2010
by
Rafaël Carré
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
media_player set_state() : only lock if needed
parent
9a706d60
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
11 deletions
+11
-11
src/control/media_player.c
src/control/media_player.c
+11
-11
No files found.
src/control/media_player.c
View file @
3b7fe96c
...
@@ -154,14 +154,17 @@ input_thread_t *libvlc_get_input_thread( libvlc_media_player_t *p_mi,
...
@@ -154,14 +154,17 @@ input_thread_t *libvlc_get_input_thread( libvlc_media_player_t *p_mi,
*
*
* Function will lock the media_player.
* Function will lock the media_player.
*/
*/
static
void
set_state
(
libvlc_media_player_t
*
p_mi
,
libvlc_state_t
state
)
static
void
set_state
(
libvlc_media_player_t
*
p_mi
,
libvlc_state_t
state
,
{
bool
b_locked
)
lock
(
p_mi
);
{
if
(
!
b_locked
)
lock
(
p_mi
);
p_mi
->
state
=
state
;
p_mi
->
state
=
state
;
libvlc_media_t
*
media
=
p_mi
->
p_md
;
libvlc_media_t
*
media
=
p_mi
->
p_md
;
if
(
media
)
if
(
media
)
libvlc_media_retain
(
media
);
libvlc_media_retain
(
media
);
unlock
(
p_mi
);
if
(
!
b_locked
)
unlock
(
p_mi
);
if
(
media
)
{
if
(
media
)
{
...
@@ -256,7 +259,7 @@ input_event_changed( vlc_object_t * p_this, char const * psz_cmd,
...
@@ -256,7 +259,7 @@ input_event_changed( vlc_object_t * p_this, char const * psz_cmd,
return
VLC_SUCCESS
;
return
VLC_SUCCESS
;
}
}
set_state
(
p_mi
,
libvlc_state
);
set_state
(
p_mi
,
libvlc_state
,
false
);
libvlc_event_send
(
p_mi
->
p_event_manager
,
&
event
);
libvlc_event_send
(
p_mi
->
p_event_manager
,
&
event
);
}
}
else
if
(
newval
.
i_int
==
INPUT_EVENT_ABORT
)
else
if
(
newval
.
i_int
==
INPUT_EVENT_ABORT
)
...
@@ -264,7 +267,7 @@ input_event_changed( vlc_object_t * p_this, char const * psz_cmd,
...
@@ -264,7 +267,7 @@ input_event_changed( vlc_object_t * p_this, char const * psz_cmd,
libvlc_state_t
libvlc_state
=
libvlc_Stopped
;
libvlc_state_t
libvlc_state
=
libvlc_Stopped
;
event
.
type
=
libvlc_MediaPlayerStopped
;
event
.
type
=
libvlc_MediaPlayerStopped
;
set_state
(
p_mi
,
libvlc_state
);
set_state
(
p_mi
,
libvlc_state
,
false
);
libvlc_event_send
(
p_mi
->
p_event_manager
,
&
event
);
libvlc_event_send
(
p_mi
->
p_event_manager
,
&
event
);
}
}
else
if
(
newval
.
i_int
==
INPUT_EVENT_POSITION
)
else
if
(
newval
.
i_int
==
INPUT_EVENT_POSITION
)
...
@@ -507,11 +510,8 @@ void libvlc_media_player_set_media(
...
@@ -507,11 +510,8 @@ void libvlc_media_player_set_media(
p_mi
->
p_input_thread
&&
p_mi
->
p_input_thread
&&
!
p_mi
->
p_input_thread
->
b_eof
&&
!
p_mi
->
p_input_thread
->
b_eof
&&
!
p_mi
->
p_input_thread
->
b_error
);
!
p_mi
->
p_input_thread
->
b_error
);
unlock
(
p_mi
);
set_state
(
p_mi
,
libvlc_NothingSpecial
);
lock
(
p_mi
);
set_state
(
p_mi
,
libvlc_NothingSpecial
,
true
);
libvlc_media_release
(
p_mi
->
p_md
);
libvlc_media_release
(
p_mi
->
p_md
);
...
@@ -698,7 +698,7 @@ void libvlc_media_player_stop( libvlc_media_player_t *p_mi,
...
@@ -698,7 +698,7 @@ void libvlc_media_player_stop( libvlc_media_player_t *p_mi,
* state. */
* state. */
if
(
state
!=
libvlc_Stopped
)
if
(
state
!=
libvlc_Stopped
)
{
{
set_state
(
p_mi
,
libvlc_Stopped
);
set_state
(
p_mi
,
libvlc_Stopped
,
false
);
/* Construct and send the event */
/* Construct and send the event */
libvlc_event_t
event
;
libvlc_event_t
event
;
...
...
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