aboutsummaryrefslogtreecommitdiffhomepage
path: root/loader
diff options
context:
space:
mode:
authorGravatar alex <alex@b3059339-0415-0410-9bf9-f77b7e298cf2>2003-04-21 20:12:43 +0000
committerGravatar alex <alex@b3059339-0415-0410-9bf9-f77b7e298cf2>2003-04-21 20:12:43 +0000
commit11df85a3dd3bf9f0db534e1d22d55a38996cdd50 (patch)
treef17ad8368810fb597dd3f30ff54215fce03f2ae6 /loader
parent9f6cd22e445429d6ea67b1d936f6d00256b9abf2 (diff)
CoTaskMemAlloc/Free vs malloc/free cleanup
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@9965 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'loader')
-rw-r--r--loader/dshow/cmediasample.c12
-rw-r--r--loader/dshow/inputpin.c2
-rw-r--r--loader/dshow/outputpin.c8
3 files changed, 11 insertions, 11 deletions
diff --git a/loader/dshow/cmediasample.c b/loader/dshow/cmediasample.c
index e0519129eb..8c0015e027 100644
--- a/loader/dshow/cmediasample.c
+++ b/loader/dshow/cmediasample.c
@@ -47,7 +47,7 @@ void CMediaSample_Destroy(CMediaSample* This)
free(This->vt);
free(This->own_block);
if (This->media_type.pbFormat)
- CoTaskMemFree(This->media_type.pbFormat);
+ free(This->media_type.pbFormat);
free(This);
}
@@ -171,10 +171,10 @@ static HRESULT STDCALL CMediaSample_GetMediaType(IMediaSample* This,
}
t = &((CMediaSample*)This)->media_type;
- // if(t.pbFormat)CoTaskMemFree(t.pbFormat);
- (*ppMediaType) = (AM_MEDIA_TYPE*)CoTaskMemAlloc(sizeof(AM_MEDIA_TYPE));
+ // if(t.pbFormat)free(t.pbFormat);
+ (*ppMediaType) = (AM_MEDIA_TYPE*)malloc(sizeof(AM_MEDIA_TYPE));
**ppMediaType = *t;
- (*ppMediaType)->pbFormat = (char*)CoTaskMemAlloc(t->cbFormat);
+ (*ppMediaType)->pbFormat = (char*)malloc(t->cbFormat);
memcpy((*ppMediaType)->pbFormat, t->pbFormat, t->cbFormat);
// *ppMediaType=0; //media type was not changed
return 0;
@@ -189,11 +189,11 @@ static HRESULT STDCALL CMediaSample_SetMediaType(IMediaSample * This,
return E_INVALIDARG;
t = &((CMediaSample*)This)->media_type;
if (t->pbFormat)
- CoTaskMemFree(t->pbFormat);
+ free(t->pbFormat);
t = pMediaType;
if (t->cbFormat)
{
- t->pbFormat = (char*)CoTaskMemAlloc(t->cbFormat);
+ t->pbFormat = (char*)malloc(t->cbFormat);
memcpy(t->pbFormat, pMediaType->pbFormat, t->cbFormat);
}
else
diff --git a/loader/dshow/inputpin.c b/loader/dshow/inputpin.c
index 5fcc039e1c..8b6a1e8693 100644
--- a/loader/dshow/inputpin.c
+++ b/loader/dshow/inputpin.c
@@ -173,7 +173,7 @@ static long STDCALL CInputPin_ConnectionMediaType(IPin* This,
*pmt=((CInputPin*)This)->type;
if (pmt->cbFormat > 0)
{
- pmt->pbFormat=(char *)CoTaskMemAlloc(pmt->cbFormat);
+ pmt->pbFormat=(char *)malloc(pmt->cbFormat);
memcpy(pmt->pbFormat, ((CInputPin*)This)->type.pbFormat, pmt->cbFormat);
}
return 0;
diff --git a/loader/dshow/outputpin.c b/loader/dshow/outputpin.c
index 14e8af756a..26d3014ad8 100644
--- a/loader/dshow/outputpin.c
+++ b/loader/dshow/outputpin.c
@@ -51,12 +51,12 @@ static HRESULT STDCALL CEnumMediaTypes_Next(IEnumMediaTypes * This,
if (pcFetched)
*pcFetched=1;
- ppMediaTypes[0] = (AM_MEDIA_TYPE *)CoTaskMemAlloc(sizeof(AM_MEDIA_TYPE));
+ ppMediaTypes[0] = (AM_MEDIA_TYPE *)malloc(sizeof(AM_MEDIA_TYPE));
// copy structures - C can handle this...
**ppMediaTypes = *type;
if (ppMediaTypes[0]->pbFormat)
{
- ppMediaTypes[0]->pbFormat=(char *)CoTaskMemAlloc(ppMediaTypes[0]->cbFormat);
+ ppMediaTypes[0]->pbFormat=(char *)malloc(ppMediaTypes[0]->cbFormat);
memcpy(ppMediaTypes[0]->pbFormat, type->pbFormat, ppMediaTypes[0]->cbFormat);
}
if (cMediaTypes == 1)
@@ -171,7 +171,7 @@ static HRESULT STDCALL COutputPin_Connect(IPin * This,
*pmt=((COutputPin*)This)->type;
if(pmt->cbFormat>0)
{
- pmt->pbFormat=CoTaskMemAlloc(pmt->cbFormat);
+ pmt->pbFormat=malloc(pmt->cbFormat);
memcpy(pmt->pbFormat, ((COutputPin*)This)->type.pbFormat, pmt->cbFormat);
}
*/
@@ -214,7 +214,7 @@ static HRESULT STDCALL COutputPin_ConnectionMediaType(IPin * This,
*pmt = ((COutputPin*)This)->type;
if (pmt->cbFormat>0)
{
- pmt->pbFormat=(char *)CoTaskMemAlloc(pmt->cbFormat);
+ pmt->pbFormat=(char *)malloc(pmt->cbFormat);
memcpy(pmt->pbFormat, ((COutputPin*)This)->type.pbFormat, pmt->cbFormat);
}
return 0;