|
From: Lasse Kärkkäi. <tr...@us...> - 2009-07-06 02:26:50
|
Module: performous
Branch: master
Commit: cad69d5e53023729ea652bbbd592f87eb829ca87
Author: Lasse Karkkainen <tro...@tr...>
Date: Mon Jul 6 05:14:31 2009 +0300
Remove faac support/requirement from ss_extract.
---
tools/CMakeLists.txt | 12 ++++++------
tools/ss_extract.cpp | 11 +++--------
2 files changed, 9 insertions(+), 14 deletions(-)
diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt
index 2117521..ad59253 100644
--- a/tools/CMakeLists.txt
+++ b/tools/CMakeLists.txt
@@ -12,7 +12,7 @@ find_package(Boost 1.34 REQUIRED COMPONENTS filesystem)
include_directories(${Boost_INCLUDE_DIRS})
# Find all the libs that don't require extra parameters
-foreach(lib LibXML++ Magick++ FAAC)
+foreach(lib LibXML++ Magick++)
find_package(${lib})
if (${lib}_FOUND)
include_directories(${${lib}_INCLUDE_DIRS})
@@ -28,13 +28,13 @@ if(CMAKE_COMPILER_IS_GNUCXX)
endif(CMAKE_COMPILER_IS_GNUCXX)
if (LibXML++_FOUND)
- if (Boost_FOUND AND FAAC_FOUND)
+ if (Boost_FOUND)
add_executable(ss_extract ss_extract.cpp pak.cpp ipu_conv.cpp)
- target_link_libraries(ss_extract ${LibXML++_LIBRARIES} ${Boost_LIBRARIES} ${FAAC_LIBRARIES})
+ target_link_libraries(ss_extract ${LibXML++_LIBRARIES} ${Boost_LIBRARIES})
set(targets ${targets} ss_extract)
- else (Boost_FOUND AND FAAC_FOUND)
- message("Boost.Filesystem or libfaac not found, not building ss_extract")
- endif (Boost_FOUND AND FAAC_FOUND)
+ else (Boost_FOUND)
+ message("Boost.Filesystem not found, not building ss_extract")
+ endif (Boost_FOUND)
if (Magick++_FOUND)
add_executable(cover_conv cover_conv.cpp pak.cpp)
diff --git a/tools/ss_extract.cpp b/tools/ss_extract.cpp
index 174bf04..bb6f35e 100644
--- a/tools/ss_extract.cpp
+++ b/tools/ss_extract.cpp
@@ -15,7 +15,6 @@
#include <boost/filesystem.hpp>
-#include "faac.hh"
#include "pak.h"
#include "ipuconv.hh"
@@ -29,7 +28,6 @@ xmlpp::Node::PrefixNsMap nsmap;
std::string ns;
const bool video = true;
const bool mkvcompress = false;
-const bool aacenc = false;
// LibXML2 logging facility
extern "C" void xmlLogger(void* logger, char const* msg, ...) { if (logger) *(std::ostream*)logger << msg; }
@@ -158,11 +156,8 @@ void writeWavHeader(std::ostream& outfile, unsigned ch, unsigned sr, unsigned sa
void writeMusic(fs::path const& filename, std::vector<short> const& buf, unsigned sr) {
std::ofstream f(filename.string().c_str(), std::ios::binary);
- if (aacenc) faac::Enc(sr, 2, f)(buf.begin(), buf.end()).close();
- else {
- writeWavHeader(f, 2, sr, buf.size());
- f.write(reinterpret_cast<char const*>(&buf[0]), buf.size() * sizeof(short));
- }
+ writeWavHeader(f, 2, sr, buf.size());
+ f.write(reinterpret_cast<char const*>(&buf[0]), buf.size() * sizeof(short));
}
void music(Song& song, PakFile const& dataFile, PakFile const& headerFile, fs::path const& outPath) {
@@ -190,7 +185,7 @@ void music(Song& song, PakFile const& dataFile, PakFile const& headerFile, fs::p
if (l2 != 0 || r2 != 0) karaoke = true;
}
}
- std::string ext = (aacenc ? ".m4a" : ".wav");
+ std::string ext = ".wav";
writeMusic(song.music = outPath / ("music" + ext), pcm[0], sr);
if (karaoke) writeMusic(song.vocals = outPath / ("vocals" + ext), pcm[1], sr);
}
|