summaryrefslogtreecommitdiffstats
path: root/loader/dshow
diff options
context:
space:
mode:
authorwm4 <wm4@mplayer2.org>2012-02-27 19:15:13 +0100
committerUoti Urpala <uau@mplayer2.org>2012-03-01 00:22:30 +0200
commit24be34f1e9e37111a06108c090324426aff6f1db (patch)
treeaa28674a6d69dfb18fd102608f72e3081df6d1dd /loader/dshow
parent25417a626d0b9077bfbb940952f3858d7b8b549b (diff)
downloadmpv-24be34f1e9e37111a06108c090324426aff6f1db.tar.bz2
mpv-24be34f1e9e37111a06108c090324426aff6f1db.tar.xz
cleanup: Silence compilation warnings on MinGW-w64
Some of the code, especially the dshow and windows codec loader parts, are extremely hacky and likely full of bugs. The goal is merely getting rid of warnings that could obscure more important warnings and actual bugs, instead of fixing actual problems. This reduces the number of warnings from over 500 to almost the same as when compiling on Linux. Note that many problems stem from using the ancient wine-derived windows headers. There are some differences to the "proper" windows header. Changing the code to compile with the proper headers would be too much trouble, and it still has to work on Unix. Some of the changes might actually break compilation on legacy MinGW, but we don't support that anymore. Always use MinGW-w64, even when compiling to 32 bit. Fixes some warnings in the win32 loader code on Linux too.
Diffstat (limited to 'loader/dshow')
-rw-r--r--loader/dshow/DS_Filter.c4
-rw-r--r--loader/dshow/DS_VideoDecoder.c4
-rw-r--r--loader/dshow/allocator.c2
-rw-r--r--loader/dshow/graph.c32
-rw-r--r--loader/dshow/graph.h19
-rw-r--r--loader/dshow/outputpin.c6
6 files changed, 26 insertions, 41 deletions
diff --git a/loader/dshow/DS_Filter.c b/loader/dshow/DS_Filter.c
index 693d59c25f..88f881523a 100644
--- a/loader/dshow/DS_Filter.c
+++ b/loader/dshow/DS_Filter.c
@@ -216,7 +216,7 @@ DS_Filter* DS_FilterCreate(const char* dllname, const GUID* id,
enum_pins->vt->Reset(enum_pins);
result = enum_pins->vt->Next(enum_pins, (ULONG)256, (IPin**)array, &fetched);
- enum_pins->vt->Release(enum_pins);
+ enum_pins->vt->Release((IUnknown*)enum_pins);
Debug printf("Pins enumeration returned %ld pins, error is %x\n", fetched, (int)result);
for (i = 0; i < fetched; i++)
@@ -306,7 +306,7 @@ DS_Filter* DS_FilterCreate(const char* dllname, const GUID* id,
init++;
break;
}
- tempAll->vt->Release(tempAll);
+ tempAll->vt->Release((IUnknown*)tempAll);
if (!init)
{
diff --git a/loader/dshow/DS_VideoDecoder.c b/loader/dshow/DS_VideoDecoder.c
index 8af025b475..c8cc988b61 100644
--- a/loader/dshow/DS_VideoDecoder.c
+++ b/loader/dshow/DS_VideoDecoder.c
@@ -600,8 +600,8 @@ int DS_VideoDecoder_SetDestFmt(DS_VideoDecoder *this, int bits, unsigned int csp
}
if(this->m_pDS_Filter->m_pAll)
- this->m_pDS_Filter->m_pAll->vt->Release(this->m_pDS_Filter->m_pAll);
- this->m_pDS_Filter->m_pAll=MemAllocatorCreate();
+ this->m_pDS_Filter->m_pAll->vt->Release((IUnknown*)this->m_pDS_Filter->m_pAll);
+ this->m_pDS_Filter->m_pAll=(IMemAllocator*)MemAllocatorCreate();
if (!this->m_pDS_Filter->m_pAll)
{
printf("Call to MemAllocatorCreate failed\n");
diff --git a/loader/dshow/allocator.c b/loader/dshow/allocator.c
index a90bd9d3d2..744debf968 100644
--- a/loader/dshow/allocator.c
+++ b/loader/dshow/allocator.c
@@ -114,6 +114,7 @@ static inline avm_list_t* avm_list_find(avm_list_t* head, void* member)
return NULL;
}
+#ifdef WIN32_LOADER
static long MemAllocator_CreateAllocator(GUID* clsid, const GUID* iid, void** ppv)
{
IUnknown* p;
@@ -130,6 +131,7 @@ static long MemAllocator_CreateAllocator(GUID* clsid, const GUID* iid, void** pp
return result;
}
+#endif
static HRESULT STDCALL MemAllocator_SetProperties(IMemAllocator * This,
/* [in] */ ALLOCATOR_PROPERTIES *pRequest,
diff --git a/loader/dshow/graph.c b/loader/dshow/graph.c
index 01bf6c7253..14517a627f 100644
--- a/loader/dshow/graph.c
+++ b/loader/dshow/graph.c
@@ -34,6 +34,7 @@
// Used for knowing when to register and unregister the class in COM.
static int GraphKeeper = 0;
+#ifdef WIN32_LOADER
static long FilterGraph_CreateGraph(GUID* clsid, const GUID* iid, void** ppv)
{
IUnknown* p;
@@ -50,6 +51,7 @@ static long FilterGraph_CreateGraph(GUID* clsid, const GUID* iid, void** ppv)
return result;
}
+#endif
static void FilterGraph_Destroy(FilterGraph* This)
{
@@ -62,56 +64,56 @@ static void FilterGraph_Destroy(FilterGraph* This)
free(This);
}
-HRESULT STDCALL FilterGraph_AddFilter(FilterGraph* This,
- IBaseFilter* pFilter,
- unsigned short* pName)
+static HRESULT STDCALL FilterGraph_AddFilter(IFilterGraph* This,
+ IBaseFilter* pFilter,
+ unsigned short* pName)
{
Debug printf("FilterGraph_AddFilter(%p) called\n", This);
return E_NOTIMPL;
}
-HRESULT STDCALL FilterGraph_RemoveFilter(FilterGraph* This, IBaseFilter* pFilter)
+static HRESULT STDCALL FilterGraph_RemoveFilter(IFilterGraph* This, IBaseFilter* pFilter)
{
Debug printf("FilterGraph_RemoveFilter(%p) called\n", This);
return E_NOTIMPL;
}
-HRESULT STDCALL FilterGraph_EnumFilters(FilterGraph* This, IEnumFilters** ppEnum)
+static HRESULT STDCALL FilterGraph_EnumFilters(IFilterGraph* This, IEnumFilters** ppEnum)
{
Debug printf("FilterGraph_EnumFilters(%p) called\n", This);
return E_NOTIMPL;
}
-HRESULT STDCALL FilterGraph_FindFilterByName(FilterGraph* This,
- unsigned short* pName,
- IBaseFilter** ppFilter)
+static HRESULT STDCALL FilterGraph_FindFilterByName(IFilterGraph* This,
+ unsigned short* pName,
+ IBaseFilter** ppFilter)
{
Debug printf("FilterGraph_FindFilterByName(%p) called\n", This);
return E_NOTIMPL;
}
-HRESULT STDCALL FilterGraph_ConnectDirect(FilterGraph* This,
- IPin* ppinOut,
- IPin* ppinIn,
- const AM_MEDIA_TYPE* pmt)
+static HRESULT STDCALL FilterGraph_ConnectDirect(IFilterGraph* This,
+ IPin* ppinOut,
+ IPin* ppinIn,
+ const AM_MEDIA_TYPE* pmt)
{
Debug printf("FilterGraph_ConnectDirect(%p) called\n", This);
return E_NOTIMPL;
}
-HRESULT STDCALL FilterGraph_Reconnect(FilterGraph* This, IPin* ppin)
+static HRESULT STDCALL FilterGraph_Reconnect(IFilterGraph* This, IPin* ppin)
{
Debug printf("FilterGraph_Reconnect(%p) called\n", This);
return E_NOTIMPL;
}
-HRESULT STDCALL FilterGraph_Disconnect(FilterGraph* This, IPin* ppin)
+static HRESULT STDCALL FilterGraph_Disconnect(IFilterGraph* This, IPin* ppin)
{
Debug printf("FilterGraph_Disconnect(%p) called\n", This);
return E_NOTIMPL;
}
-HRESULT STDCALL FilterGraph_SetDefaultSyncSource(FilterGraph* This)
+static HRESULT STDCALL FilterGraph_SetDefaultSyncSource(IFilterGraph* This)
{
Debug printf("FilterGraph_SetDefaultSyncSource(%p) called\n", This);
return E_NOTIMPL;
diff --git a/loader/dshow/graph.h b/loader/dshow/graph.h
index 2fa72b49b4..7667f5a39e 100644
--- a/loader/dshow/graph.h
+++ b/loader/dshow/graph.h
@@ -52,25 +52,6 @@ struct FilterGraph {
HRESULT STDCALL (*SetDefaultSyncSource)(FilterGraph* This);
};
-
-HRESULT STDCALL FilterGraph_AddFilter(FilterGraph* This,
- IBaseFilter* pFilter,
- unsigned short* pName);
-HRESULT STDCALL FilterGraph_RemoveFilter(FilterGraph* This,
- IBaseFilter* pFilter);
-HRESULT STDCALL FilterGraph_EnumFilters(FilterGraph* This,
- IEnumFilters** ppEnum);
-HRESULT STDCALL FilterGraph_FindFilterByName(FilterGraph* This,
- unsigned short* pName,
- IBaseFilter** ppFilter);
-HRESULT STDCALL FilterGraph_ConnectDirect(FilterGraph* This,
- IPin* ppinOut,
- IPin* ppinIn,
- const AM_MEDIA_TYPE* pmt);
-HRESULT STDCALL FilterGraph_Reconnect(FilterGraph* This, IPin* ppin);
-HRESULT STDCALL FilterGraph_Disconnect(FilterGraph* This, IPin* ppin);
-HRESULT STDCALL FilterGraph_SetDefaultSyncSource(FilterGraph* This);
-
FilterGraph* FilterGraphCreate(void);
#endif /* MPLAYER_GRAPH_H */
diff --git a/loader/dshow/outputpin.c b/loader/dshow/outputpin.c
index ad53303df5..a1baf80116 100644
--- a/loader/dshow/outputpin.c
+++ b/loader/dshow/outputpin.c
@@ -552,8 +552,8 @@ static HRESULT STDCALL COutputPin_NewSegment(IPin * This,
/* [in] */ REFERENCE_TIME tStop,
/* [in] */ double dRate)
{
- Debug printf("COutputPin_NewSegment(%Ld,%Ld,%f) called\n",
- tStart, tStop, dRate);
+ Debug printf("COutputPin_NewSegment(%d,%d,%f) called\n",
+ (int)tStart, (int)tStop, dRate);
return 0;
}
@@ -749,7 +749,7 @@ static HRESULT STDCALL COutputMemPin_ReceiveMultiple(IMemInputPin * This,
/* [in] */ long nSamples,
/* [out] */ long *nSamplesProcessed)
{
- HRESULT hr;
+ HRESULT hr = 0;
Debug printf("COutputMemPin_ReceiveMultiple(%p) %ld\n", This,nSamples);
for(*nSamplesProcessed=0; *nSamplesProcessed < nSamples; *nSamplesProcessed++) {
hr = This->vt->Receive(This,pSamples[*nSamplesProcessed]);