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
e89bd30d
Commit
e89bd30d
authored
Jan 04, 2013
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Playlist: pass max_length to playlist_init()
Move the configuration lookup to Main.cxx.
parent
2a9d933a
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
8 additions
and
10 deletions
+8
-10
Main.cxx
src/Main.cxx
+2
-1
Playlist.cxx
src/Playlist.cxx
+2
-5
Playlist.hxx
src/Playlist.hxx
+2
-2
PlaylistGlobal.cxx
src/PlaylistGlobal.cxx
+2
-2
No files found.
src/Main.cxx
View file @
e89bd30d
...
...
@@ -414,7 +414,8 @@ int mpd_main(int argc, char *argv[])
}
initPermissions
();
playlist_global_init
();
playlist_global_init
(
config_get_positive
(
CONF_MAX_PLAYLIST_LENGTH
,
DEFAULT_PLAYLIST_MAX_LENGTH
));
spl_global_init
();
#ifdef ENABLE_ARCHIVE
archive_plugin_init_all
();
...
...
src/Playlist.cxx
View file @
e89bd30d
...
...
@@ -23,7 +23,6 @@
#include "song.h"
extern
"C"
{
#include "conf.h"
#include "idle.h"
}
...
...
@@ -54,11 +53,9 @@ playlist_tag_changed(struct playlist *playlist)
}
void
playlist_init
(
struct
playlist
*
playlist
)
playlist_init
(
struct
playlist
*
playlist
,
unsigned
max_length
)
{
queue_init
(
&
playlist
->
queue
,
config_get_positive
(
CONF_MAX_PLAYLIST_LENGTH
,
DEFAULT_PLAYLIST_MAX_LENGTH
));
queue_init
(
&
playlist
->
queue
,
max_length
);
playlist
->
queued
=
-
1
;
playlist
->
current
=
-
1
;
...
...
src/Playlist.hxx
View file @
e89bd30d
...
...
@@ -74,13 +74,13 @@ struct playlist {
extern
struct
playlist
g_playlist
;
void
playlist_global_init
(
void
);
playlist_global_init
(
unsigned
max_length
);
void
playlist_global_finish
(
void
);
void
playlist_init
(
struct
playlist
*
playlist
);
playlist_init
(
struct
playlist
*
playlist
,
unsigned
max_length
);
void
playlist_finish
(
struct
playlist
*
playlist
);
...
...
src/PlaylistGlobal.cxx
View file @
e89bd30d
...
...
@@ -45,9 +45,9 @@ playlist_event(void)
}
void
playlist_global_init
(
void
)
playlist_global_init
(
unsigned
max_length
)
{
playlist_init
(
&
g_playlist
);
playlist_init
(
&
g_playlist
,
max_length
);
event_pipe_register
(
PIPE_EVENT_TAG
,
playlist_tag_event
);
event_pipe_register
(
PIPE_EVENT_PLAYLIST
,
playlist_event
);
...
...
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