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
cff72764
Commit
cff72764
authored
Jun 19, 2010
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
playlist: move checks out of playlist_sync_with_queue()
Rename the function to playlist_song_started(), which gets only called if the song has actually started.
parent
7f803494
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
20 deletions
+21
-20
playlist.c
src/playlist.c
+21
-20
No files found.
src/playlist.c
View file @
cff72764
...
@@ -93,33 +93,33 @@ playlist_queue_song_order(struct playlist *playlist, unsigned order)
...
@@ -93,33 +93,33 @@ playlist_queue_song_order(struct playlist *playlist, unsigned order)
}
}
/**
/**
* Check if the player thread has already started playing the "queued"
* Called if the player thread has started playing the "queued" song.
* song.
*/
*/
static
void
static
void
playlist_s
ync_with_queue
(
struct
playlist
*
playlist
)
playlist_s
ong_started
(
struct
playlist
*
playlist
)
{
{
if
(
pc
.
next_song
==
NULL
&&
playlist
->
queued
!=
-
1
)
{
assert
(
pc
.
next_song
==
NULL
);
/* queued song has started: copy queued to current,
assert
(
playlist
->
queued
>=
-
1
);
and notify the clients */
int
current
=
playlist
->
current
;
/* queued song has started: copy queued to current,
playlist
->
current
=
playlist
->
queued
;
and notify the clients */
playlist
->
queued
=
-
1
;
/* Set pause and remove the single mode. */
if
(
playlist
->
queue
.
single
&&
!
playlist
->
queue
.
repeat
)
{
playlist
->
queue
.
single
=
false
;
idle_add
(
IDLE_OPTIONS
);
pc_set_pause
(
true
);
int
current
=
playlist
->
current
;
}
playlist
->
current
=
playlist
->
queued
;
playlist
->
queued
=
-
1
;
if
(
playlist
->
queue
.
consume
)
/* Set pause and remove the single mode. */
playlist_delete
(
playlist
,
queue_order_to_position
(
&
playlist
->
queue
,
current
));
if
(
playlist
->
queue
.
single
&&
!
playlist
->
queue
.
repeat
)
{
playlist
->
queue
.
single
=
false
;
idle_add
(
IDLE_OPTIONS
);
idle_add
(
IDLE_PLAYER
);
pc_set_pause
(
true
);
}
}
if
(
playlist
->
queue
.
consume
)
playlist_delete
(
playlist
,
queue_order_to_position
(
&
playlist
->
queue
,
current
));
idle_add
(
IDLE_PLAYER
);
}
}
const
struct
song
*
const
struct
song
*
...
@@ -228,7 +228,8 @@ playlist_sync(struct playlist *playlist)
...
@@ -228,7 +228,8 @@ playlist_sync(struct playlist *playlist)
else
{
else
{
/* check if the player thread has already started
/* check if the player thread has already started
playing the queued song */
playing the queued song */
playlist_sync_with_queue
(
playlist
);
if
(
pc
.
next_song
==
NULL
&&
playlist
->
queued
!=
-
1
)
playlist_song_started
(
playlist
);
/* make sure the queued song is always set (if
/* make sure the queued song is always set (if
possible) */
possible) */
...
...
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