nixpkgs/pkgs/tools/networking/fuppes/fuppes-faad-exanpse-backward-symbols-macro.patch
Nicolas Pierron 2cab2ce885 Fuppes: Fix support of faad2, backward compatibility macros were not
expanded in strings.

svn path=/nixpkgs/trunk/; revision=26864
2011-04-17 08:27:22 +00:00

92 lines
4.5 KiB
Diff

diff -x _inst -x _build -x .svn -ur fuppes-0.660/src/lib/Transcoding/FaadWrapper.cpp fuppes-0.660.new/src/lib/Transcoding/FaadWrapper.cpp
--- fuppes-0.660/src/lib/Transcoding/FaadWrapper.cpp 2009-11-19 10:16:25.000000000 +0100
+++ fuppes-0.660.new/src/lib/Transcoding/FaadWrapper.cpp 2011-01-30 22:25:34.171263052 +0100
@@ -329,13 +329,19 @@
CloseFile();
}
-
+
+// These macros are used to convert old function names to new ones based on
+// the #define declared in faad headers. The two-level macro are used to
+// expanse the macro which are gave to to_str.
+#define to_str_(fun) #fun
+#define to_str(fun) to_str_(fun)
+
bool CFaadWrapper::LoadLib()
{
#ifdef WIN32
- std::string sLibName = "libfaad-0.dll";
+ std::string sLibName = "libfaad-2.dll";
#else
- std::string sLibName = "libfaad.so.0";
+ std::string sLibName = "libfaad.so.2";
#endif
if(!CSharedConfig::Shared()->FaadLibName().empty()) {
@@ -350,54 +356,54 @@
return false;
}
- m_faacDecOpen = (faacDecOpen_t)FuppesGetProcAddress(m_LibHandle, "faacDecOpen");
+ m_faacDecOpen = (faacDecOpen_t)FuppesGetProcAddress(m_LibHandle, to_str(faacDecOpen));
if(!m_faacDecOpen) {
CSharedLog::Shared()->Log(L_EXT, "cannot load symbol 'faacDecOpen'", __FILE__, __LINE__);
return false;
}
- m_faacDecGetErrorMessage = (faacDecGetErrorMessage_t)FuppesGetProcAddress(m_LibHandle, "faacDecGetErrorMessage");
+ m_faacDecGetErrorMessage = (faacDecGetErrorMessage_t)FuppesGetProcAddress(m_LibHandle, to_str(faacDecGetErrorMessage));
if(!m_faacDecGetErrorMessage) {
CSharedLog::Shared()->Log(L_EXT, "cannot load symbol 'faacDecGetErrorMessage'", __FILE__, __LINE__);
return false;
}
- m_faacDecGetCurrentConfiguration = (faacDecGetCurrentConfiguration_t)FuppesGetProcAddress(m_LibHandle, "faacDecGetCurrentConfiguration");
+ m_faacDecGetCurrentConfiguration = (faacDecGetCurrentConfiguration_t)FuppesGetProcAddress(m_LibHandle, to_str(faacDecGetCurrentConfiguration));
if(!m_faacDecGetCurrentConfiguration) {
CSharedLog::Shared()->Log(L_EXT, "cannot load symbol 'faacDecGetCurrentConfiguration'", __FILE__, __LINE__);
}
- m_faacDecSetConfiguration = (faacDecSetConfiguration_t)FuppesGetProcAddress(m_LibHandle, "faacDecSetConfiguration");
+ m_faacDecSetConfiguration = (faacDecSetConfiguration_t)FuppesGetProcAddress(m_LibHandle, to_str(faacDecSetConfiguration));
if(!m_faacDecSetConfiguration) {
CSharedLog::Shared()->Log(L_EXT, "cannot load symbol 'faacDecSetConfiguration'", __FILE__, __LINE__);
}
- m_faacDecInit = (faacDecInit_t)FuppesGetProcAddress(m_LibHandle, "faacDecInit");
+ m_faacDecInit = (faacDecInit_t)FuppesGetProcAddress(m_LibHandle, to_str(faacDecInit));
if(!m_faacDecInit) {
CSharedLog::Shared()->Log(L_EXT, "cannot load symbol 'faacDecInit'", __FILE__, __LINE__);
}
- m_faacDecInit2 = (faacDecInit2_t)FuppesGetProcAddress(m_LibHandle, "faacDecInit2");
+ m_faacDecInit2 = (faacDecInit2_t)FuppesGetProcAddress(m_LibHandle, to_str(faacDecInit2));
if(!m_faacDecInit2) {
CSharedLog::Shared()->Log(L_EXT, "cannot load symbol 'faacDecInit2'", __FILE__, __LINE__);
return false;
}
- m_faacDecDecode = (faacDecDecode_t)FuppesGetProcAddress(m_LibHandle, "faacDecDecode");
+ m_faacDecDecode = (faacDecDecode_t)FuppesGetProcAddress(m_LibHandle, to_str(faacDecDecode));
if(!m_faacDecDecode) {
CSharedLog::Shared()->Log(L_EXT, "cannot load symbol 'faacDecDecode'", __FILE__, __LINE__);
return false;
}
- m_faacDecClose = (faacDecClose_t)FuppesGetProcAddress(m_LibHandle, "faacDecClose");
+ m_faacDecClose = (faacDecClose_t)FuppesGetProcAddress(m_LibHandle, to_str(faacDecClose));
if(!m_faacDecClose) {
CSharedLog::Shared()->Log(L_EXT, "cannot load symbol 'faacDecClose'", __FILE__, __LINE__);
return false;
}
- m_AudioSpecificConfig = (AudioSpecificConfig_t)FuppesGetProcAddress(m_LibHandle, "AudioSpecificConfig");
+ m_AudioSpecificConfig = (AudioSpecificConfig_t)FuppesGetProcAddress(m_LibHandle, to_str(AudioSpecificConfig));
if(!m_AudioSpecificConfig) {
- m_AudioSpecificConfig = (AudioSpecificConfig_t)FuppesGetProcAddress(m_LibHandle, "faacDecAudioSpecificConfig");
+ m_AudioSpecificConfig = (AudioSpecificConfig_t)FuppesGetProcAddress(m_LibHandle, to_str(faacDecAudioSpecificConfig));
if(!m_AudioSpecificConfig) {
CSharedLog::Shared()->Log(L_EXT, "cannot load symbol '(faacDec)AudioSpecificConfig'", __FILE__, __LINE__);
return false;