aac_plugin
git-svn-id: https://svn.musicpd.org/mpd/trunk@1250 09075e82-0dd4-0310-85a5-a0d7c8717e4f
This commit is contained in:
parent
3aba9b2a66
commit
9f0cbe9e49
@ -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)
|
||||
|
||||
|
@ -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: */
|
@ -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: */
|
18
src/tag.c
18
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;
|
||||
|
Loading…
Reference in New Issue
Block a user