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
d06f8baf
Commit
d06f8baf
authored
Nov 03, 2009
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
player_thread: moved code to decoding_next_song()
Simplify several expressions.
parent
56b8081a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
4 deletions
+15
-4
player_thread.c
src/player_thread.c
+15
-4
No files found.
src/player_thread.c
View file @
d06f8baf
...
...
@@ -164,6 +164,17 @@ player_dc_stop(struct player *player)
}
/**
* Returns true if the decoder is decoding the next song (or has begun
* decoding it, or has finished doing it), and the player hasn't
* switched to that song yet.
*/
static
bool
decoding_next_song
(
const
struct
player
*
player
)
{
return
player
->
dc
->
pipe
!=
NULL
&&
player
->
dc
->
pipe
!=
player
->
pipe
;
}
/**
* After the decoder has been started asynchronously, wait for the
* "START" command to finish. The decoder may not be initialized yet,
* i.e. there is no audio_format information yet.
...
...
@@ -486,7 +497,7 @@ static void player_process_command(struct player *player)
return
;
}
if
(
d
c
->
pipe
!=
NULL
&&
dc
->
pipe
!=
player
->
pipe
)
{
if
(
d
ecoding_next_song
(
player
)
)
{
/* the decoder is already decoding the song -
stop it and reset the position */
player_unlock
();
...
...
@@ -594,7 +605,7 @@ play_next_chunk(struct player *player)
return
true
;
if
(
player
->
xfade
==
XFADE_ENABLED
&&
d
c
->
pipe
!=
NULL
&&
dc
->
pipe
!=
player
->
pipe
&&
d
ecoding_next_song
(
player
)
&&
(
cross_fade_position
=
music_pipe_size
(
player
->
pipe
))
<=
player
->
cross_fade_chunks
)
{
/* perform cross fade */
...
...
@@ -814,7 +825,7 @@ static void do_play(struct decoder_control *dc)
player_dc_start
(
&
player
,
music_pipe_new
());
}
if
(
d
c
->
pipe
!=
NULL
&&
dc
->
pipe
!=
player
.
pipe
&&
if
(
d
ecoding_next_song
(
&
player
)
&&
player
.
xfade
==
XFADE_UNKNOWN
&&
!
decoder_lock_is_starting
(
dc
))
{
/* enable cross fading in this song? if yes,
...
...
@@ -853,7 +864,7 @@ static void do_play(struct decoder_control *dc)
/* XXX synchronize in a better way */
g_usleep
(
10000
);
}
else
if
(
d
c
->
pipe
!=
NULL
&&
dc
->
pipe
!=
player
.
pipe
)
{
}
else
if
(
d
ecoding_next_song
(
&
player
)
)
{
/* at the beginning of a new song */
if
(
!
player_song_border
(
&
player
))
...
...
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