Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mpd
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Иван Мажукин
mpd
Commits
ae9bb929
Commit
ae9bb929
authored
Nov 12, 2008
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
playlist: call clearPlayerQueue() only if song is queued II
This patch extends commit
35a16b99
, and amends several 2 missing checks. It simplifies 2 more checks by merging "if" conditions.
parent
93f488f0
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
11 deletions
+7
-11
playlist.c
src/playlist.c
+7
-11
No files found.
src/playlist.c
View file @
ae9bb929
...
...
@@ -979,11 +979,8 @@ enum playlist_result moveSongInPlaylist(unsigned from, int to)
to
=
(
currentSong
+
abs
(
to
))
%
playlist
.
length
;
}
if
(
playlist_state
==
PLAYLIST_STATE_PLAY
)
{
int
queuedSong
=
-
1
;
if
(
playlist
.
queued
>=
0
)
queuedSong
=
playlist
.
order
[
playlist
.
queued
];
if
(
playlist_state
==
PLAYLIST_STATE_PLAY
&&
playlist
.
queued
>=
0
)
{
int
queuedSong
=
playlist
.
order
[
playlist
.
queued
];
if
(
queuedSong
==
(
int
)
from
||
queuedSong
==
to
||
currentSong
==
from
||
(
int
)
currentSong
==
to
)
clearPlayerQueue
();
...
...
@@ -1062,10 +1059,8 @@ static void orderPlaylist(void)
if
(
playlist
.
current
>=
0
&&
playlist
.
current
<
(
int
)
playlist
.
length
)
playlist
.
current
=
playlist
.
order
[
playlist
.
current
];
if
(
playlist_state
==
PLAYLIST_STATE_PLAY
)
{
if
(
playlist
.
queued
>=
0
)
if
(
playlist_state
==
PLAYLIST_STATE_PLAY
&&
playlist
.
queued
>=
0
)
clearPlayerQueue
();
}
for
(
i
=
0
;
i
<
playlist
.
length
;
i
++
)
{
playlist
.
order
[
i
]
=
i
;
...
...
@@ -1087,10 +1082,9 @@ static void randomizeOrder(int start, int end)
DEBUG
(
"playlist: randomize from %i to %i
\n
"
,
start
,
end
);
if
(
playlist_state
==
PLAYLIST_STATE_PLAY
)
{
if
(
playlist
.
queued
>=
start
&&
playlist
.
queued
<=
end
)
if
(
playlist_state
==
PLAYLIST_STATE_PLAY
&&
playlist
.
queued
>=
start
&&
playlist
.
queued
<=
end
)
clearPlayerQueue
();
}
for
(
i
=
start
;
i
<=
end
;
i
++
)
{
ri
=
random
()
%
(
end
-
start
+
1
)
+
start
;
...
...
@@ -1158,7 +1152,9 @@ void shufflePlaylist(void)
if
(
playlist
.
length
>
1
)
{
if
(
playlist_state
==
PLAYLIST_STATE_PLAY
)
{
if
(
playlist
.
queued
>=
0
)
clearPlayerQueue
();
/* put current playing song first */
swapSongs
(
0
,
playlist
.
order
[
playlist
.
current
]);
if
(
playlist
.
random
)
{
...
...
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