aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWarren Dukes <warren.dukes@gmail.com>2004-05-31 02:56:14 +0000
committerWarren Dukes <warren.dukes@gmail.com>2004-05-31 02:56:14 +0000
commit9f0cbe9e496d950e796e3b07bca8db8841bb2798 (patch)
tree488d281135b4c9c404aa9d2e6ff7f9915b924fb3
parent3aba9b2a668170babcafe4a4ee9b6ca684ed51e4 (diff)
downloadmpd-9f0cbe9e496d950e796e3b07bca8db8841bb2798.tar.gz
mpd-9f0cbe9e496d950e796e3b07bca8db8841bb2798.tar.xz
mpd-9f0cbe9e496d950e796e3b07bca8db8841bb2798.zip
aac_plugin
git-svn-id: https://svn.musicpd.org/mpd/trunk@1250 09075e82-0dd4-0310-85a5-a0d7c8717e4f
-rw-r--r--src/Makefile.am6
-rw-r--r--src/aac_decode.h35
-rw-r--r--src/inputPlugins/aac_plugin.c (renamed from src/aac_decode.c)54
-rw-r--r--src/tag.c18
4 files changed, 49 insertions, 64 deletions
diff --git a/src/Makefile.am b/src/Makefile.am
index e9b1f1a0e..ad1544e35 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -3,14 +3,14 @@ SUBDIRS = $(ID3_SUBDIR) $(MAD_SUBDIR) $(MP4FF_SUBDIR)
mpd_inputPlugins = inputPlugins/mp3_plugin.c inputPlugins/ogg_plugin.c \
inputPlugins/flac_plugin.c inputPlugins/audiofile_plugin.c \
- inputPlugins/mp4_plugin.c
+ inputPlugins/mp4_plugin.c inputPlugins/aac_plugin.c
mpd_headers = buffer2array.h interface.h command.h playlist.h ls.h \
song.h list.h directory.h tables.h utils.h path.h \
tag.h player.h listen.h conf.h volume.h \
audio.h playerData.h stats.h myfprintf.h sig_handlers.h decode.h log.h \
charConv.h permission.h mpd_types.h pcm_utils.h \
- aac_decode.h signal_check.h utf8.h inputStream.h \
+ signal_check.h utf8.h inputStream.h \
outputBuffer.h replayGain.h inputStream_file.h inputStream_http.h \
inputPlugin.h
mpd_SOURCES = main.c buffer2array.c interface.c command.c playlist.c ls.c \
@@ -18,7 +18,7 @@ mpd_SOURCES = main.c buffer2array.c interface.c command.c playlist.c ls.c \
tag.c player.c listen.c conf.c volume.c \
audio.c playerData.c stats.c myfprintf.c sig_handlers.c decode.c log.c \
charConv.c permission.c pcm_utils.c \
- aac_decode.c signal_check.c utf8.c inputStream.c outputBuffer.c \
+ signal_check.c utf8.c inputStream.c outputBuffer.c \
replayGain.c inputStream_file.c inputStream_http.c inputPlugin.c \
$(mpd_headers) $(mpd_inputPlugins)
diff --git a/src/aac_decode.h b/src/aac_decode.h
deleted file mode 100644
index 3d1636726..000000000
--- a/src/aac_decode.h
+++ /dev/null
@@ -1,35 +0,0 @@
-/* the Music Player Daemon (MPD)
- * (c)2003-2004 by Warren Dukes (shank@mercury.chem.pitt.edu)
- * This project's homepage is: http://www.musicpd.org
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-#ifndef AAC_DECODE_H
-#define AAC_DECODE_H
-
-#include "../config.h"
-
-#ifdef HAVE_FAAD
-
-#include "playerData.h"
-
-int getAacTotalTime(char * file);
-
-int aac_decode(OutputBuffer * cb, DecoderControl * dc);
-
-#endif /* HAVE_FAAD */
-
-#endif
-/* vim:set shiftwidth=4 tabstop=8 expandtab: */
diff --git a/src/aac_decode.c b/src/inputPlugins/aac_plugin.c
index 6dbaea1bc..0dd23f955 100644
--- a/src/aac_decode.c
+++ b/src/inputPlugins/aac_plugin.c
@@ -16,18 +16,17 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#include "aac_decode.h"
+#include "../inputPlugin.h"
#ifdef HAVE_FAAD
#define AAC_MAX_CHANNELS 6
-#include "command.h"
-#include "utils.h"
-#include "audio.h"
-#include "log.h"
-#include "inputStream.h"
-#include "outputBuffer.h"
+#include "../utils.h"
+#include "../audio.h"
+#include "../log.h"
+#include "../inputStream.h"
+#include "../outputBuffer.h"
#include <stdio.h>
#include <unistd.h>
@@ -396,5 +395,44 @@ int aac_decode(OutputBuffer * cb, DecoderControl * dc) {
return 0;
}
+MpdTag * aacTagDup(char * file) {
+ MpdTag * ret = NULL;
+ int time;
+
+ time = getAacTotalTime(file);
+
+ if(time>=0) {
+ if((ret = id3Dup(file))==NULL) ret = newMpdTag();
+ ret->time = time;
+ }
+
+ return ret;
+}
+
+char * aacSuffixes[] = {"aac", NULL};
+
+InputPlugin aacPlugin =
+{
+ "aac",
+ NULL,
+ aac_decode,
+ aacTagDup,
+ INPUT_PLUGIN_STREAM_FILE,
+ aacSuffixes,
+ NULL
+};
+
+#else
+
+InputPlugin aacPlugin =
+{
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ 0,
+ NULL,
+ NULL,
+};
+
#endif /* HAVE_FAAD */
-/* vim:set shiftwidth=4 tabstop=8 expandtab: */
diff --git a/src/tag.c b/src/tag.c
index d9fef82b9..954019eea 100644
--- a/src/tag.c
+++ b/src/tag.c
@@ -148,24 +148,6 @@ MpdTag * id3Dup(char * file) {
return ret;
}
-#ifdef HAVE_FAAD
-MpdTag * aacTagDup(char * utf8file) {
- MpdTag * ret = NULL;
- int time;
-
- time = getAacTotalTime(rmp2amp(utf8ToFsCharset(utf8file)));
-
- if(time>=0) {
- if((ret = id3Dup(utf8file))==NULL) ret = newMpdTag();
- ret->time = time;
- }
-
- if(ret) validateUtf8Tag(ret);
-
- return ret;
-}
-#endif
-
MpdTag * newMpdTag() {
MpdTag * ret = malloc(sizeof(MpdTag));
ret->album = NULL;