[MPlayer-dev-eng] [PATCH] replacing printf with mp_msg
Vladimir Voroshilov
voroshil at gmail.com
Tue Jan 30 21:18:51 CET 2007
Hi, All
Attached patch replaces all "printf"s with mp_msg(MSGT_LOADER,... in
loader/dshow/*
What will you say about this small improovement?
--
Regards,
Vladimir Voroshilov mailto:voroshil at gmail.com
JID: voroshil at jabber.ru
ICQ: 95587719
-------------- next part --------------
Index: loader/dshow/inputpin.c
===================================================================
--- loader/dshow/inputpin.c (revision 22081)
+++ loader/dshow/inputpin.c (working copy)
@@ -10,9 +10,11 @@
#include <stdio.h>
#include <stdlib.h>
+#include "mp_msg.h"
+
static inline int unimplemented(const char* s, void* p)
{
- Debug printf("%s(%p) called (UNIMPLEMENTED)", s, p);
+ Debug mp_msg(MSGT_LOADER,MSGL_DBG4,"%s(%p) called (UNIMPLEMENTED)", s, p);
return E_NOTIMPL;
}
@@ -52,7 +54,7 @@
{
CEnumPins* pin = (CEnumPins*)This;
- Debug printf("CEnumPins_Next(%p) called\n", This);
+ Debug mp_msg(MSGT_LOADER,MSGL_DBG4,"CEnumPins_Next(%p) called\n", This);
if (!ppMediaTypes)
return E_INVALIDARG;
if (!pcFetched && (cMediaTypes!=1))
@@ -117,7 +119,7 @@
*/
static long STDCALL CEnumPins_Reset(IEnumPins* This)
{
- Debug printf("CEnumPins_Reset(%p) called\n", This);
+ Debug mp_msg(MSGT_LOADER,MSGL_DBG4,"CEnumPins_Reset(%p) called\n", This);
((CEnumPins*)This)->counter = 0;
return 0;
}
@@ -308,7 +310,7 @@
static long STDCALL CInputPin_ConnectionMediaType(IPin* This,
/* [out] */ AM_MEDIA_TYPE *pmt)
{
- Debug printf("CInputPin_ConnectionMediaType(%p) called\n", This);
+ Debug mp_msg(MSGT_LOADER,MSGL_DBG4,"CInputPin_ConnectionMediaType(%p) called\n", This);
if (!pmt)
return E_INVALIDARG;
*pmt=((CInputPin*)This)->type;
@@ -337,7 +339,7 @@
/* [out] */ PIN_INFO *pInfo)
{
CBaseFilter* lparent=((CInputPin*)This)->parent;
- Debug printf("CInputPin_QueryPinInfo(%p) called\n", This);
+ Debug mp_msg(MSGT_LOADER,MSGL_DBG4,"CInputPin_QueryPinInfo(%p) called\n", This);
pInfo->dir = PINDIR_OUTPUT;
pInfo->pFilter = (IBaseFilter*) lparent;
lparent->vt->AddRef((IUnknown*)lparent);
@@ -359,7 +361,7 @@
/* [out] */ PIN_DIRECTION *pPinDir)
{
*pPinDir = PINDIR_OUTPUT;
- Debug printf("CInputPin_QueryDirection(%p) called\n", This);
+ Debug mp_msg(MSGT_LOADER,MSGL_DBG4,"CInputPin_QueryDirection(%p) called\n", This);
return 0;
}
@@ -733,7 +735,7 @@
static long STDCALL CBaseFilter_EnumPins(IBaseFilter* This,
/* [out] */ IEnumPins **ppEnum)
{
- Debug printf("CBaseFilter_EnumPins(%p) called\n", This);
+ Debug mp_msg(MSGT_LOADER,MSGL_DBG4,"CBaseFilter_EnumPins(%p) called\n", This);
*ppEnum = (IEnumPins*) CEnumPinsCreate(((CBaseFilter*)This)->pin, ((CBaseFilter*)This)->unused_pin);
return 0;
}
@@ -1074,7 +1076,7 @@
static long STDCALL CBaseFilter2_EnumPins(IBaseFilter* This,
/* [out] */ IEnumPins** ppEnum)
{
- Debug printf("CBaseFilter2_EnumPins(%p) called\n", This);
+ Debug mp_msg(MSGT_LOADER,MSGL_DBG4,"CBaseFilter2_EnumPins(%p) called\n", This);
*ppEnum = (IEnumPins*) CEnumPinsCreate(((CBaseFilter2*)This)->pin, 0);
return 0;
}
@@ -1191,7 +1193,7 @@
*/
static void CBaseFilter2_Destroy(CBaseFilter2* This)
{
- Debug printf("CBaseFilter2_Destroy(%p) called\n", This);
+ Debug mp_msg(MSGT_LOADER,MSGL_DBG4,"CBaseFilter2_Destroy(%p) called\n", This);
if (This->pin)
This->pin->vt->Release((IUnknown*) This->pin);
if (This->vt)
@@ -1283,7 +1285,7 @@
*/
static long STDCALL CRemotePin_ConnectedTo(IPin* This, /* [out] */ IPin** pPin)
{
- Debug printf("CRemotePin_ConnectedTo(%p) called\n", This);
+ Debug mp_msg(MSGT_LOADER,MSGL_DBG4,"CRemotePin_ConnectedTo(%p) called\n", This);
if (!pPin)
return E_INVALIDARG;
*pPin = ((CRemotePin*)This)->remote_pin;
@@ -1304,7 +1306,7 @@
static long STDCALL CRemotePin_QueryDirection(IPin* This,
/* [out] */ PIN_DIRECTION* pPinDir)
{
- Debug printf("CRemotePin_QueryDirection(%p) called\n", This);
+ Debug mp_msg(MSGT_LOADER,MSGL_DBG4,"CRemotePin_QueryDirection(%p) called\n", This);
if (!pPinDir)
return E_INVALIDARG;
*pPinDir=PINDIR_INPUT;
@@ -1344,7 +1346,7 @@
static long STDCALL CRemotePin_QueryPinInfo(IPin* This, /* [out] */ PIN_INFO* pInfo)
{
CBaseFilter* lparent = ((CRemotePin*)This)->parent;
- Debug printf("CRemotePin_QueryPinInfo(%p) called\n", This);
+ Debug mp_msg(MSGT_LOADER,MSGL_DBG4,"CRemotePin_QueryPinInfo(%p) called\n", This);
pInfo->dir= PINDIR_INPUT;
pInfo->pFilter = (IBaseFilter*) lparent;
lparent->vt->AddRef((IUnknown*)lparent);
@@ -1360,7 +1362,7 @@
*/
static void CRemotePin_Destroy(CRemotePin* This)
{
- Debug printf("CRemotePin_Destroy(%p) called\n", This);
+ Debug mp_msg(MSGT_LOADER,MSGL_DBG4,"CRemotePin_Destroy(%p) called\n", This);
free(This->vt);
free(This);
}
@@ -1383,7 +1385,7 @@
if (!This)
return NULL;
- Debug printf("CRemotePinCreate() called -> %p\n", This);
+ Debug mp_msg(MSGT_LOADER,MSGL_DBG4,"CRemotePinCreate() called -> %p\n", This);
This->parent = pt;
This->remote_pin = rpin;
@@ -1434,7 +1436,7 @@
/* [out] */ PIN_INFO* pInfo)
{
CBaseFilter2* lparent=((CRemotePin2*)This)->parent;
- Debug printf("CRemotePin2_QueryPinInfo(%p) called\n", This);
+ Debug mp_msg(MSGT_LOADER,MSGL_DBG4,"CRemotePin2_QueryPinInfo(%p) called\n", This);
pInfo->pFilter=(IBaseFilter*)lparent;
lparent->vt->AddRef((IUnknown*)lparent);
pInfo->dir=PINDIR_OUTPUT;
@@ -1451,7 +1453,7 @@
*/
static void CRemotePin2_Destroy(CRemotePin2* This)
{
- Debug printf("CRemotePin2_Destroy(%p) called\n", This);
+ Debug mp_msg(MSGT_LOADER,MSGL_DBG4,"CRemotePin2_Destroy(%p) called\n", This);
free(This->vt);
free(This);
}
@@ -1473,7 +1475,7 @@
if (!This)
return NULL;
- Debug printf("CRemotePin2Create() called -> %p\n", This);
+ Debug mp_msg(MSGT_LOADER,MSGL_DBG4,"CRemotePin2Create() called -> %p\n", This);
This->parent = p;
This->refcount = 1;
Index: loader/dshow/outputpin.c
===================================================================
--- loader/dshow/outputpin.c (revision 22081)
+++ loader/dshow/outputpin.c (working copy)
@@ -11,9 +11,11 @@
#include <string.h>
#include <stdlib.h>
+#include "mp_msg.h"
+
static inline int output_unimplemented(const char* s, void* p)
{
- Debug printf("%s(%p) called (UNIMPLEMENTED)", s, p);
+ Debug mp_msg(MSGT_LOADER,MSGL_DBG4,"%s(%p) called (UNIMPLEMENTED)", s, p);
return E_NOTIMPL;
}
@@ -63,7 +65,7 @@
/* [out] */ ULONG *pcFetched)
{
AM_MEDIA_TYPE* type = &((CEnumMediaTypes*)This)->type;
- Debug printf("CEnumMediaTypes::Next(%p) called\n", This);
+ Debug mp_msg(MSGT_LOADER,MSGL_DBG4,"CEnumMediaTypes::Next(%p) called\n", This);
if (!ppMediaTypes)
return E_INVALIDARG;
if (!pcFetched && (cMediaTypes!=1))
@@ -115,7 +117,7 @@
*/
static HRESULT STDCALL CEnumMediaTypes_Reset(IEnumMediaTypes * This)
{
- Debug printf("CEnumMediaTypes::Reset(%p) called\n", This);
+ Debug mp_msg(MSGT_LOADER,MSGL_DBG4,"CEnumMediaTypes::Reset(%p) called\n", This);
return 0;
}
@@ -135,7 +137,7 @@
static HRESULT STDCALL CEnumMediaTypes_Clone(IEnumMediaTypes * This,
/* [out] */ IEnumMediaTypes **ppEnum)
{
- Debug printf("CEnumMediaTypes::Clone(%p) called\n", This);
+ Debug mp_msg(MSGT_LOADER,MSGL_DBG4,"CEnumMediaTypes::Clone(%p) called\n", This);
return E_NOTIMPL;
}
@@ -221,7 +223,7 @@
{
COutputPin* p = (COutputPin*) This;
- Debug printf("COutputPin_QueryInterface(%p) called\n", This);
+ Debug mp_msg(MSGT_LOADER,MSGL_DBG4,"COutputPin_QueryInterface(%p) called\n", This);
if (!ppv)
return E_INVALIDARG;
@@ -238,7 +240,7 @@
return 0;
}
- Debug printf("Unknown interface : %08x-%04x-%04x-%02x%02x-"
+ Debug mp_msg(MSGT_LOADER,MSGL_DBG4,"Unknown interface : %08x-%04x-%04x-%02x%02x-"
"%02x%02x%02x%02x%02x%02x\n",
iid->f1, iid->f2, iid->f3,
(unsigned char)iid->f4[1], (unsigned char)iid->f4[0],
@@ -268,7 +270,7 @@
/* [in] */ IPin *pReceivePin,
/* [in] */ /* const */ AM_MEDIA_TYPE *pmt)
{
- Debug printf("COutputPin_Connect(%p) called\n",This);
+ Debug mp_msg(MSGT_LOADER,MSGL_DBG4,"COutputPin_Connect(%p) called\n",This);
/*
*pmt=((COutputPin*)This)->type;
if(pmt->cbFormat>0)
@@ -305,7 +307,7 @@
/* [in] */ IPin *pConnector,
/* [in] */ const AM_MEDIA_TYPE *pmt)
{
- Debug printf("COutputPin_ReceiveConnection(%p) called\n", This);
+ Debug mp_msg(MSGT_LOADER,MSGL_DBG4,"COutputPin_ReceiveConnection(%p) called\n", This);
((COutputPin*)This)->remote = pConnector;
return 0;
}
@@ -324,7 +326,7 @@
*/
static HRESULT STDCALL COutputPin_Disconnect(IPin * This)
{
- Debug printf("COutputPin_Disconnect(%p) called\n", This);
+ Debug mp_msg(MSGT_LOADER,MSGL_DBG4,"COutputPin_Disconnect(%p) called\n", This);
return 1;
}
@@ -344,7 +346,7 @@
static HRESULT STDCALL COutputPin_ConnectedTo(IPin * This,
/* [out] */ IPin **pPin)
{
- Debug printf("COutputPin_ConnectedTo(%p) called\n", This);
+ Debug mp_msg(MSGT_LOADER,MSGL_DBG4,"COutputPin_ConnectedTo(%p) called\n", This);
if (!pPin)
return E_INVALIDARG;
*pPin = ((COutputPin*)This)->remote;
@@ -365,7 +367,7 @@
static HRESULT STDCALL COutputPin_ConnectionMediaType(IPin * This,
/* [out] */ AM_MEDIA_TYPE *pmt)
{
- Debug printf("COutputPin_ConnectionMediaType(%p) called\n",This);
+ Debug mp_msg(MSGT_LOADER,MSGL_DBG4,"COutputPin_ConnectionMediaType(%p) called\n",This);
if (!pmt)
return E_INVALIDARG;
*pmt = ((COutputPin*)This)->type;
@@ -409,7 +411,7 @@
static HRESULT STDCALL COutputPin_QueryDirection(IPin * This,
/* [out] */ PIN_DIRECTION *pPinDir)
{
- Debug printf("COutputPin_QueryDirection(%p) called\n", This);
+ Debug mp_msg(MSGT_LOADER,MSGL_DBG4,"COutputPin_QueryDirection(%p) called\n", This);
if (!pPinDir)
return E_INVALIDARG;
*pPinDir = PINDIR_INPUT;
@@ -469,7 +471,7 @@
static HRESULT STDCALL COutputPin_EnumMediaTypes(IPin * This,
/* [out] */ IEnumMediaTypes **ppEnum)
{
- Debug printf("COutputPin_EnumMediaTypes(%p) called\n",This);
+ Debug mp_msg(MSGT_LOADER,MSGL_DBG4,"COutputPin_EnumMediaTypes(%p) called\n",This);
if (!ppEnum)
return E_INVALIDARG;
*ppEnum = (IEnumMediaTypes*) CEnumMediaTypesCreate(&((COutputPin*)This)->type);
@@ -562,7 +564,7 @@
/* [in] */ REFERENCE_TIME tStop,
/* [in] */ double dRate)
{
- Debug printf("COutputPin_NewSegment(%Ld,%Ld,%f) called\n",
+ Debug mp_msg(MSGT_LOADER,MSGL_DBG4,"COutputPin_NewSegment(%Ld,%Ld,%f) called\n",
tStart, tStop, dRate);
return 0;
}
@@ -589,7 +591,7 @@
{
COutputPin* p = (COutputPin*)This;
- Debug printf("COutputMemPin_QueryInterface(%p) called\n", This);
+ Debug mp_msg(MSGT_LOADER,MSGL_DBG4,"COutputMemPin_QueryInterface(%p) called\n", This);
if (!ppv)
return E_INVALIDARG;
@@ -612,7 +614,7 @@
p->mempin->vt->AddRef(This);
return 0;
}
- Debug printf("Unknown interface : %08x-%04x-%04x-%02x%02x-" \
+ Debug mp_msg(MSGT_LOADER,MSGL_DBG4,"Unknown interface : %08x-%04x-%04x-%02x%02x-" \
"%02x%02x%02x%02x%02x%02x\n",
iid->f1, iid->f2, iid->f3,
(unsigned char)iid->f4[1], (unsigned char)iid->f4[0],
@@ -640,7 +642,7 @@
static HRESULT STDCALL COutputMemPin_GetAllocator(IMemInputPin* This,
/* [out] */ IMemAllocator** ppAllocator)
{
- Debug printf("COutputMemPin_GetAllocator(%p, %p) called\n", This->vt, ppAllocator);
+ Debug mp_msg(MSGT_LOADER,MSGL_DBG4,"COutputMemPin_GetAllocator(%p, %p) called\n", This->vt, ppAllocator);
*ppAllocator = (IMemAllocator*) MemAllocatorCreate();
return 0;
}
@@ -661,7 +663,7 @@
/* [in] */ IMemAllocator* pAllocator,
/* [in] */ int bReadOnly)
{
- Debug printf("COutputMemPin_NotifyAllocator(%p, %p) called\n", This, pAllocator);
+ Debug mp_msg(MSGT_LOADER,MSGL_DBG4,"COutputMemPin_NotifyAllocator(%p, %p) called\n", This, pAllocator);
((COutputMemPin*)This)->pAllocator = (MemAllocator*) pAllocator;
return 0;
}
@@ -722,7 +724,7 @@
char* pointer;
int len;
- Debug printf("COutputMemPin_Receive(%p) called\n", This);
+ Debug mp_msg(MSGT_LOADER,MSGL_DBG4,"COutputMemPin_Receive(%p) called\n", This);
if (!pSample)
return E_INVALIDARG;
if (pSample->vt->GetPointer(pSample, (BYTE**) &pointer))
@@ -878,7 +880,7 @@
*/
static HRESULT STDCALL COutputPin_AddRef(IUnknown* This)
{
- Debug printf("COutputPin_AddRef(%p) called (%d)\n", This, ((COutputPin*)This)->refcount);
+ Debug mp_msg(MSGT_LOADER,MSGL_DBG4,"COutputPin_AddRef(%p) called (%d)\n", This, ((COutputPin*)This)->refcount);
((COutputPin*)This)->refcount++;
return 0;
}
@@ -897,7 +899,7 @@
*/
static HRESULT STDCALL COutputPin_Release(IUnknown* This)
{
- Debug printf("COutputPin_Release(%p) called (%d)\n", This, ((COutputPin*)This)->refcount);
+ Debug mp_msg(MSGT_LOADER,MSGL_DBG4,"COutputPin_Release(%p) called (%d)\n", This, ((COutputPin*)This)->refcount);
if (--((COutputPin*)This)->refcount <= 0)
COutputPin_Destroy((COutputPin*)This);
@@ -918,7 +920,7 @@
static HRESULT STDCALL COutputMemPin_AddRef(IUnknown* This)
{
COutputMemPin* p = (COutputMemPin*) This;
- Debug printf("COutputMemPin_AddRef(%p) called (%p, %d)\n", p, p->parent, p->parent->refcount);
+ Debug mp_msg(MSGT_LOADER,MSGL_DBG4,"COutputMemPin_AddRef(%p) called (%p, %d)\n", p, p->parent, p->parent->refcount);
p->parent->refcount++;
return 0;
}
@@ -938,7 +940,7 @@
static HRESULT STDCALL COutputMemPin_Release(IUnknown* This)
{
COutputMemPin* p = (COutputMemPin*) This;
- Debug printf("COutputMemPin_Release(%p) called (%p, %d)\n",
+ Debug mp_msg(MSGT_LOADER,MSGL_DBG4,"COutputMemPin_Release(%p) called (%p, %d)\n",
p, p->parent, p->parent->refcount);
if (--p->parent->refcount <= 0)
COutputPin_Destroy(p->parent);
Index: loader/dshow/iunk.h
===================================================================
--- loader/dshow/iunk.h (revision 22081)
+++ loader/dshow/iunk.h (working copy)
@@ -23,7 +23,7 @@
{ \
CLASSNAME * me = (CLASSNAME *)This; \
GUID* r; unsigned int i = 0; \
- Debug printf(#CLASSNAME "_QueryInterface(%p) called\n", This);\
+ Debug mp_msg(MSGT_TV,MSGL_DBG4,#CLASSNAME "_QueryInterface(%p) called\n", This);\
if (!ppvObject) return E_POINTER; \
for(r=me->interfaces; i<sizeof(me->interfaces)/sizeof(me->interfaces[0]); r++, i++) \
if(!memcmp(r, riid, sizeof(*r))) \
@@ -32,21 +32,21 @@
*ppvObject=This; \
return 0; \
} \
- Debug printf("Query failed! (GUID: 0x%x)\n", *(unsigned int*)riid); \
+ Debug mp_msg(MSGT_TV,MSGL_DBG4,"Query failed! (GUID: 0x%x)\n", *(unsigned int*)riid); \
return E_NOINTERFACE; \
} \
\
static long STDCALL CLASSNAME ## _AddRef(IUnknown * This) \
{ \
CLASSNAME * me=( CLASSNAME *)This; \
- Debug printf(#CLASSNAME "_AddRef(%p) called (ref:%d)\n", This, me->refcount); \
+ Debug mp_msg(MSGT_TV,MSGL_DBG4,#CLASSNAME "_AddRef(%p) called (ref:%d)\n", This, me->refcount); \
return ++(me->refcount); \
} \
\
static long STDCALL CLASSNAME ## _Release(IUnknown * This) \
{ \
CLASSNAME* me=( CLASSNAME *)This; \
- Debug printf(#CLASSNAME "_Release(%p) called (new ref:%d)\n", This, me->refcount - 1); \
+ Debug mp_msg(MSGT_TV,MSGL_DBG4,#CLASSNAME "_Release(%p) called (new ref:%d)\n", This, me->refcount - 1); \
if(--(me->refcount) == 0) \
CLASSNAME ## _Destroy(me); \
return 0; \
Index: loader/dshow/DS_Filter.c
===================================================================
--- loader/dshow/DS_Filter.c (revision 22081)
+++ loader/dshow/DS_Filter.c (working copy)
@@ -11,8 +11,9 @@
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
-#include "win32.h" // printf macro
+#include "mp_msg.h"
+
typedef long STDCALL (*GETCLASS) (const GUID*, const GUID*, void**);
#ifndef WIN32_LOADER
@@ -40,17 +41,17 @@
if (This->m_pAll)
return;
- //Debug printf("DS_Filter_Start(%p)\n", This);
+ //Debug mp_msg(MSGT_LOADER,MSGL_DBG4,"DS_Filter_Start(%p)\n", This);
hr = This->m_pFilter->vt->Run(This->m_pFilter, (REFERENCE_TIME)0);
if (hr != 0)
{
- Debug printf("WARNING: m_Filter->Run() failed, error code %x\n", (int)hr);
+ Debug mp_msg(MSGT_LOADER,MSGL_DBG4,"WARNING: m_Filter->Run() failed, error code %x\n", (int)hr);
}
hr = This->m_pImp->vt->GetAllocator(This->m_pImp, &This->m_pAll);
if (hr || !This->m_pAll)
{
- Debug printf("WARNING: error getting IMemAllocator interface %x\n", (int)hr);
+ Debug mp_msg(MSGT_LOADER,MSGL_DBG4,"WARNING: error getting IMemAllocator interface %x\n", (int)hr);
This->m_pImp->vt->Release((IUnknown*)This->m_pImp);
return;
}
@@ -61,7 +62,7 @@
{
if (This->m_pAll)
{
- //Debug printf("DS_Filter_Stop(%p)\n", This);
+ //Debug mp_msg(MSGT_LOADER,MSGL_DBG4,"DS_Filter_Stop(%p)\n", This);
This->m_pFilter->vt->Stop(This->m_pFilter); // causes weird crash ??? FIXME
This->m_pAll->vt->Release((IUnknown*)This->m_pAll);
This->m_pAll = 0;
@@ -190,7 +191,7 @@
enum_pins->vt->Reset(enum_pins);
result = enum_pins->vt->Next(enum_pins, (ULONG)256, (IPin**)array, &fetched);
- Debug printf("Pins enumeration returned %ld pins, error is %x\n", fetched, (int)result);
+ Debug mp_msg(MSGT_LOADER,MSGL_DBG4,"Pins enumeration returned %ld pins, error is %x\n", fetched, (int)result);
for (i = 0; i < fetched; i++)
{
@@ -267,7 +268,7 @@
if (!init)
{
DS_Filter_Destroy(This);
- printf("Warning: DS_Filter() %s. (DLL=%.200s, r=0x%x)\n", em, dllname, result);
+ mp_msg(MSGT_LOADER,MSGL_WARN,"Warning: DS_Filter() %s. (DLL=%.200s, r=0x%x)\n", em, dllname, result);
This = 0;
}
return This;
Index: loader/dshow/DS_AudioDecoder.c
===================================================================
--- loader/dshow/DS_AudioDecoder.c (revision 22081)
+++ loader/dshow/DS_AudioDecoder.c (working copy)
@@ -33,6 +33,8 @@
#include <stdio.h>
#include <stdlib.h>
+#include "mp_msg.h"
+
typedef long STDCALL (*GETCLASS) (GUID*, GUID*, void**);
DS_AudioDecoder * DS_AudioDecoder_Open(char* dllname, GUID* guid, WAVEFORMATEX* wf)
@@ -163,7 +165,7 @@
this->m_pDS_Filter->m_pAll->vt->GetBuffer(this->m_pDS_Filter->m_pAll, &sample, 0, 0, 0);
if (!sample)
{
- Debug printf("DS_AudioDecoder::Convert() Error: null sample\n");
+ Debug mp_msg(MSGT_LOADER,MSGL_DBG4,"DS_AudioDecoder::Convert() Error: null sample\n");
break;
}
sample->vt->SetActualDataLength(sample, this->in_fmt.nBlockAlign);
@@ -173,7 +175,7 @@
sample->vt->SetPreroll(sample, 0);
result = this->m_pDS_Filter->m_pImp->vt->Receive(this->m_pDS_Filter->m_pImp, sample);
if (result)
- Debug printf("DS_AudioDecoder::Convert() Error: putting data into input pin %x\n", result);
+ Debug mp_msg(MSGT_LOADER,MSGL_DBG4,"DS_AudioDecoder::Convert() Error: putting data into input pin %x\n", result);
if ((written + frame_size) > out_size)
{
sample->vt->Release((IUnknown*)sample);
Index: loader/dshow/allocator.c
===================================================================
--- loader/dshow/allocator.c (revision 22081)
+++ loader/dshow/allocator.c (working copy)
@@ -11,6 +11,8 @@
#include <stdio.h>
#include <stdlib.h>
+#include "mp_msg.h"
+
static int AllocatorKeeper = 0;
struct _avm_list_t
@@ -41,13 +43,13 @@
{
avm_list_t* it = head;
int i = 0;
- printf("Head: %p\n", head);
+ mp_msg(MSGT_LOADER,MSGL_INFO,"Head: %p\n", head);
if (it)
{
for (;;)
{
i++;
- printf("%d: member: %p next: %p prev: %p\n",
+ mp_msg(MSGT_LOADER,MSGL_INFO,"%d: member: %p next: %p prev: %p\n",
i, it->member, it->next, it->prev);
it = it->next;
if (it == head)
@@ -137,7 +139,7 @@
/* [out] */ ALLOCATOR_PROPERTIES *pActual)
{
MemAllocator* me = (MemAllocator*)This;
- Debug printf("MemAllocator_SetProperties(%p) called\n", This);
+ Debug mp_msg(MSGT_LOADER,MSGL_DBG4,"MemAllocator_SetProperties(%p) called\n", This);
if (!pRequest || !pActual)
return E_INVALIDARG;
if (pRequest->cBuffers<=0 || pRequest->cbBuffer<=0)
@@ -157,7 +159,7 @@
static HRESULT STDCALL MemAllocator_GetProperties(IMemAllocator * This,
/* [out] */ ALLOCATOR_PROPERTIES *pProps)
{
- Debug printf("MemAllocator_GetProperties(%p) called\n", This);
+ Debug mp_msg(MSGT_LOADER,MSGL_DBG4,"MemAllocator_GetProperties(%p) called\n", This);
if (!pProps)
return E_INVALIDARG;
if (((MemAllocator*)This)->props.cbBuffer<0)
@@ -171,7 +173,7 @@
{
MemAllocator* me = (MemAllocator*)This;
int i;
- Debug printf("MemAllocator_Commit(%p) called\n", This);
+ Debug mp_msg(MSGT_LOADER,MSGL_DBG4,"MemAllocator_Commit(%p) called\n", This);
if (((MemAllocator*)This)->props.cbBuffer < 0)
return E_FAIL;
if (me->used_list || me->free_list)
@@ -182,20 +184,20 @@
me->props.cbBuffer);
if (!sample)
return E_OUTOFMEMORY;
- //printf("FREEEEEEEEEEEE ADDED %p\n", sample);
+ //mp_msg(MSGT_LOADER,MSGL_INFO,"FREEEEEEEEEEEE ADDED %p\n", sample);
me->free_list = avm_list_add_tail(me->free_list, sample);
//avm_list_print(me->free_list);
}
- //printf("Added mem %p: lsz: %d %d size: %d\n", me, avm_list_size(me->free_list), me->props.cBuffers, me->props.cbBuffer);
+ //mp_msg(MSGT_LOADER,MSGL_INFO,"Added mem %p: lsz: %d %d size: %d\n", me, avm_list_size(me->free_list), me->props.cBuffers, me->props.cbBuffer);
return 0;
}
static HRESULT STDCALL MemAllocator_Decommit(IMemAllocator * This)
{
MemAllocator* me=(MemAllocator*)This;
- Debug printf("MemAllocator_Decommit(%p) called\n", This);
- //printf("Deleted mem %p: %d %d\n", me, me->free_list.size(), me->used_list.size());
+ Debug mp_msg(MSGT_LOADER,MSGL_DBG4,"MemAllocator_Decommit(%p) called\n", This);
+ //mp_msg(MSGT_LOADER,MSGL_INFO,"Deleted mem %p: %d %d\n", me, me->free_list.size(), me->used_list.size());
while (me->used_list)
{
me->free_list = avm_list_add_tail(me->free_list,
@@ -206,7 +208,7 @@
while (me->free_list)
{
CMediaSample* sample = (CMediaSample*) me->free_list->member;
- //printf("****************** Decommiting FREE %p\n", sample);
+ //mp_msg(MSGT_LOADER,MSGL_INFO,"****************** Decommiting FREE %p\n", sample);
//sample->vt->Release((IUnknown*)sample);
CMediaSample_Destroy((CMediaSample*)sample);
me->free_list = avm_list_del_head(me->free_list);
@@ -223,12 +225,12 @@
{
MemAllocator* me = (MemAllocator*)This;
CMediaSample* sample;
- Debug printf("MemAllocator_ReleaseBuffer(%p) called %d %d\n", This,
+ Debug mp_msg(MSGT_LOADER,MSGL_DBG4,"MemAllocator_ReleaseBuffer(%p) called %d %d\n", This,
avm_list_size(me->used_list), avm_list_size(me->free_list));
if (!me->free_list)
{
- Debug printf("No samples available\n");
+ Debug mp_msg(MSGT_LOADER,MSGL_DBG4,"No samples available\n");
return E_FAIL;//should block here if no samples are available
}
@@ -254,7 +256,7 @@
{
avm_list_t* l;
MemAllocator* me = (MemAllocator*)This;
- Debug printf("MemAllocator_ReleaseBuffer(%p) called %d %d\n", This,
+ Debug mp_msg(MSGT_LOADER,MSGL_DBG4,"MemAllocator_ReleaseBuffer(%p) called %d %d\n", This,
avm_list_size(me->used_list), avm_list_size(me->free_list));
l = avm_list_find(me->used_list, pBuffer);
@@ -268,10 +270,10 @@
}
me->used_list = avm_list_del_head(me->used_list);
me->free_list = avm_list_add_head(me->free_list, sample);
- //printf("****************** RELEASED OK %p %p\n", me->used_list, me->free_list);
+ //mp_msg(MSGT_LOADER,MSGL_INFO,"****************** RELEASED OK %p %p\n", me->used_list, me->free_list);
return 0;
}
- Debug printf("MemAllocator_ReleaseBuffer(%p) releasing unknown buffer!!!! %p\n", This, pBuffer);
+ Debug mp_msg(MSGT_LOADER,MSGL_DBG4,"MemAllocator_ReleaseBuffer(%p) releasing unknown buffer!!!! %p\n", This, pBuffer);
return E_FAIL;
}
@@ -292,7 +294,7 @@
static void MemAllocator_Destroy(MemAllocator* This)
{
- Debug printf("MemAllocator_Destroy(%p) called (%d, %d)\n", This, This->refcount, AllocatorKeeper);
+ Debug mp_msg(MSGT_LOADER,MSGL_DBG4,"MemAllocator_Destroy(%p) called (%d, %d)\n", This, This->refcount, AllocatorKeeper);
#ifdef WIN32_LOADER
if (--AllocatorKeeper == 0)
UnregisterComClass(&CLSID_MemoryAllocator, MemAllocator_CreateAllocator);
@@ -310,7 +312,7 @@
if (!This)
return NULL;
- Debug printf("MemAllocatorCreate() called -> %p\n", This);
+ Debug mp_msg(MSGT_LOADER,MSGL_DBG4,"MemAllocatorCreate() called -> %p\n", This);
This->refcount = 1;
This->props.cBuffers = 1;
Index: loader/dshow/DS_VideoDecoder.c
===================================================================
--- loader/dshow/DS_VideoDecoder.c (revision 22081)
+++ loader/dshow/DS_VideoDecoder.c (working copy)
@@ -16,6 +16,8 @@
#endif
#include "DS_Filter.h"
+#include "mp_msg.h"
+
struct _DS_VideoDecoder
{
IVideoDecoder iv;
@@ -178,7 +180,7 @@
if (!this->m_pDS_Filter)
{
- printf("Failed to create DirectShow filter\n");
+ mp_msg(MSGT_LOADER,MSGL_ERR,"Failed to create DirectShow filter\n");
return 0;
}
@@ -189,7 +191,7 @@
result = this->m_pDS_Filter->m_pOutputPin->vt->QueryAccept(this->m_pDS_Filter->m_pOutputPin, &this->m_sDestType);
if (result)
{
- printf("Decoder does not support upside-down RGB frames\n");
+ mp_msg(MSGT_LOADER,MSGL_INFO,"Decoder does not support upside-down RGB frames\n");
this->iv.m_obh.biHeight *= -1;
this->m_sVhdr2->bmiHeader.biHeight = this->iv.m_obh.biHeight;
}
@@ -219,7 +221,7 @@
this->m_Caps = CAP_NONE;
- printf("Decoder supports the following YUV formats: ");
+ mp_msg(MSGT_LOADER,MSGL_INFO,"Decoder supports the following YUV formats: ");
for (c = check; c->bits; c++)
{
this->m_sVhdr2->bmiHeader.biBitCount = c->bits;
@@ -229,14 +231,14 @@
if (!result)
{
this->m_Caps = (this->m_Caps | c->cap);
- printf("%.4s ", (char *)&c->fcc);
+ mp_msg(MSGT_LOADER,MSGL_INFO,"%.4s ", (char *)&c->fcc);
}
}
- printf("\n");
+ mp_msg(MSGT_LOADER,MSGL_INFO,"\n");
}
if (this->m_Caps != CAP_NONE)
- printf("Decoder is capable of YUV output (flags 0x%x)\n", (int)this->m_Caps);
+ mp_msg(MSGT_LOADER,MSGL_INFO,"Decoder is capable of YUV output (flags 0x%x)\n", (int)this->m_Caps);
this->m_sVhdr2->bmiHeader.biBitCount = 24;
this->m_sVhdr2->bmiHeader.biCompression = 0;
@@ -275,7 +277,7 @@
void DS_VideoDecoder_StartInternal(DS_VideoDecoder *this)
{
ALLOCATOR_PROPERTIES props, props1;
- Debug printf("DS_VideoDecoder_StartInternal\n");
+ Debug mp_msg(MSGT_LOADER,MSGL_DBG4,"DS_VideoDecoder_StartInternal\n");
//cout << "DSSTART" << endl;
this->m_pDS_Filter->Start(this->m_pDS_Filter);
@@ -301,13 +303,13 @@
char* ptr;
int result;
- Debug printf("DS_VideoDecoder_DecodeInternal(%p,%p,%d,%d,%p)\n",this,src,size,is_keyframe,pImage);
+ Debug mp_msg(MSGT_LOADER,MSGL_DBG4,"DS_VideoDecoder_DecodeInternal(%p,%p,%d,%d,%p)\n",this,src,size,is_keyframe,pImage);
this->m_pDS_Filter->m_pAll->vt->GetBuffer(this->m_pDS_Filter->m_pAll, &sample, 0, 0, 0);
if (!sample)
{
- Debug printf("ERROR: null sample\n");
+ Debug mp_msg(MSGT_LOADER,MSGL_ERR,"ERROR: null sample\n");
return -1;
}
@@ -338,12 +340,12 @@
if (!this->m_pDS_Filter || !this->m_pDS_Filter->m_pImp
|| !this->m_pDS_Filter->m_pImp->vt
|| !this->m_pDS_Filter->m_pImp->vt->Receive)
- printf("DecodeInternal ERROR???\n");
+ mp_msg(MSGT_LOADER,MSGL_ERR,"DecodeInternal ERROR???\n");
#endif
result = this->m_pDS_Filter->m_pImp->vt->Receive(this->m_pDS_Filter->m_pImp, sample);
if (result)
{
- Debug printf("DS_VideoDecoder::DecodeInternal() error putting data into input pin %x\n", result);
+ Debug mp_msg(MSGT_LOADER,MSGL_DBG4,"DS_VideoDecoder::DecodeInternal() error putting data into input pin %x\n", result);
}
sample->vt->Release((IUnknown*)sample);
@@ -405,7 +407,7 @@
else
DS_VideoDecoder_SetValue(this, "Postprocessing", to);
#ifndef QUIET
- //printf("Switching quality %d -> %d b:%d\n",m_iLastQuality, to, buffered);
+ //mp_msg(MSGT_LOADER,MSGL_INFO,"Switching quality %d -> %d b:%d\n",m_iLastQuality, to, buffered);
#endif
}
}
@@ -426,7 +428,7 @@
int should_test=1;
int stoped = 0;
- Debug printf("DS_VideoDecoder_SetDestFmt (%p, %d, %d)\n",this,bits,(int)csp);
+ Debug mp_msg(MSGT_LOADER,MSGL_DBG4,"DS_VideoDecoder_SetDestFmt (%p, %d, %d)\n",this,bits,(int)csp);
/* if (!CImage::Supported(csp, bits))
return -1;
@@ -572,9 +574,9 @@
if (result != 0)
{
if (csp)
- printf("Warning: unsupported color space\n");
+ mp_msg(MSGT_LOADER,MSGL_WARN,"Warning: unsupported color space\n");
else
- printf("Warning: unsupported bit depth\n");
+ mp_msg(MSGT_LOADER,MSGL_WARN,"Warning: unsupported bit depth\n");
this->m_sDestType.lSampleSize = this->iv.m_decoder.biSizeImage;
memcpy(&(this->m_sVhdr2->bmiHeader), &this->iv.m_decoder, sizeof(this->iv.m_decoder));
@@ -611,7 +613,7 @@
&this->m_sOurType);
if (result)
{
- printf("Error reconnecting input pin 0x%x\n", (int)result);
+ mp_msg(MSGT_LOADER,MSGL_ERR,"Error reconnecting input pin 0x%x\n", (int)result);
return -1;
}
result = this->m_pDS_Filter->m_pOutputPin->vt->ReceiveConnection(this->m_pDS_Filter->m_pOutputPin,
@@ -619,7 +621,7 @@
&this->m_sDestType);
if (result)
{
- printf("Error reconnecting output pin 0x%x\n", (int)result);
+ mp_msg(MSGT_LOADER,MSGL_ERR,"Error reconnecting output pin 0x%x\n", (int)result);
return -1;
}
@@ -648,7 +650,7 @@
IDivxFilterInterface* pIDivx;
if (m_pDS_Filter->m_pFilter->vt->QueryInterface((IUnknown*)m_pDS_Filter->m_pFilter, &IID_IDivxFilterInterface, (void**)&pIDivx))
{
- Debug printf("No such interface\n");
+ Debug mp_msg(MSGT_LOADER,MSGL_DBG4,"No such interface\n");
return -1;
}
if (strcmp(name, "Postprocessing") == 0)
@@ -710,7 +712,7 @@
IHidden2* hidden = 0;
if (m_pDS_Filter->m_pFilter->vt->QueryInterface((IUnknown*)m_pDS_Filter->m_pFilter, &IID_Iv50Hidden, (void**)&hidden))
{
- Debug printf("No such interface\n");
+ Debug mp_msg(MSGT_LOADER,MSGL_DBG4,"No such interface\n");
return -1;
}
#warning FIXME
@@ -753,10 +755,10 @@
{
if (this->m_bIsDivX4) {
IDivxFilterInterface* pIDivx=NULL;
-// printf("DS_SetValue for DIVX4, name=%s value=%d\n",name,value);
+// mp_msg(MSGT_LOADER,MSGL_INFO,"DS_SetValue for DIVX4, name=%s value=%d\n",name,value);
if (this->m_pDS_Filter->m_pFilter->vt->QueryInterface((IUnknown*)this->m_pDS_Filter->m_pFilter, &IID_IDivxFilterInterface, (void**)&pIDivx))
{
- printf("No such interface\n");
+ mp_msg(MSGT_LOADER,MSGL_ERR,"No such interface\n");
return -1;
}
if (strcasecmp(name, "Postprocessing") == 0)
@@ -770,7 +772,7 @@
else if (strcasecmp(name, "MaxAuto") == 0)
this->m_iMaxAuto = value;
pIDivx->vt->Release((IUnknown*)pIDivx);
- //printf("Set %s %d\n", name, value);
+ //mp_msg(MSGT_LOADER,MSGL_INFO,"Set %s %d\n", name, value);
return 0;
}
@@ -792,7 +794,7 @@
// get5=set4 19
// get6=set5 23
hidden = (IHidden*)((int)this->m_pDS_Filter->m_pFilter + 0xb8);
- //printf("DS_SetValue for DIVX, name=%s value=%d\n",name,value);
+ //mp_msg(MSGT_LOADER,MSGL_INFO,"DS_SetValue for DIVX, name=%s value=%d\n",name,value);
if (strcasecmp(name, "Quality") == 0)
{
this->m_iLastQuality = value;
@@ -818,7 +820,7 @@
IHidden2* hidden = 0;
if (m_pDS_Filter->m_pFilter->vt->QueryInterface((IUnknown*)m_pDS_Filter->m_pFilter, &IID_Iv50Hidden, (void**)&hidden))
{
- Debug printf("No such interface\n");
+ mp_msg(MSGT_LOADER,MSGL_ERR,"No such interface\n");
return -1;
}
int recordpar[30];
@@ -854,7 +856,7 @@
return result;
}
#endif
-// printf("DS_SetValue for ????, name=%s value=%d\n",name,value);
+// mp_msg(MSGT_LOADER,MSGL_INFO,"DS_SetValue for ????, name=%s value=%d\n",name,value);
return 0;
}
/*
@@ -868,20 +870,20 @@
result=RegCreateKeyExA(HKEY_CURRENT_USER, keyname, 0, 0, 0, 0, 0, &newkey, &status);
if(result!=0)
{
- printf("VideoDecoder::SetExtAttr: registry failure\n");
+ mp_msg(MSGT_LOADER,MSGL_ERR,"VideoDecoder::SetExtAttr: registry failure\n");
return -1;
}
result=RegSetValueExA(newkey, "Current Post Process Mode", 0, REG_DWORD, &value, 4);
if(result!=0)
{
- printf("VideoDecoder::SetExtAttr: error writing value\n");
+ mp_msg(MSGT_LOADER,MSGL_ERR,"VideoDecoder::SetExtAttr: error writing value\n");
return -1;
}
value=-1;
result=RegSetValueExA(newkey, "Force Post Process Mode", 0, REG_DWORD, &value, 4);
if(result!=0)
{
- printf("VideoDecoder::SetExtAttr: error writing value\n");
+ mp_msg(MSGT_LOADER,MSGL_ERR,"VideoDecoder::SetExtAttr: error writing value\n");
return -1;
}
RegCloseKey(newkey);
@@ -899,20 +901,20 @@
result=RegCreateKeyExA(HKEY_CURRENT_USER, keyname, 0, 0, 0, 0, 0, &newkey, &status);
if(result!=0)
{
- printf("VideoDecoder::SetExtAttr: registry failure\n");
+ mp_msg(MSGT_LOADER,MSGL_ERR,"VideoDecoder::SetExtAttr: registry failure\n");
return -1;
}
result=RegSetValueExA(newkey, attribute, 0, REG_DWORD, &value, 4);
if(result!=0)
{
- printf("VideoDecoder::SetExtAttr: error writing value\n");
+ mp_msg(MSGT_LOADER,MSGL_ERR,"VideoDecoder::SetExtAttr: error writing value\n");
return -1;
}
RegCloseKey(newkey);
return 0;
}
- printf("Unknown attribute!\n");
+ mp_msg(MSGT_LOADER,MSGL_ERR,"Unknown attribute!\n");
return -200;
}
Index: loader/dshow/cmediasample.c
===================================================================
--- loader/dshow/cmediasample.c (revision 22081)
+++ loader/dshow/cmediasample.c (working copy)
@@ -10,6 +10,8 @@
#include <string.h>
#include <stdlib.h>
+#include "mp_msg.h"
+
/*
* currently hack to make some extra room for DS Acel codec which
* seems to overwrite allocated memory - FIXME better later
@@ -33,7 +35,7 @@
/* [in] */ const GUID* iid,
/* [iid_is][out] */ void **ppv)
{
- Debug printf("CMediaSample_QueryInterface(%p) called\n", This);
+ Debug mp_msg(MSGT_LOADER,MSGL_DBG4,"CMediaSample_QueryInterface(%p) called\n", This);
if (!ppv)
return E_INVALIDARG;
if (memcmp(iid, &IID_IUnknown, sizeof(*iid)) == 0)
@@ -64,7 +66,7 @@
*/
static long STDCALL CMediaSample_AddRef(IUnknown* This)
{
- Debug printf("CMediaSample_AddRef(%p) called\n", This);
+ Debug mp_msg(MSGT_LOADER,MSGL_DBG4,"CMediaSample_AddRef(%p) called\n", This);
((CMediaSample*)This)->refcount++;
return 0;
}
@@ -78,7 +80,7 @@
void CMediaSample_Destroy(CMediaSample* This)
{
- Debug printf("CMediaSample_Destroy(%p) called (ref:%d)\n", This, This->refcount);
+ Debug mp_msg(MSGT_LOADER,MSGL_DBG4,"CMediaSample_Destroy(%p) called (ref:%d)\n", This, This->refcount);
free(This->vt);
free(This->own_block);
if (This->media_type.pbFormat)
@@ -101,7 +103,7 @@
static long STDCALL CMediaSample_Release(IUnknown* This)
{
CMediaSample* parent = (CMediaSample*)This;
- Debug printf("CMediaSample_Release(%p) called (new ref:%d)\n",
+ Debug mp_msg(MSGT_LOADER,MSGL_DBG4,"CMediaSample_Release(%p) called (new ref:%d)\n",
This, ((CMediaSample*)This)->refcount-1);
if (--((CMediaSample*) This)->refcount == 0)
@@ -127,7 +129,7 @@
static HRESULT STDCALL CMediaSample_GetPointer(IMediaSample* This,
/* [out] */ BYTE** ppBuffer)
{
- Debug printf("CMediaSample_GetPointer(%p) called -> %p, size: %d %d\n", This, ((CMediaSample*) This)->block, ((CMediaSample*)This)->actual_size, ((CMediaSample*)This)->size);
+ Debug mp_msg(MSGT_LOADER,MSGL_DBG4,"CMediaSample_GetPointer(%p) called -> %p, size: %d %d\n", This, ((CMediaSample*) This)->block, ((CMediaSample*)This)->actual_size, ((CMediaSample*)This)->size);
if (!ppBuffer)
return E_INVALIDARG;
*ppBuffer = (BYTE*) ((CMediaSample*) This)->block;
@@ -144,7 +146,7 @@
*/
static long STDCALL CMediaSample_GetSize(IMediaSample * This)
{
- Debug printf("CMediaSample_GetSize(%p) called -> %d\n", This, ((CMediaSample*) This)->size);
+ Debug mp_msg(MSGT_LOADER,MSGL_DBG4,"CMediaSample_GetSize(%p) called -> %d\n", This, ((CMediaSample*) This)->size);
return ((CMediaSample*) This)->size;
}
@@ -167,7 +169,7 @@
/* [out] */ REFERENCE_TIME *pTimeStart,
/* [out] */ REFERENCE_TIME *pTimeEnd)
{
- Debug printf("CMediaSample_GetTime(%p) called (UNIMPLEMENTED)\n", This);
+ Debug mp_msg(MSGT_LOADER,MSGL_DBG4,"CMediaSample_GetTime(%p) called (UNIMPLEMENTED)\n", This);
return E_NOTIMPL;
}
@@ -191,7 +193,7 @@
/* [in] */ REFERENCE_TIME *pTimeStart,
/* [in] */ REFERENCE_TIME *pTimeEnd)
{
- Debug printf("CMediaSample_SetTime(%p) called (UNIMPLEMENTED)\n", This);
+ Debug mp_msg(MSGT_LOADER,MSGL_DBG4,"CMediaSample_SetTime(%p) called (UNIMPLEMENTED)\n", This);
return E_NOTIMPL;
}
@@ -209,7 +211,7 @@
*/
static HRESULT STDCALL CMediaSample_IsSyncPoint(IMediaSample * This)
{
- Debug printf("CMediaSample_IsSyncPoint(%p) called\n", This);
+ Debug mp_msg(MSGT_LOADER,MSGL_DBG4,"CMediaSample_IsSyncPoint(%p) called\n", This);
if (((CMediaSample*)This)->isSyncPoint)
return 0;
return 1;
@@ -228,7 +230,7 @@
static HRESULT STDCALL CMediaSample_SetSyncPoint(IMediaSample * This,
long bIsSyncPoint)
{
- Debug printf("CMediaSample_SetSyncPoint(%p) called\n", This);
+ Debug mp_msg(MSGT_LOADER,MSGL_DBG4,"CMediaSample_SetSyncPoint(%p) called\n", This);
((CMediaSample*)This)->isSyncPoint = bIsSyncPoint;
return 0;
}
@@ -248,7 +250,7 @@
*/
static HRESULT STDCALL CMediaSample_IsPreroll(IMediaSample * This)
{
- Debug printf("CMediaSample_IsPreroll(%p) called\n", This);
+ Debug mp_msg(MSGT_LOADER,MSGL_DBG4,"CMediaSample_IsPreroll(%p) called\n", This);
if (((CMediaSample*)This)->isPreroll)
return 0;//S_OK
@@ -273,7 +275,7 @@
static HRESULT STDCALL CMediaSample_SetPreroll(IMediaSample * This,
long bIsPreroll)
{
- Debug printf("CMediaSample_SetPreroll(%p) called\n", This);
+ Debug mp_msg(MSGT_LOADER,MSGL_DBG4,"CMediaSample_SetPreroll(%p) called\n", This);
((CMediaSample*)This)->isPreroll=bIsPreroll;
return 0;
}
@@ -288,7 +290,7 @@
*/
static long STDCALL CMediaSample_GetActualDataLength(IMediaSample* This)
{
- Debug printf("CMediaSample_GetActualDataLength(%p) called -> %d\n", This, ((CMediaSample*)This)->actual_size);
+ Debug mp_msg(MSGT_LOADER,MSGL_DBG4,"CMediaSample_GetActualDataLength(%p) called -> %d\n", This, ((CMediaSample*)This)->actual_size);
return ((CMediaSample*)This)->actual_size;
}
@@ -306,12 +308,12 @@
long __MIDL_0010)
{
CMediaSample* cms = (CMediaSample*)This;
- Debug printf("CMediaSample_SetActualDataLength(%p, %ld) called\n", This, __MIDL_0010);
+ Debug mp_msg(MSGT_LOADER,MSGL_DBG4,"CMediaSample_SetActualDataLength(%p, %ld) called\n", This, __MIDL_0010);
if (__MIDL_0010 > cms->size)
{
char* c = cms->own_block;
- Debug printf("CMediaSample - buffer overflow %ld %d %p %p\n",
+ Debug mp_msg(MSGT_LOADER,MSGL_DBG4,"CMediaSample - buffer overflow %ld %d %p %p\n",
__MIDL_0010, ((CMediaSample*)This)->size, cms->own_block, cms->block);
cms->own_block = (char*) realloc(cms->own_block, (size_t) __MIDL_0010 + SAFETY_ACEL);
if (c == cms->block)
@@ -341,7 +343,7 @@
AM_MEDIA_TYPE** ppMediaType)
{
AM_MEDIA_TYPE* t;
- Debug printf("CMediaSample_GetMediaType(%p) called\n", This);
+ Debug mp_msg(MSGT_LOADER,MSGL_DBG4,"CMediaSample_GetMediaType(%p) called\n", This);
if(!ppMediaType)
return E_INVALIDARG;
if(!((CMediaSample*)This)->type_valid)
@@ -374,7 +376,7 @@
AM_MEDIA_TYPE *pMediaType)
{
AM_MEDIA_TYPE* t;
- Debug printf("CMediaSample_SetMediaType(%p) called\n", This);
+ Debug mp_msg(MSGT_LOADER,MSGL_DBG4,"CMediaSample_SetMediaType(%p) called\n", This);
if (!pMediaType)
return E_INVALIDARG;
t = &((CMediaSample*)This)->media_type;
@@ -409,7 +411,7 @@
*/
static HRESULT STDCALL CMediaSample_IsDiscontinuity(IMediaSample * This)
{
- Debug printf("CMediaSample_IsDiscontinuity(%p) called\n", This);
+ Debug mp_msg(MSGT_LOADER,MSGL_DBG4,"CMediaSample_IsDiscontinuity(%p) called\n", This);
return ((CMediaSample*) This)->isDiscontinuity;
}
@@ -427,7 +429,7 @@
static HRESULT STDCALL CMediaSample_SetDiscontinuity(IMediaSample * This,
long bDiscontinuity)
{
- Debug printf("CMediaSample_SetDiscontinuity(%p) called (%ld)\n", This, bDiscontinuity);
+ Debug mp_msg(MSGT_LOADER,MSGL_DBG4,"CMediaSample_SetDiscontinuity(%p) called (%ld)\n", This, bDiscontinuity);
((CMediaSample*) This)->isDiscontinuity = bDiscontinuity;
return 0;
}
@@ -447,7 +449,7 @@
/* [out] */ LONGLONG *pTimeStart,
/* [out] */ LONGLONG *pTimeEnd)
{
- Debug printf("CMediaSample_GetMediaTime(%p) called\n", This);
+ Debug mp_msg(MSGT_LOADER,MSGL_DBG4,"CMediaSample_GetMediaTime(%p) called\n", This);
if (pTimeStart)
*pTimeStart = ((CMediaSample*) This)->time_start;
if (pTimeEnd)
@@ -473,7 +475,7 @@
/* [in] */ LONGLONG *pTimeStart,
/* [in] */ LONGLONG *pTimeEnd)
{
- Debug printf("CMediaSample_SetMediaTime(%p) called\n", This);
+ Debug mp_msg(MSGT_LOADER,MSGL_DBG4,"CMediaSample_SetMediaTime(%p) called\n", This);
if (pTimeStart)
((CMediaSample*) This)->time_start = *pTimeStart;
if (pTimeEnd)
@@ -490,7 +492,7 @@
*/
static void CMediaSample_SetPointer(CMediaSample* This, char* pointer)
{
- Debug printf("CMediaSample_SetPointer(%p) called -> %p\n", This, pointer);
+ Debug mp_msg(MSGT_LOADER,MSGL_DBG4,"CMediaSample_SetPointer(%p) called -> %p\n", This, pointer);
if (pointer)
This->block = pointer;
else
@@ -505,7 +507,7 @@
*/
static void CMediaSample_ResetPointer(CMediaSample* This)
{
- Debug printf("CMediaSample_ResetPointer(%p) called\n", This);
+ Debug mp_msg(MSGT_LOADER,MSGL_DBG4,"CMediaSample_ResetPointer(%p) called\n", This);
This->block = This->own_block;
}
@@ -578,7 +580,7 @@
This->SetPointer = CMediaSample_SetPointer;
This->ResetPointer = CMediaSample_ResetPointer;
- Debug printf("CMediaSample_Create(%p) called - sample size %d, buffer %p\n",
+ Debug mp_msg(MSGT_LOADER,MSGL_DBG4,"CMediaSample_Create(%p) called - sample size %d, buffer %p\n",
This, This->size, This->block);
return This;
More information about the MPlayer-dev-eng
mailing list