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
ae2d13ac
Commit
ae2d13ac
authored
Jan 24, 2009
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
playlist: moved stopOnError and errorCount into struct playlist
Moved the 2 remaining global variables into the playlist struct.
parent
82df4cb2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
11 deletions
+23
-11
playlist.c
src/playlist.c
+9
-11
playlist.h
src/playlist.h
+14
-0
No files found.
src/playlist.c
View file @
ae2d13ac
...
...
@@ -75,8 +75,6 @@ static GRand *g_rand;
/** the global playlist object */
static
Playlist
playlist
;
unsigned
playlist_max_length
;
static
int
playlist_stopOnError
;
static
unsigned
playlist_errorCount
;
bool
playlist_saveAbsolutePaths
=
DEFAULT_PLAYLIST_SAVE_ABSOLUTE_PATHS
;
...
...
@@ -743,8 +741,8 @@ enum playlist_result playPlaylist(int song)
i
=
playlist
.
current
;
}
playlist
_stopOnE
rror
=
false
;
playlist
_errorC
ount
=
0
;
playlist
.
stop_on_e
rror
=
false
;
playlist
.
error_c
ount
=
0
;
playPlaylistOrderNumber
(
i
);
return
PLAYLIST_RESULT_SUCCESS
;
...
...
@@ -808,7 +806,7 @@ void nextSongInPlaylist(void)
syncPlaylistWithQueue
();
playlist
_stopOnError
=
0
;
playlist
.
stop_on_error
=
false
;
/* determine the next song from the queue's order list */
...
...
@@ -849,13 +847,13 @@ static void playPlaylistIfPlayerStopped(void)
error
=
getPlayerError
();
if
(
error
==
PLAYER_ERROR_NOERROR
)
playlist
_errorC
ount
=
0
;
playlist
.
error_c
ount
=
0
;
else
playlist_errorCount
++
;
++
playlist
.
error_count
;
if
((
playlist
_stopOnE
rror
&&
error
!=
PLAYER_ERROR_NOERROR
)
||
if
((
playlist
.
stop_on_e
rror
&&
error
!=
PLAYER_ERROR_NOERROR
)
||
error
==
PLAYER_ERROR_AUDIO
||
error
==
PLAYER_ERROR_SYSTEM
||
playlist
_errorC
ount
>=
queue_length
(
&
playlist
.
queue
))
playlist
.
error_c
ount
>=
queue_length
(
&
playlist
.
queue
))
/* too many errors, or critical error: stop
playback */
stopPlaylist
();
...
...
@@ -1157,8 +1155,8 @@ enum playlist_result seekSongInPlaylist(unsigned song, float seek_time)
i
=
song
;
clearPlayerError
();
playlist
_stopOnError
=
1
;
playlist
_errorC
ount
=
0
;
playlist
.
stop_on_error
=
true
;
playlist
.
error_c
ount
=
0
;
if
(
playlist
.
playing
)
{
if
(
playlist
.
queued
>=
0
)
...
...
src/playlist.h
View file @
ae2d13ac
...
...
@@ -56,6 +56,20 @@ typedef struct _Playlist {
bool
playing
;
/**
* If true, then any error is fatal; if false, MPD will
* attempt to play the next song on non-fatal errors. During
* seeking, this flag is set.
*/
bool
stop_on_error
;
/**
* Number of errors since playback was started. If this
* number exceeds the length of the playlist, MPD gives up,
* because all songs have been tried.
*/
unsigned
error_count
;
/**
* The "current song pointer". This is the song which is
* played when we get the "play" command. It is also the song
* which is currently being played.
...
...
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