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
0fe0425d
Commit
0fe0425d
authored
Dec 27, 2008
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
disable archive API without plugins
When there are no archive plugins, we do not need the archive API at all. Drop all its overhead.
parent
4c13a276
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
43 additions
and
5 deletions
+43
-5
configure.ac
configure.ac
+10
-0
Makefile.am
src/Makefile.am
+9
-4
input_stream.c
src/input_stream.c
+5
-0
ls.c
src/ls.c
+2
-0
main.c
src/main.c
+10
-1
update.c
src/update.c
+7
-0
No files found.
configure.ac
View file @
0fe0425d
...
...
@@ -217,6 +217,16 @@ if test x$enable_iso = xyes; then
AC_DEFINE(HAVE_ISO, 1, [Define to have iso archive support])
fi
dnl archive API
if test x$enable_bz2 = xyes || test x$enable_zip = xyes || test x$enable_iso = xyes; then
enable_archive=yes
AC_DEFINE(ENABLE_ARCHIVE, 1, [The archive API is available])
else
enable_archive=no
fi
AM_CONDITIONAL(ENABLE_ARCHIVE, test x$enable_archive = xyes)
dnl
dnl decoder plugins
...
...
src/Makefile.am
View file @
0fe0425d
...
...
@@ -158,10 +158,7 @@ mpd_SOURCES = \
volume.c
\
locate.c
\
stored_playlist.c
\
timer.c
\
archive_api.c
\
archive_list.c
\
input_archive.c
timer.c
if
HAVE_LIBSAMPLERATE
mpd_SOURCES
+=
pcm_resample_libsamplerate.c
...
...
@@ -187,6 +184,14 @@ if HAVE_ISO
mpd_SOURCES
+=
archive/iso_plugin.c
endif
if
ENABLE_ARCHIVE
mpd_SOURCES
+=
\
archive_api.c
\
archive_list.c
\
input_archive.c
endif
# decoder plugins
if
HAVE_MAD
...
...
src/input_stream.c
View file @
0fe0425d
...
...
@@ -20,7 +20,10 @@
#include "config.h"
#include "input_file.h"
#ifdef ENABLE_ARCHIVE
#include "input_archive.h"
#endif
#ifdef HAVE_CURL
#include "input_curl.h"
...
...
@@ -31,7 +34,9 @@
static
const
struct
input_plugin
*
const
input_plugins
[]
=
{
&
input_plugin_file
,
#ifdef ENABLE_ARCHIVE
&
input_plugin_archive
,
#endif
#ifdef HAVE_CURL
&
input_plugin_curl
,
#endif
...
...
src/ls.c
View file @
0fe0425d
...
...
@@ -84,6 +84,7 @@ hasMusicSuffix(const char *utf8file, unsigned int next)
return
ret
;
}
#ifdef ENABLE_ARCHIVE
const
struct
archive_plugin
*
get_archive_by_suffix
(
const
char
*
utf8file
)
{
...
...
@@ -98,3 +99,4 @@ get_archive_by_suffix(const char *utf8file)
}
return
ret
;
}
#endif
src/main.c
View file @
0fe0425d
...
...
@@ -40,7 +40,6 @@
#include "permission.h"
#include "replay_gain.h"
#include "decoder_list.h"
#include "archive_list.h"
#include "audioOutput.h"
#include "input_stream.h"
#include "state_file.h"
...
...
@@ -52,6 +51,10 @@
#include "main_notify.h"
#include "os_compat.h"
#ifdef ENABLE_ARCHIVE
#include "archive_list.h"
#endif
#include <glib.h>
#ifdef HAVE_LOCALE
...
...
@@ -147,10 +150,12 @@ static void version(void)
"Supported outputs:
\n
"
);
printAllOutputPluginTypes
(
stdout
);
#ifdef ENABLE_ARCHIVE
puts
(
"
\n
"
"Supported archives:
\n
"
);
archive_plugin_init_all
();
archive_plugin_print_all_suffixes
(
stdout
);
#endif
}
static
void
parseOptions
(
int
argc
,
char
**
argv
,
Options
*
options
)
...
...
@@ -421,7 +426,9 @@ int main(int argc, char *argv[])
mapper_init
();
initPermissions
();
initPlaylist
();
#ifdef ENABLE_ARCHIVE
archive_plugin_init_all
();
#endif
decoder_plugin_init_all
();
update_global_init
();
...
...
@@ -507,7 +514,9 @@ int main(int argc, char *argv[])
command_finish
();
update_global_finish
();
decoder_plugin_deinit_all
();
#ifdef ENABLE_ARCHIVE
archive_plugin_deinit_all
();
#endif
music_pipe_free
();
cleanUpPidFile
();
finishConf
();
...
...
src/update.c
View file @
0fe0425d
...
...
@@ -276,6 +276,7 @@ make_subdir(struct directory *parent, const char *name)
return
directory
;
}
#ifdef ENABLE_ARCHIVE
static
void
update_archive_tree
(
struct
directory
*
directory
,
char
*
name
)
{
...
...
@@ -308,6 +309,7 @@ update_archive_tree(struct directory *directory, char *name)
}
}
}
#endif
static
bool
updateDirectory
(
struct
directory
*
directory
,
const
struct
stat
*
st
);
...
...
@@ -316,7 +318,10 @@ static void
updateInDirectory
(
struct
directory
*
directory
,
const
char
*
name
,
const
struct
stat
*
st
)
{
#ifdef ENABLE_ARCHIVE
const
struct
archive_plugin
*
archive
;
#endif
assert
(
strchr
(
name
,
'/'
)
==
NULL
);
if
(
S_ISREG
(
st
->
st_mode
)
&&
hasMusicSuffix
(
name
,
0
))
{
...
...
@@ -351,6 +356,7 @@ updateInDirectory(struct directory *directory,
ret
=
updateDirectory
(
subdir
,
st
);
if
(
!
ret
)
delete_directory
(
subdir
);
#ifdef ENABLE_ARCHIVE
}
else
if
(
S_ISREG
(
st
->
st_mode
)
&&
(
archive
=
get_archive_by_suffix
(
name
)))
{
struct
archive_file
*
archfile
;
char
pathname
[
MPD_PATH_MAX
];
...
...
@@ -380,6 +386,7 @@ updateInDirectory(struct directory *directory,
}
else
{
g_warning
(
"unable to open archive %s
\n
"
,
pathname
);
}
#endif
}
else
{
g_debug
(
"update: %s is not a directory, archive or music
\n
"
,
name
);
}
...
...
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