summaryrefslogtreecommitdiffstats
path: root/loader/dshow/inputpin.c
diff options
context:
space:
mode:
authorvoroshil <voroshil@b3059339-0415-0410-9bf9-f77b7e298cf2>2007-02-23 09:58:01 +0000
committervoroshil <voroshil@b3059339-0415-0410-9bf9-f77b7e298cf2>2007-02-23 09:58:01 +0000
commita98fcdb7b3b147c15bd089b5a36fe3db0b0fd55a (patch)
tree62c860a2d965c9eb17c8c4d14f4fda9b36d2ff44 /loader/dshow/inputpin.c
parente33a1695bab717d2dd3a7e5c289ed822437b187f (diff)
downloadmpv-a98fcdb7b3b147c15bd089b5a36fe3db0b0fd55a.tar.bz2
mpv-a98fcdb7b3b147c15bd089b5a36fe3db0b0fd55a.tar.xz
Moving duplicated (and sometimes wrong) AM_MEDIA_TYPE related code into separate file
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@22323 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'loader/dshow/inputpin.c')
-rw-r--r--loader/dshow/inputpin.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/loader/dshow/inputpin.c b/loader/dshow/inputpin.c
index 7ad56669ac..be455f7a6b 100644
--- a/loader/dshow/inputpin.c
+++ b/loader/dshow/inputpin.c
@@ -5,6 +5,7 @@
*/
#include "inputpin.h"
+#include "mediatype.h"
#include "wine/winerror.h"
#include <string.h>
#include <stdio.h>
@@ -311,12 +312,7 @@ static long STDCALL CInputPin_ConnectionMediaType(IPin* This,
Debug printf("CInputPin_ConnectionMediaType(%p) called\n", This);
if (!pmt)
return E_INVALIDARG;
- *pmt=((CInputPin*)This)->type;
- if (pmt->cbFormat > 0)
- {
- pmt->pbFormat=malloc(pmt->cbFormat);
- memcpy(pmt->pbFormat, ((CInputPin*)This)->type.pbFormat, pmt->cbFormat);
- }
+ CopyMediaType(pmt,&(((CInputPin*)This)->type));
return 0;
}
@@ -527,6 +523,7 @@ static long STDCALL CInputPin_NewSegment(IPin* This,
static void CInputPin_Destroy(CInputPin* This)
{
free(This->vt);
+ FreeMediaType(&(This->type));
free(This);
}
@@ -550,7 +547,7 @@ CInputPin* CInputPinCreate(CBaseFilter* p, const AM_MEDIA_TYPE* amt)
This->refcount = 1;
This->parent = p;
- This->type = *amt;
+ CopyMediaType(&(This->type),amt);
This->vt= (IPin_vt*) malloc(sizeof(IPin_vt));