diff --git a/src/ff-plugins.h b/src/ff-plugins.h
index b7ecca01..a153fc20 100644
--- a/src/ff-plugins.h
+++ b/src/ff-plugins.h
@@ -25,7 +25,11 @@
#include "ff-dbstruct.h"
#ifdef WIN32
-# define EXPORT __declspec(dllimport)
+# ifdef _WINDLL
+# define EXPORT __declspec(dllimport)
+# else
+# define EXPORT __declspec(dllexport)
+# endif
#else
# define EXPORT
#endif
@@ -129,10 +133,14 @@ typedef struct tag_db_query {
void *priv;
} DB_QUERY;
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/* webserver functions */
-extern EXPORT EXPORT char *pi_ws_uri(struct tag_ws_conninfo *);
-extern EXPORT EXPORT void pi_ws_will_close(struct tag_ws_conninfo *);
-extern EXPORT EXPORT int pi_ws_returnerror(struct tag_ws_conninfo *, int, char *);
+extern EXPORT char *pi_ws_uri(struct tag_ws_conninfo *);
+extern EXPORT void pi_ws_will_close(struct tag_ws_conninfo *);
+extern EXPORT int pi_ws_returnerror(struct tag_ws_conninfo *, int, char *);
extern EXPORT char *pi_ws_getvar(struct tag_ws_conninfo *, char *);
extern EXPORT int pi_ws_writefd(struct tag_ws_conninfo *, char *, ...);
extern EXPORT int pi_ws_addresponseheader(struct tag_ws_conninfo *, char *, char *, ...);
@@ -173,5 +181,8 @@ extern EXPORT int pi_conf_get_int(char *section, char *key, int dflt);
extern EXPORT void pi_config_set_status(struct tag_ws_conninfo *pwsc, int session, char *fmt, ...);
+#ifdef __cplusplus
+}
+#endif
#endif /* _FF_PLUGINS_ */
diff --git a/src/plugins/ssc-ffmpeg.c b/src/plugins/ssc-ffmpeg.c
index efa7ca6b..0b2b94bd 100644
--- a/src/plugins/ssc-ffmpeg.c
+++ b/src/plugins/ssc-ffmpeg.c
@@ -110,8 +110,6 @@ int ssc_ffmpeg_close(void *pv);
int ssc_ffmpeg_read(void *pv, char *buffer, int len);
char *ssc_ffmpeg_error(void *pv);
-PLUGIN_INFO *plugin_info(PLUGIN_INPUT_FN*);
-
/* Globals */
PLUGIN_TRANSCODE_FN _ptfn = {
ssc_ffmpeg_init,
@@ -122,8 +120,6 @@ PLUGIN_TRANSCODE_FN _ptfn = {
ssc_ffmpeg_error
};
-PLUGIN_INPUT_FN *_ppi;
-
PLUGIN_INFO _pi = {
PLUGIN_VERSION, /* version */
PLUGIN_TRANSCODE, /* type */
@@ -141,8 +137,7 @@ char *ssc_ffmpeg_error(void *pv) {
return ssc_ffmpeg_errors[handle->errnum];
}
-PLUGIN_INFO *plugin_info(PLUGIN_INPUT_FN *ppi) {
- _ppi = ppi;
+PLUGIN_INFO *plugin_info(void) {
av_register_all();
return &_pi;
diff --git a/src/plugins/ssc-wma.cpp b/src/plugins/ssc-wma.cpp
index 90829375..ada31dd4 100644
--- a/src/plugins/ssc-wma.cpp
+++ b/src/plugins/ssc-wma.cpp
@@ -73,8 +73,6 @@ int ssc_wma_close(void *pv);
int ssc_wma_read(void *pv, char *buffer, int len);
char *ssc_wma_error(void *pv);
-PLUGIN_INFO *plugin_info(PLUGIN_INPUT_FN*);
-
/* Globals */
PLUGIN_TRANSCODE_FN _ptfn = {
ssc_wma_init,
@@ -85,8 +83,6 @@ PLUGIN_TRANSCODE_FN _ptfn = {
ssc_wma_error
};
-PLUGIN_INPUT_FN *_ppi;
-
PLUGIN_INFO _pi = {
PLUGIN_VERSION, /* version */
PLUGIN_TRANSCODE, /* type */
@@ -107,8 +103,7 @@ char *ssc_wma_error(void *pv) {
return _ssc_wma_errors[handle->errnum];
}
-PLUGIN_INFO *plugin_info(PLUGIN_INPUT_FN *ppi) {
- _ppi = ppi;
+PLUGIN_INFO *plugin_info(void) {
return &_pi;
}
@@ -118,7 +113,7 @@ void *ssc_wma_init(void) {
hr = CoInitializeEx(NULL,COINIT_MULTITHREADED);
if(FAILED(hr)) {
- _ppi->log(E_INF,"Could not initialize COM, Error code: 0x%08X\n",hr);
+ pi_log(E_INF,"Could not initialize COM, Error code: 0x%08X\n",hr);
return NULL;
}
@@ -164,7 +159,7 @@ int ssc_wma_open(void *vp, MP3FILE *pmp3) {
hr = WMCreateSyncReader(NULL,0,&handle->pReader);
if(FAILED(hr)) {
- _ppi->log(E_INF,"Could not create WMA reader. Error code: 0x%08X\n",hr);
+ pi_log(E_INF,"Could not create WMA reader. Error code: 0x%08X\n",hr);
handle->errnum = SSC_WMA_E_NOREADER;
return FALSE;
}
@@ -174,20 +169,20 @@ int ssc_wma_open(void *vp, MP3FILE *pmp3) {
hr = handle->pReader->Open(fname);
if(FAILED(hr)) {
- _ppi->log(E_INF,"Could not open file. Error code: 0x%08X\n",hr);
+ pi_log(E_INF,"Could not open file. Error code: 0x%08X\n",hr);
return FALSE;
}
handle->state=STATE_OPEN;
hr = handle->pReader->SetRange(0,0);
if(FAILED(hr)) {
- _ppi->log(E_INF,"Could not set range. Error code: 0x%08X\n",hr);
+ pi_log(E_INF,"Could not set range. Error code: 0x%08X\n",hr);
return FALSE;
}
hr = handle->pReader->SetReadStreamSamples(1,0);
if(FAILED(hr)) {
- _ppi->log(E_INF,"Could not stream samples. Error code: 0x%08X\n",hr);
+ pi_log(E_INF,"Could not stream samples. Error code: 0x%08X\n",hr);
return FALSE;
}
@@ -198,19 +193,19 @@ int ssc_wma_open(void *vp, MP3FILE *pmp3) {
IWMOutputMediaProps *pprops;
hr = handle->pReader->GetOutputFormat(0,0,&pprops);
if(FAILED(hr)) {
- _ppi->log(E_LOG,"Could not get output format for %s\n",file);
+ pi_log(E_LOG,"Could not get output format for %s\n",file);
return TRUE; /* we'll assume 44100/16/2 */
}
hr = pprops->GetMediaType(NULL,&byte_count);
if(FAILED(hr)) {
- _ppi->log(E_LOG,"Could not get media type for %s\n",file);
+ pi_log(E_LOG,"Could not get media type for %s\n",file);
return TRUE;
}
WM_MEDIA_TYPE *ptype = (WM_MEDIA_TYPE*)calloc(byte_count,1);
if(!ptype) {
- _ppi->log(E_FATAL,"ssc_wma_open: malloc\n");
+ pi_log(E_FATAL,"ssc_wma_open: malloc\n");
}
hr = pprops->GetMediaType(ptype, &byte_count);
@@ -280,9 +275,9 @@ int ssc_wma_read(void *vp, char *buffer, int len) {
byte_rate = sample_rate * channels * bits_per_sample / 8;
block_align = channels * bits_per_sample / 8;
- _ppi->log(E_DBG,"Channels.......: %d\n",channels);
- _ppi->log(E_DBG,"Sample rate....: %d\n",sample_rate);
- _ppi->log(E_DBG,"Bits/Sample....: %d\n",bits_per_sample);
+ pi_log(E_DBG,"Channels.......: %d\n",channels);
+ pi_log(E_DBG,"Sample rate....: %d\n",sample_rate);
+ pi_log(E_DBG,"Bits/Sample....: %d\n",bits_per_sample);
memcpy(&handle->wav_header[0],"RIFF",4);
*((unsigned int*)(&handle->wav_header[4])) = 36 + sample_len;
@@ -332,12 +327,12 @@ int ssc_wma_read(void *vp, char *buffer, int len) {
if(SUCCEEDED(hr)) {
hr = handle->pBuffer->GetBufferAndLength(&handle->pdata, &handle->data_len);
if(FAILED(hr)) {
- _ppi->log(E_LOG,"Read error while transcoding file\n");
+ pi_log(E_LOG,"Read error while transcoding file\n");
handle->errnum = SSC_WMA_E_READ;
return -1;
}
-// _ppi->log(E_SPAM,"Read %d bytes\n",handle->data_len);
+// pi_log(E_SPAM,"Read %d bytes\n",handle->data_len);
bytes_returned = handle->data_len;
if(bytes_returned > len)
diff --git a/src/plugins/w32-event.c b/src/plugins/w32-event.c
index 73e32f64..acfcc01c 100644
--- a/src/plugins/w32-event.c
+++ b/src/plugins/w32-event.c
@@ -6,14 +6,12 @@
#include "ff-plugins.h"
/* Forwards */
-PLUGIN_INFO *plugin_info(PLUGIN_INPUT_FN *ppi);
void plugin_handler(int, int, void *, int);
#define PIPE_BUFFER_SIZE 4096
/* Globals */
PLUGIN_EVENT_FN _pefn = { plugin_handler };
-PLUGIN_INPUT_FN *_ppi;
PLUGIN_INFO _pi = {
PLUGIN_VERSION, /* version */
@@ -34,8 +32,7 @@ typedef struct tag_plugin_msg {
} PLUGIN_MSG;
-PLUGIN_INFO *plugin_info(PLUGIN_INPUT_FN *ppi) {
- _ppi = ppi;
+PLUGIN_INFO *plugin_info(void) {
return &_pi;
}
diff --git a/win32/mt-daapd.vcproj b/win32/mt-daapd.vcproj
index 9a95ab61..cdb40c6b 100644
--- a/win32/mt-daapd.vcproj
+++ b/win32/mt-daapd.vcproj
@@ -71,6 +71,7 @@
GenerateDebugInformation="true"
ProgramDatabaseFile="$(OutDir)/mt-daapd.pdb"
SubSystem="1"
+ ImportLibrary="firefly.lib"
TargetMachine="1"
/>
+
+
diff --git a/win32/out-daap/out-daap.vcproj b/win32/out-daap/out-daap.vcproj
index 64a2a38b..0c9cecc8 100644
--- a/win32/out-daap/out-daap.vcproj
+++ b/win32/out-daap/out-daap.vcproj
@@ -42,7 +42,7 @@
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..;..\..\src"
- PreprocessorDefinitions="HAVE_CONFIG_H"
+ PreprocessorDefinitions="HAVE_CONFIG_H;WIN32"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
@@ -62,6 +62,7 @@
/>
+
+
diff --git a/win32/rsp.vcproj b/win32/rsp.vcproj
index e5764aa9..35e1f915 100644
--- a/win32/rsp.vcproj
+++ b/win32/rsp.vcproj
@@ -4,6 +4,7 @@
Version="8.00"
Name="rsp"
ProjectGUID="{68CCEA19-503F-4894-8AE3-B1673FDEA920}"
+ RootNamespace="rsp"
Keyword="Win32Proj"
>
@@ -41,7 +42,7 @@
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..\win32;.;..\src"
- PreprocessorDefinitions="_WIN32;HAVE_CONFIG_H;ZLIB_DLL"
+ PreprocessorDefinitions="_WIN32;HAVE_CONFIG_H;ZLIB_DLL;WIN32;PLUGIN"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
@@ -61,7 +62,7 @@
/>
@@ -41,7 +42,7 @@
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..\win32;.;..\src"
- PreprocessorDefinitions="HAVE_CONFIG_H;_WIN32"
+ PreprocessorDefinitions="HAVE_CONFIG_H;_WIN32;WIN32"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
@@ -61,7 +62,7 @@
/>
@@ -41,7 +42,7 @@
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..;..\..\src"
- PreprocessorDefinitions="HAVE_CONFIG_H"
+ PreprocessorDefinitions="HAVE_CONFIG_H;WIN32"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
@@ -61,7 +62,7 @@
/>