bunch of autotool cleanups
git-svn-id: https://svn.musicpd.org/mpd/trunk@271 09075e82-0dd4-0310-85a5-a0d7c8717e4f
This commit is contained in:
@@ -13,3 +13,5 @@ mpd_SOURCES = main.c buffer2array.c interface.c command.c playlist.c ls.c \
|
||||
|
||||
mpd_CFLAGS = $(MPD_CFLAGS)
|
||||
mpd_LDADD = $(MPD_LIBS) $(ID3_LIB) $(MAD_LIB) $(MP4FF_LIB)
|
||||
|
||||
DIST_SUBDIRS = mp4ff
|
||||
|
@@ -19,6 +19,8 @@
|
||||
#ifndef AUDIO_H
|
||||
#define AUDIO_H
|
||||
|
||||
#include "../config.h"
|
||||
|
||||
#include "mpd_types.h"
|
||||
|
||||
#include <stdio.h>
|
||||
|
@@ -18,10 +18,10 @@
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#ifdef HAVE_AUDIOFILE
|
||||
|
||||
#include "audiofile_decode.h"
|
||||
|
||||
#ifdef HAVE_AUDIOFILE
|
||||
|
||||
#include "command.h"
|
||||
#include "utils.h"
|
||||
#include "audio.h"
|
||||
|
@@ -21,6 +21,8 @@
|
||||
#ifndef AUDIOFILE_DECODE_H
|
||||
#define AUDIOFILE_DECODE_H
|
||||
|
||||
#include "../config.h"
|
||||
|
||||
#ifdef HAVE_AUDIOFILE
|
||||
|
||||
#include "playerData.h"
|
||||
|
@@ -19,6 +19,8 @@
|
||||
#ifndef BUFFER_2_ARRAY_H
|
||||
#define BUFFER_2_ARRAY_H
|
||||
|
||||
#include "../config.h"
|
||||
|
||||
int buffer2array(char * buffer, char *** array);
|
||||
|
||||
void freeArgArray(char ** array, int argArrayLength);
|
||||
|
@@ -19,6 +19,8 @@
|
||||
#ifndef CHAR_CONV_H
|
||||
#define CHAR_CONV_H
|
||||
|
||||
#include "../config.h"
|
||||
|
||||
int setCharSetConversion(char * to, char * from);
|
||||
|
||||
char * convStrDup(char * string);
|
||||
|
@@ -19,6 +19,8 @@
|
||||
#ifndef COMMAND_H
|
||||
#define COMMAND_H
|
||||
|
||||
#include "../config.h"
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#define COMMAND_RETURN_KILL 10
|
||||
|
@@ -19,6 +19,8 @@
|
||||
#ifndef CONF_H
|
||||
#define CONF_H
|
||||
|
||||
#include "../config.h"
|
||||
|
||||
#define CONF_PORT 0
|
||||
#define CONF_MUSIC_DIRECTORY 1
|
||||
#define CONF_PLAYLIST_DIRECTORY 2
|
||||
|
@@ -19,6 +19,8 @@
|
||||
#ifndef DECODE_H
|
||||
#define DECODE_H
|
||||
|
||||
#include "../config.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <sys/param.h>
|
||||
|
||||
@@ -26,8 +28,7 @@
|
||||
#define DECODE_TYPE_OGG 1
|
||||
#define DECODE_TYPE_FLAC 2
|
||||
#define DECODE_TYPE_AUDIOFILE 3
|
||||
#define DECODE_TYPE_AAC 4
|
||||
#define DECODE_TYPE_MP4 5
|
||||
#define DECODE_TYPE_MP4 4
|
||||
|
||||
#define DECODE_STATE_STOP 0
|
||||
#define DECODE_STATE_DECODE 1
|
||||
|
@@ -19,6 +19,8 @@
|
||||
#ifndef DIRECTORY_H
|
||||
#define DIRECTORY_H
|
||||
|
||||
#include "../config.h"
|
||||
|
||||
#include "song.h"
|
||||
|
||||
#include <stdio.h>
|
||||
|
@@ -16,9 +16,10 @@
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#ifdef HAVE_FLAC
|
||||
#include "flac_decode.h"
|
||||
|
||||
#ifdef HAVE_FLAC
|
||||
|
||||
#include "utils.h"
|
||||
#include "log.h"
|
||||
#include "pcm_utils.h"
|
||||
|
@@ -19,6 +19,8 @@
|
||||
#ifndef FLAC_DECODE_H
|
||||
#define FLAC_DECODE_H
|
||||
|
||||
#include "../config.h"
|
||||
|
||||
#include "playerData.h"
|
||||
|
||||
#include <stdio.h>
|
||||
|
@@ -19,6 +19,8 @@
|
||||
#ifndef INTERFACE_H
|
||||
#define INTERFACE_H
|
||||
|
||||
#include "../config.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <time.h>
|
||||
#include <sys/types.h>
|
||||
|
@@ -20,6 +20,8 @@
|
||||
#ifndef LIST_H
|
||||
#define LIST_H
|
||||
|
||||
#include "../config.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
/* used to make a list where free() will be used to free data in list */
|
||||
|
@@ -19,6 +19,8 @@
|
||||
#ifndef LISTEN_H
|
||||
#define LISTEN_H
|
||||
|
||||
#include "../config.h"
|
||||
|
||||
extern int listenSocket;
|
||||
|
||||
int establish(unsigned short port);
|
||||
|
@@ -19,6 +19,8 @@
|
||||
#ifndef LOG_H
|
||||
#define LOG_H
|
||||
|
||||
#include "../config.h"
|
||||
|
||||
#include "myfprintf.h"
|
||||
|
||||
#define LOG_LEVEL_LOW 0
|
||||
|
30
src/ls.c
30
src/ls.c
@@ -126,7 +126,6 @@ int isMusic(char * utf8file, time_t * mtime) {
|
||||
if((ret = isWave(utf8file,mtime))) return ret;
|
||||
#endif
|
||||
#ifdef HAVE_FAAD
|
||||
if((ret = isAac(utf8file,mtime))) return ret;
|
||||
if((ret = isMp4(utf8file,mtime))) return ret;
|
||||
#endif
|
||||
|
||||
@@ -281,35 +280,6 @@ int isMp4(char * utf8file, time_t * mtime) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
int isAac(char * utf8file, time_t * mtime) {
|
||||
struct stat st;
|
||||
char * file = utf8ToFsCharset(utf8file);
|
||||
char * actualFile = file;
|
||||
|
||||
if(actualFile[0]!='/') actualFile = rmp2amp(file);
|
||||
|
||||
if(stat(actualFile,&st)==0) {
|
||||
if(S_ISREG(st.st_mode)) {
|
||||
char * dup;
|
||||
char * cLast;
|
||||
char * cNext;
|
||||
int ret = 0;
|
||||
dup = strdup(file);
|
||||
cNext = cLast = strtok(dup,".");
|
||||
while((cNext = strtok(NULL,"."))) cLast = cNext;
|
||||
if(cLast && 0==strcasecmp(cLast,"aac")) {
|
||||
if(mtime) *mtime = st.st_mtime;
|
||||
ret = 1;
|
||||
}
|
||||
free(dup);
|
||||
return ret;
|
||||
}
|
||||
else return 0;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int isMp3(char * utf8file, time_t * mtime) {
|
||||
struct stat st;
|
||||
char * file = utf8ToFsCharset(utf8file);
|
||||
|
4
src/ls.h
4
src/ls.h
@@ -19,6 +19,8 @@
|
||||
#ifndef LS_H
|
||||
#define LS_H
|
||||
|
||||
#include "../config.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <time.h>
|
||||
|
||||
@@ -26,8 +28,6 @@ int lsPlaylists(FILE * fp, char * utf8path);
|
||||
|
||||
int isMp3(char * utf8file, time_t * mtime);
|
||||
|
||||
int isAac(char * utf8file, time_t * mtime);
|
||||
|
||||
int isMp4(char * utf8file, time_t * mtime);
|
||||
|
||||
int isOgg(char * utf8file, time_t * mtime);
|
||||
|
@@ -16,9 +16,10 @@
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#include "mp3_decode.h"
|
||||
|
||||
#ifdef HAVE_MAD
|
||||
|
||||
#include "mp3_decode.h"
|
||||
#include "pcm_utils.h"
|
||||
#ifdef USE_MPD_MAD
|
||||
#include "libmad/mad.h"
|
||||
|
@@ -19,6 +19,8 @@
|
||||
#ifndef MP3_DECODE_H
|
||||
#define MP3_DECODE_H
|
||||
|
||||
#include "../config.h"
|
||||
|
||||
#ifdef HAVE_MAD
|
||||
|
||||
#include "playerData.h"
|
||||
|
@@ -19,6 +19,8 @@
|
||||
#ifndef MPD_TYPES_H
|
||||
#define MPD_TYPES_H
|
||||
|
||||
#include "../config.h"
|
||||
|
||||
typedef unsigned char mpd_uint8;
|
||||
typedef signed char mpd_sint8;
|
||||
|
||||
|
@@ -19,6 +19,8 @@
|
||||
#ifndef MYFPRINTF_H
|
||||
#define MYFPRINTF_H
|
||||
|
||||
#include "../config.h"
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
void myfprintfStdLogMode(FILE * out, FILE * err);
|
||||
|
@@ -16,9 +16,10 @@
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#ifdef HAVE_OGG
|
||||
#include "ogg_decode.h"
|
||||
|
||||
#ifdef HAVE_OGG
|
||||
|
||||
#include "command.h"
|
||||
#include "utils.h"
|
||||
#include "audio.h"
|
||||
|
@@ -19,6 +19,8 @@
|
||||
#ifndef OGG_DECODE_H
|
||||
#define OGG_DECODE_H
|
||||
|
||||
#include "../config.h"
|
||||
|
||||
#include "playerData.h"
|
||||
|
||||
#include <stdio.h>
|
||||
|
12
src/path.c
12
src/path.c
@@ -24,8 +24,8 @@
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#ifdef HAVE_LOCALE
|
||||
#ifdef HAVE_LANGINFO
|
||||
#ifdef HAVE_LC_MESSAGES
|
||||
#ifdef HAVE_LANGINFO_CODESET
|
||||
#include <locale.h>
|
||||
#include <langinfo.h>
|
||||
#endif
|
||||
@@ -87,8 +87,8 @@ char * getFsCharset() {
|
||||
}
|
||||
|
||||
void initPaths() {
|
||||
#ifdef HAVE_LOCALE
|
||||
#ifdef HAVE_LANGINFO
|
||||
#ifdef HAVE_LC_MESSAGES
|
||||
#ifdef HAVE_LANGINFO_CODESET
|
||||
char * originalLocale;
|
||||
#endif
|
||||
#endif
|
||||
@@ -97,8 +97,8 @@ void initPaths() {
|
||||
if(getConf()[CONF_FS_CHARSET]) {
|
||||
charset = strdup(getConf()[CONF_FS_CHARSET]);
|
||||
}
|
||||
#ifdef HAVE_LOCALE
|
||||
#ifdef HAVE_LANGINFO
|
||||
#ifdef HAVE_LC_MESSAGES
|
||||
#ifdef HAVE_LANGINFO_CODESET
|
||||
else if((originalLocale = setlocale(LC_ALL,""))) {
|
||||
char * temp;
|
||||
|
||||
|
@@ -19,6 +19,8 @@
|
||||
#ifndef PATH_H
|
||||
#define PATH_H
|
||||
|
||||
#include "../config.h"
|
||||
|
||||
#include <sys/param.h>
|
||||
|
||||
extern char musicDir[MAXPATHLEN+1];
|
||||
|
@@ -19,6 +19,8 @@
|
||||
#ifndef PCM_UTILS_H
|
||||
#define PMC_UTILS_H
|
||||
|
||||
#include "../config.h"
|
||||
|
||||
#include "audio.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
|
@@ -19,6 +19,8 @@
|
||||
#ifndef PERMISSION_H
|
||||
#define PERMISSION_H
|
||||
|
||||
#include "../config.h"
|
||||
|
||||
#define PERMISSION_READ 1
|
||||
#define PERMISSION_ADD 2
|
||||
#define PERMISSION_CONTROL 4
|
||||
|
@@ -178,7 +178,6 @@ int playerPlay(FILE * fp, char * utf8file) {
|
||||
else if(isWave(utf8file,NULL)) pc->decodeType = DECODE_TYPE_AUDIOFILE;
|
||||
#endif
|
||||
#ifdef HAVE_FAAD
|
||||
else if(isAac(utf8file,NULL)) pc->decodeType = DECODE_TYPE_AAC;
|
||||
else if(isMp4(utf8file,NULL)) pc->decodeType = DECODE_TYPE_MP4;
|
||||
#endif
|
||||
else {
|
||||
|
@@ -19,6 +19,8 @@
|
||||
#ifndef PLAYER_H
|
||||
#define PLAYER_H
|
||||
|
||||
#include "../config.h"
|
||||
|
||||
#include "mpd_types.h"
|
||||
|
||||
#include <stdio.h>
|
||||
|
@@ -19,6 +19,8 @@
|
||||
#ifndef PLAYER_DATA_H
|
||||
#define PLAYER_DATA_H
|
||||
|
||||
#include "../config.h"
|
||||
|
||||
#include "audio.h"
|
||||
#include "player.h"
|
||||
#include "decode.h"
|
||||
|
@@ -19,6 +19,8 @@
|
||||
#ifndef PLAYLIST_H
|
||||
#define PLAYLIST_H
|
||||
|
||||
#include "../config.h"
|
||||
|
||||
#include "song.h"
|
||||
|
||||
#include <stdio.h>
|
||||
|
@@ -19,6 +19,8 @@
|
||||
#ifndef SIG_HANDLERS_H
|
||||
#define SIG_HANDLERS_H
|
||||
|
||||
#include "../config.h"
|
||||
|
||||
void initSigHandlers();
|
||||
|
||||
void finishSigHandlers();
|
||||
|
@@ -79,9 +79,6 @@ Song * newSong(char * utf8file) {
|
||||
}
|
||||
#endif
|
||||
#ifdef HAVE_FAAD
|
||||
else if(isAac(utf8file,&(song->mtime))) {
|
||||
song->tag = aacTagDup(utf8file);
|
||||
}
|
||||
else if(isMp4(utf8file,&(song->mtime))) {
|
||||
song->tag = mp4TagDup(utf8file);
|
||||
}
|
||||
@@ -249,9 +246,6 @@ int updateSongInfo(Song * song) {
|
||||
}
|
||||
#endif
|
||||
#ifdef HAVE_FAAD
|
||||
else if(isAac(utf8file,&(song->mtime))) {
|
||||
song->tag = aacTagDup(utf8file);
|
||||
}
|
||||
else if(isMp4(utf8file,&(song->mtime))) {
|
||||
song->tag = mp4TagDup(utf8file);
|
||||
}
|
||||
|
@@ -19,6 +19,8 @@
|
||||
#ifndef SONG_H
|
||||
#define SONG_H
|
||||
|
||||
#include "../config.h"
|
||||
|
||||
#define SONG_BEGIN "songList begin"
|
||||
#define SONG_END "songList end"
|
||||
|
||||
|
@@ -19,6 +19,8 @@
|
||||
#ifndef STATS_H
|
||||
#define STATS_H
|
||||
|
||||
#include "../config.h"
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
typedef struct _Stats {
|
||||
|
@@ -19,6 +19,8 @@
|
||||
#ifndef TABLES_H
|
||||
#define TABLES_H
|
||||
|
||||
#include "../config.h"
|
||||
|
||||
#include "song.h"
|
||||
|
||||
#include <stdio.h>
|
||||
|
16
src/tag.c
16
src/tag.c
@@ -299,22 +299,6 @@ MpdTag * mp4TagDup(char * utf8file) {
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
MpdTag * aacTagDup(char * utf8file) {
|
||||
MpdTag * ret = NULL;
|
||||
int time;
|
||||
|
||||
#warning getMp4TotalTime needs implementing
|
||||
//time = getAacTotalTime(rmp2amp(utf8ToFsCharset(utf8file)));
|
||||
time = 0;
|
||||
|
||||
if(time>=0) {
|
||||
if(!ret) ret = newMpdTag();
|
||||
ret->time = time;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_OGG
|
||||
|
@@ -19,6 +19,8 @@
|
||||
#ifndef TAG_H
|
||||
#define TAG_H
|
||||
|
||||
#include "../config.h"
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
typedef struct _MpdTag {
|
||||
@@ -39,7 +41,6 @@ MpdTag * mp3TagDup(char * utf8file);
|
||||
|
||||
#ifdef HAVE_FAAD
|
||||
MpdTag * mp4TagDup(char * utf8file);
|
||||
MpdTag * aacTagDup(char * utf8file);
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_OGG
|
||||
|
@@ -19,6 +19,8 @@
|
||||
#ifndef UTILS_H
|
||||
#define UTILS_H
|
||||
|
||||
#include "../config.h"
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
char * myFgets(char * buffer, int bufferSize, FILE * fp);
|
||||
|
@@ -19,6 +19,8 @@
|
||||
#ifndef VOLUME_H
|
||||
#define VOLUME_H
|
||||
|
||||
#include "../config.h"
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#define VOLUME_MIXER_OSS "oss"
|
||||
|
Reference in New Issue
Block a user