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
edcfbef9
Commit
edcfbef9
authored
Sep 08, 2005
by
Qball Cow
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Patch to make the configure flag for mpd-mad and mpd-libid3tag more logic (from ticho)
git-svn-id:
https://svn.musicpd.org/mpd/trunk@3477
09075e82-0dd4-0310-85a5-a0d7c8717e4f
parent
bc666a9f
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
84 additions
and
15 deletions
+84
-15
configure.ac
configure.ac
+3
-2
aac_plugin.c
src/inputPlugins/aac_plugin.c
+3
-0
audiofile_plugin.c
src/inputPlugins/audiofile_plugin.c
+3
-0
flac_plugin.c
src/inputPlugins/flac_plugin.c
+17
-1
mod_plugin.c
src/inputPlugins/mod_plugin.c
+9
-3
mp3_plugin.c
src/inputPlugins/mp3_plugin.c
+3
-0
mp4_plugin.c
src/inputPlugins/mp4_plugin.c
+4
-1
mpc_plugin.c
src/inputPlugins/mpc_plugin.c
+8
-2
ogg_plugin.c
src/inputPlugins/ogg_plugin.c
+5
-1
ls.c
src/ls.c
+22
-4
song.c
src/song.c
+6
-1
tag.c
src/tag.c
+1
-0
No files found.
configure.ac
View file @
edcfbef9
...
@@ -47,8 +47,9 @@ AC_ARG_ENABLE(audiofile,[ --disable-audiofile disable audiofile support, disabl
...
@@ -47,8 +47,9 @@ AC_ARG_ENABLE(audiofile,[ --disable-audiofile disable audiofile support, disabl
AC_ARG_ENABLE(mod,[ --enable-mod enable MOD support],enable_mod=yes,)
AC_ARG_ENABLE(mod,[ --enable-mod enable MOD support],enable_mod=yes,)
AC_ARG_ENABLE(mpc,[ --disable-mpc disable musepack (MPC) support],,enable_mpc=yes)
AC_ARG_ENABLE(mpc,[ --disable-mpc disable musepack (MPC) support],,enable_mpc=yes)
AC_ARG_ENABLE(id3,[ --disable-id3 disable id3 support],,enable_id3=yes)
AC_ARG_ENABLE(id3,[ --disable-id3 disable id3 support],,enable_id3=yes)
AC_ARG_ENABLE(mpd_mad,[ --enable-mpd-mad use mpd libmad],use_mpd_mad=yes,)
AC_ARG_ENABLE(mpd_id3tag,[ --enable-mpd-id3tag use mpd libid3tag],use_mpd_id3tag=yes,)
AC_ARG_ENABLE(mpd_mad,[ --enable-mpd-mad use mpd libmad],[use_mpd_mad=$enableval],[use_mpd_mad=no])
AC_ARG_ENABLE(mpd_id3tag,[ --enable-mpd-id3tag use mpd libid3tag],[use_mpd_id3tag=$enableval],[use_mpd_id3tag=no])
AC_ARG_WITH(tremor,[[ --with-tremor[=PFX] Use Tremor(vorbisidec) integer Ogg-Vorbis decoder (with optional prefix)]], use_tremor=yes; test x$withval != xyes && tremor_prefix="$withval",)
AC_ARG_WITH(tremor,[[ --with-tremor[=PFX] Use Tremor(vorbisidec) integer Ogg-Vorbis decoder (with optional prefix)]], use_tremor=yes; test x$withval != xyes && tremor_prefix="$withval",)
AC_ARG_WITH(tremor-libraries,[ --with-tremor-libraries=DIR Directory where Tremor library is installed (optional)], tremor_libraries="$withval", tremor_libraries="")
AC_ARG_WITH(tremor-libraries,[ --with-tremor-libraries=DIR Directory where Tremor library is installed (optional)], tremor_libraries="$withval", tremor_libraries="")
...
...
src/inputPlugins/aac_plugin.c
View file @
edcfbef9
...
@@ -405,6 +405,9 @@ MpdTag * aacTagDup(char * file) {
...
@@ -405,6 +405,9 @@ MpdTag * aacTagDup(char * file) {
if
((
ret
=
id3Dup
(
file
))
==
NULL
)
ret
=
newMpdTag
();
if
((
ret
=
id3Dup
(
file
))
==
NULL
)
ret
=
newMpdTag
();
ret
->
time
=
time
;
ret
->
time
=
time
;
}
}
else
{
DEBUG
(
"aacTagDup: Failed to get total song time from: %s
\n
"
,
file
);
}
return
ret
;
return
ret
;
}
}
...
...
src/inputPlugins/audiofile_plugin.c
View file @
edcfbef9
...
@@ -148,6 +148,9 @@ MpdTag * audiofileTagDup(char * file) {
...
@@ -148,6 +148,9 @@ MpdTag * audiofileTagDup(char * file) {
if
(
!
ret
)
ret
=
newMpdTag
();
if
(
!
ret
)
ret
=
newMpdTag
();
ret
->
time
=
time
;
ret
->
time
=
time
;
}
}
else
{
DEBUG
(
"audiofileTagDup: Failed to get total song time from: %s
\n
"
,
file
);
}
return
ret
;
return
ret
;
}
}
...
...
src/inputPlugins/flac_plugin.c
View file @
edcfbef9
...
@@ -533,6 +533,19 @@ MpdTag * flacMetadataDup(char * file, int * vorbisCommentFound) {
...
@@ -533,6 +533,19 @@ MpdTag * flacMetadataDup(char * file, int * vorbisCommentFound) {
it
=
FLAC__metadata_simple_iterator_new
();
it
=
FLAC__metadata_simple_iterator_new
();
if
(
!
FLAC__metadata_simple_iterator_init
(
it
,
file
,
1
,
0
))
{
if
(
!
FLAC__metadata_simple_iterator_init
(
it
,
file
,
1
,
0
))
{
switch
(
FLAC__metadata_simple_iterator_status
(
it
))
{
case
FLAC__METADATA_SIMPLE_ITERATOR_STATUS_ILLEGAL_INPUT
:
DEBUG
(
"flacMetadataDup: Reading '%s' metadata gave the following error: Illegal Input
\n
"
,
file
);
break
;
case
FLAC__METADATA_SIMPLE_ITERATOR_STATUS_ERROR_OPENING_FILE
:
DEBUG
(
"flacMetadataDup: Reading '%s' metadata gave the following error: Error Opening File
\n
"
,
file
);
break
;
case
FLAC__METADATA_SIMPLE_ITERATOR_STATUS_NOT_A_FLAC_FILE
:
DEBUG
(
"flacMetadataDup: Reading '%s' metadata gave the following error: Not A Flac File
\n
"
,
file
);
break
;
default:
DEBUG
(
"flacMetadataDup: Reading '%s' metadata failed
\n
"
,
file
);
}
FLAC__metadata_simple_iterator_delete
(
it
);
FLAC__metadata_simple_iterator_delete
(
it
);
return
ret
;
return
ret
;
}
}
...
@@ -564,7 +577,10 @@ MpdTag * flacTagDup(char * file) {
...
@@ -564,7 +577,10 @@ MpdTag * flacTagDup(char * file) {
int
foundVorbisComment
=
0
;
int
foundVorbisComment
=
0
;
ret
=
flacMetadataDup
(
file
,
&
foundVorbisComment
);
ret
=
flacMetadataDup
(
file
,
&
foundVorbisComment
);
if
(
!
ret
)
return
NULL
;
if
(
!
ret
)
{
DEBUG
(
"flacTagDup: Failed to grab information from: %s
\n
"
,
file
);
return
NULL
;
}
if
(
!
foundVorbisComment
)
{
if
(
!
foundVorbisComment
)
{
MpdTag
*
temp
=
id3Dup
(
file
);
MpdTag
*
temp
=
id3Dup
(
file
);
if
(
temp
)
{
if
(
temp
)
{
...
...
src/inputPlugins/mod_plugin.c
View file @
edcfbef9
...
@@ -212,10 +212,17 @@ MpdTag * modTagDup(char * file) {
...
@@ -212,10 +212,17 @@ MpdTag * modTagDup(char * file) {
MODULE
*
moduleHandle
;
MODULE
*
moduleHandle
;
char
*
title
;
char
*
title
;
if
(
mod_initMikMod
()
<
0
)
return
NULL
;
if
(
mod_initMikMod
()
<
0
)
{
DEBUG
(
"modTagDup: Failed to initialize MikMod
\n
"
);
return
NULL
;
}
if
(
!
(
moduleHandle
=
Player_Load
(
file
,
128
,
0
)))
goto
fail
;
if
(
!
(
moduleHandle
=
Player_Load
(
file
,
128
,
0
)))
{
DEBUG
(
"modTagDup: Failed to open file: %s
\n
"
,
file
);
MikMod_Exit
();
return
NULL
;
}
Player_Free
(
moduleHandle
);
Player_Free
(
moduleHandle
);
ret
=
newMpdTag
();
ret
=
newMpdTag
();
...
@@ -224,7 +231,6 @@ MpdTag * modTagDup(char * file) {
...
@@ -224,7 +231,6 @@ MpdTag * modTagDup(char * file) {
title
=
strdup
(
Player_LoadTitle
(
file
));
title
=
strdup
(
Player_LoadTitle
(
file
));
if
(
title
)
addItemToMpdTag
(
ret
,
TAG_ITEM_TITLE
,
title
);
if
(
title
)
addItemToMpdTag
(
ret
,
TAG_ITEM_TITLE
,
title
);
fail:
MikMod_Exit
();
MikMod_Exit
();
return
ret
;
return
ret
;
...
...
src/inputPlugins/mp3_plugin.c
View file @
edcfbef9
...
@@ -756,6 +756,9 @@ MpdTag * mp3_tagDup(char * file) {
...
@@ -756,6 +756,9 @@ MpdTag * mp3_tagDup(char * file) {
if
(
!
ret
)
ret
=
newMpdTag
();
if
(
!
ret
)
ret
=
newMpdTag
();
ret
->
time
=
time
;
ret
->
time
=
time
;
}
}
else
{
DEBUG
(
"mp3_tagDup: Failed to get total song time from: %s
\n
"
,
file
);
}
return
ret
;
return
ret
;
}
}
...
...
src/inputPlugins/mp4_plugin.c
View file @
edcfbef9
...
@@ -326,7 +326,10 @@ MpdTag * mp4DataDup(char * file, int * mp4MetadataFound) {
...
@@ -326,7 +326,10 @@ MpdTag * mp4DataDup(char * file, int * mp4MetadataFound) {
*
mp4MetadataFound
=
0
;
*
mp4MetadataFound
=
0
;
if
(
openInputStream
(
&
inStream
,
file
)
<
0
)
return
NULL
;
if
(
openInputStream
(
&
inStream
,
file
)
<
0
)
{
DEBUG
(
"mp4DataDup: Failed to open file: %s
\n
"
,
file
);
return
NULL
;
}
cb
=
malloc
(
sizeof
(
mp4ff_callback_t
));
cb
=
malloc
(
sizeof
(
mp4ff_callback_t
));
cb
->
read
=
mp4_inputStreamReadCallback
;
cb
->
read
=
mp4_inputStreamReadCallback
;
...
...
src/inputPlugins/mpc_plugin.c
View file @
edcfbef9
...
@@ -294,7 +294,10 @@ static float mpcGetTime(char * file) {
...
@@ -294,7 +294,10 @@ static float mpcGetTime(char * file) {
mpc_streaminfo_init
(
&
info
);
mpc_streaminfo_init
(
&
info
);
if
(
openInputStream
(
&
inStream
,
file
)
<
0
)
return
-
1
;
if
(
openInputStream
(
&
inStream
,
file
)
<
0
)
{
DEBUG
(
"mpcGetTime: Failed to open file: %s
\n
"
,
file
);
return
-
1
;
}
if
(
mpc_streaminfo_read
(
&
info
,
&
reader
)
!=
ERROR_CODE_OK
)
{
if
(
mpc_streaminfo_read
(
&
info
,
&
reader
)
!=
ERROR_CODE_OK
)
{
closeInputStream
(
&
inStream
);
closeInputStream
(
&
inStream
);
...
@@ -312,7 +315,10 @@ static MpdTag * mpcTagDup(char * file) {
...
@@ -312,7 +315,10 @@ static MpdTag * mpcTagDup(char * file) {
MpdTag
*
ret
=
NULL
;
MpdTag
*
ret
=
NULL
;
float
time
=
mpcGetTime
(
file
);
float
time
=
mpcGetTime
(
file
);
if
(
time
<
0
)
return
NULL
;
if
(
time
<
0
)
{
DEBUG
(
"mpcTagDup: Failed to get Songlength of file: %s
\n
"
,
file
);
return
NULL
;
}
ret
=
apeDup
(
file
);
ret
=
apeDup
(
file
);
if
(
!
ret
)
ret
=
id3Dup
(
file
);
if
(
!
ret
)
ret
=
id3Dup
(
file
);
...
...
src/inputPlugins/ogg_plugin.c
View file @
edcfbef9
...
@@ -366,7 +366,11 @@ MpdTag * oggTagDup(char * file) {
...
@@ -366,7 +366,11 @@ MpdTag * oggTagDup(char * file) {
OggVorbis_File
vf
;
OggVorbis_File
vf
;
fp
=
fopen
(
file
,
"r"
);
fp
=
fopen
(
file
,
"r"
);
if
(
!
fp
)
return
NULL
;
if
(
!
fp
)
{
DEBUG
(
"oggTagDup: Failed to open file: '%s', %s
\n
"
,
file
,
strerror
(
errno
));
return
NULL
;
}
if
(
ov_open
(
fp
,
&
vf
,
NULL
,
0
)
<
0
)
{
if
(
ov_open
(
fp
,
&
vf
,
NULL
,
0
)
<
0
)
{
fclose
(
fp
);
fclose
(
fp
);
return
NULL
;
return
NULL
;
...
...
src/ls.c
View file @
edcfbef9
...
@@ -30,6 +30,8 @@
...
@@ -30,6 +30,8 @@
#include <stdio.h>
#include <stdio.h>
#include <string.h>
#include <string.h>
#include <stdlib.h>
#include <stdlib.h>
#include <errno.h>
extern
int
errno
;
char
*
dupAndStripPlaylistSuffix
(
char
*
file
)
{
char
*
dupAndStripPlaylistSuffix
(
char
*
file
)
{
size_t
size
=
strlen
(
file
)
-
strlen
(
PLAYLIST_FILE_SUFFIX
)
-
1
;
size_t
size
=
strlen
(
file
)
-
strlen
(
PLAYLIST_FILE_SUFFIX
)
-
1
;
...
@@ -210,7 +212,14 @@ int isFile(char * utf8file, time_t * mtime) {
...
@@ -210,7 +212,14 @@ int isFile(char * utf8file, time_t * mtime) {
if
(
mtime
)
*
mtime
=
st
.
st_mtime
;
if
(
mtime
)
*
mtime
=
st
.
st_mtime
;
return
1
;
return
1
;
}
}
else
return
0
;
else
{
DEBUG
(
"isFile: %s is not a regular file
\n
"
,
utf8file
);
return
0
;
}
}
else
{
DEBUG
(
"isFile: failed to stat: %s: %s
\n
"
,
utf8file
,
strerror
(
errno
));
}
}
return
0
;
return
0
;
...
@@ -257,15 +266,24 @@ InputPlugin * hasMusicSuffix(char * utf8file) {
...
@@ -257,15 +266,24 @@ InputPlugin * hasMusicSuffix(char * utf8file) {
InputPlugin
*
ret
=
NULL
;
InputPlugin
*
ret
=
NULL
;
char
*
s
=
getSuffix
(
utf8file
);
char
*
s
=
getSuffix
(
utf8file
);
if
(
s
)
ret
=
getInputPluginFromSuffix
(
s
);
if
(
s
)
{
ret
=
getInputPluginFromSuffix
(
s
);
}
else
{
DEBUG
(
"hasMusicSuffix: The file: %s has no valid suffix
\n
"
,
utf8file
);
}
return
ret
;
return
ret
;
}
}
InputPlugin
*
isMusic
(
char
*
utf8file
,
time_t
*
mtime
)
{
InputPlugin
*
isMusic
(
char
*
utf8file
,
time_t
*
mtime
)
{
if
(
isFile
(
utf8file
,
mtime
))
{
if
(
isFile
(
utf8file
,
mtime
))
{
return
hasMusicSuffix
(
utf8file
);
InputPlugin
*
plugin
=
hasMusicSuffix
(
utf8file
);
if
(
plugin
==
NULL
)
{
DEBUG
(
"isMusic: %s is not a supported music file
\n
"
);
}
return
plugin
;
}
}
DEBUG
(
"isMusic: %s is not a valid file
\n
"
,
utf8file
);
return
NULL
;
return
NULL
;
}
}
src/song.c
View file @
edcfbef9
...
@@ -49,7 +49,10 @@ Song * newNullSong() {
...
@@ -49,7 +49,10 @@ Song * newNullSong() {
Song
*
newSong
(
char
*
url
,
int
type
,
Directory
*
parentDir
)
{
Song
*
newSong
(
char
*
url
,
int
type
,
Directory
*
parentDir
)
{
Song
*
song
=
NULL
;
Song
*
song
=
NULL
;
if
(
strchr
(
url
,
'\n'
))
return
NULL
;
if
(
strchr
(
url
,
'\n'
))
{
DEBUG
(
"newSong: '%s' is not a valid uri
\n
"
);
return
NULL
;
}
song
=
newNullSong
();
song
=
newNullSong
();
...
@@ -104,6 +107,8 @@ Song * addSongToList(SongList * list, char * url, char * utf8path,
...
@@ -104,6 +107,8 @@ Song * addSongToList(SongList * list, char * url, char * utf8path,
case
SONG_TYPE_URL
:
case
SONG_TYPE_URL
:
song
=
newSong
(
url
,
songType
,
parentDirectory
);
song
=
newSong
(
url
,
songType
,
parentDirectory
);
break
;
break
;
default:
DEBUG
(
"addSongToList: Trying to add an invalid song type
\n
"
);
}
}
if
(
song
==
NULL
)
return
NULL
;
if
(
song
==
NULL
)
return
NULL
;
...
...
src/tag.c
View file @
edcfbef9
...
@@ -185,6 +185,7 @@ MpdTag * id3Dup(char * file) {
...
@@ -185,6 +185,7 @@ MpdTag * id3Dup(char * file) {
id3_file
=
id3_file_open
(
file
,
ID3_FILE_MODE_READONLY
);
id3_file
=
id3_file_open
(
file
,
ID3_FILE_MODE_READONLY
);
if
(
!
id3_file
)
{
if
(
!
id3_file
)
{
DEBUG
(
"id3Dup: Failed to open file: '%s', %s
\n
"
,
file
,
strerror
(
errno
));
return
NULL
;
return
NULL
;
}
}
...
...
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