Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
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
Commits
6760f6a5
Commit
6760f6a5
authored
Jun 11, 2010
by
Jakob Leben
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
RC: playlist locking
untested
parent
fe85cd9a
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
6 deletions
+10
-6
modules/control/rc.c
modules/control/rc.c
+10
-6
No files found.
modules/control/rc.c
View file @
6760f6a5
...
@@ -512,10 +512,8 @@ static void Run( intf_thread_t *p_intf )
...
@@ -512,10 +512,8 @@ static void Run( intf_thread_t *p_intf )
if
(
p_playlist
)
if
(
p_playlist
)
{
{
PL_LOCK
;
p_intf
->
p_sys
->
i_last_state
=
(
int
)
PLAYLIST_STOPPED
;
p_intf
->
p_sys
->
i_last_state
=
(
int
)
PLAYLIST_STOPPED
;
msg_rc
(
STATUS_CHANGE
"( stop state: 0 )"
);
msg_rc
(
STATUS_CHANGE
"( stop state: 0 )"
);
PL_UNLOCK
;
}
}
}
}
...
@@ -524,6 +522,8 @@ static void Run( intf_thread_t *p_intf )
...
@@ -524,6 +522,8 @@ static void Run( intf_thread_t *p_intf )
{
{
PL_LOCK
;
PL_LOCK
;
int
status
=
playlist_Status
(
p_playlist
);
int
status
=
playlist_Status
(
p_playlist
);
PL_UNLOCK
;
if
(
p_intf
->
p_sys
->
i_last_state
!=
status
)
if
(
p_intf
->
p_sys
->
i_last_state
!=
status
)
{
{
if
(
status
==
PLAYLIST_STOPPED
)
if
(
status
==
PLAYLIST_STOPPED
)
...
@@ -542,7 +542,6 @@ static void Run( intf_thread_t *p_intf )
...
@@ -542,7 +542,6 @@ static void Run( intf_thread_t *p_intf )
msg_rc
(
STATUS_CHANGE
"( pause state: 4 )"
);
msg_rc
(
STATUS_CHANGE
"( pause state: 4 )"
);
}
}
}
}
PL_UNLOCK
;
}
}
if
(
p_input
&&
b_showpos
)
if
(
p_input
&&
b_showpos
)
...
@@ -1325,6 +1324,7 @@ static int Playlist( vlc_object_t *p_this, char const *psz_cmd,
...
@@ -1325,6 +1324,7 @@ static int Playlist( vlc_object_t *p_this, char const *psz_cmd,
}
}
else
if
(
!
strcmp
(
psz_cmd
,
"goto"
)
)
else
if
(
!
strcmp
(
psz_cmd
,
"goto"
)
)
{
{
PL_LOCK
;
int
i_pos
=
atoi
(
newval
.
psz_string
);
int
i_pos
=
atoi
(
newval
.
psz_string
);
/* The playlist stores 2 times the same item: onelevel & category */
/* The playlist stores 2 times the same item: onelevel & category */
int
i_size
=
p_playlist
->
items
.
i_size
/
2
;
int
i_size
=
p_playlist
->
items
.
i_size
/
2
;
...
@@ -1337,11 +1337,12 @@ static int Playlist( vlc_object_t *p_this, char const *psz_cmd,
...
@@ -1337,11 +1337,12 @@ static int Playlist( vlc_object_t *p_this, char const *psz_cmd,
p_item
=
p_parent
=
p_playlist
->
items
.
p_elems
[
i_pos
*
2
-
1
];
p_item
=
p_parent
=
p_playlist
->
items
.
p_elems
[
i_pos
*
2
-
1
];
while
(
p_parent
->
p_parent
)
while
(
p_parent
->
p_parent
)
p_parent
=
p_parent
->
p_parent
;
p_parent
=
p_parent
->
p_parent
;
playlist_Control
(
p_playlist
,
PLAYLIST_VIEWPLAY
,
pl_
Unl
ocked
,
playlist_Control
(
p_playlist
,
PLAYLIST_VIEWPLAY
,
pl_
L
ocked
,
p_parent
,
p_item
);
p_parent
,
p_item
);
}
}
else
else
msg_rc
(
_
(
"Playlist has only %d elements"
),
i_size
);
msg_rc
(
_
(
"Playlist has only %d elements"
),
i_size
);
PL_UNLOCK
;
}
}
else
if
(
!
strcmp
(
psz_cmd
,
"stop"
)
)
else
if
(
!
strcmp
(
psz_cmd
,
"stop"
)
)
{
{
...
@@ -1395,8 +1396,10 @@ static int Playlist( vlc_object_t *p_this, char const *psz_cmd,
...
@@ -1395,8 +1396,10 @@ static int Playlist( vlc_object_t *p_this, char const *psz_cmd,
else
if
(
!
strcmp
(
psz_cmd
,
"sort"
))
else
if
(
!
strcmp
(
psz_cmd
,
"sort"
))
{
{
PL_LOCK
;
playlist_RecursiveNodeSort
(
p_playlist
,
p_playlist
->
p_root_onelevel
,
playlist_RecursiveNodeSort
(
p_playlist
,
p_playlist
->
p_root_onelevel
,
SORT_ARTIST
,
ORDER_NORMAL
);
SORT_ARTIST
,
ORDER_NORMAL
);
PL_UNLOCK
;
}
}
else
if
(
!
strcmp
(
psz_cmd
,
"status"
)
)
else
if
(
!
strcmp
(
psz_cmd
,
"status"
)
)
{
{
...
@@ -1412,7 +1415,9 @@ static int Playlist( vlc_object_t *p_this, char const *psz_cmd,
...
@@ -1412,7 +1415,9 @@ static int Playlist( vlc_object_t *p_this, char const *psz_cmd,
config_GetInt
(
p_intf
,
"volume"
));
config_GetInt
(
p_intf
,
"volume"
));
PL_LOCK
;
PL_LOCK
;
switch
(
playlist_Status
(
p_playlist
)
)
int
status
=
playlist_Status
(
p_playlist
);
PL_UNLOCK
;
switch
(
status
)
{
{
case
PLAYLIST_STOPPED
:
case
PLAYLIST_STOPPED
:
msg_rc
(
STATUS_CHANGE
"( stop state: 5 )"
);
msg_rc
(
STATUS_CHANGE
"( stop state: 5 )"
);
...
@@ -1427,7 +1432,6 @@ static int Playlist( vlc_object_t *p_this, char const *psz_cmd,
...
@@ -1427,7 +1432,6 @@ static int Playlist( vlc_object_t *p_this, char const *psz_cmd,
msg_rc
(
STATUS_CHANGE
"( unknown state: -1 )"
);
msg_rc
(
STATUS_CHANGE
"( unknown state: -1 )"
);
break
;
break
;
}
}
PL_UNLOCK
;
vlc_object_release
(
p_input
);
vlc_object_release
(
p_input
);
}
}
}
}
...
...
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