Commit 442f29ab authored by Andrew Talbot's avatar Andrew Talbot Committed by Alexandre Julliard

quartz: Assign to structs instead of using memcpy.

parent 90d83c42
......@@ -365,19 +365,19 @@ static HRESULT AVISplitter_ProcessStreamList(AVISplitterImpl * This, const BYTE
switch (pStrHdr->fccType)
{
case streamtypeVIDEO:
memcpy(&amt.formattype, &FORMAT_VideoInfo, sizeof(GUID));
amt.formattype = FORMAT_VideoInfo;
amt.pbFormat = NULL;
amt.cbFormat = 0;
break;
case streamtypeAUDIO:
memcpy(&amt.formattype, &FORMAT_WaveFormatEx, sizeof(GUID));
amt.formattype = FORMAT_WaveFormatEx;
break;
default:
memcpy(&amt.formattype, &FORMAT_None, sizeof(GUID));
amt.formattype = FORMAT_None;
}
memcpy(&amt.majortype, &MEDIATYPE_Video, sizeof(GUID));
amt.majortype = MEDIATYPE_Video;
amt.majortype.Data1 = pStrHdr->fccType;
memcpy(&amt.subtype, &MEDIATYPE_Video, sizeof(GUID));
amt.subtype = MEDIATYPE_Video;
amt.subtype.Data1 = pStrHdr->fccHandler;
TRACE("Subtype FCC: %.04s\n", (LPCSTR)&pStrHdr->fccHandler);
amt.lSampleSize = pStrHdr->dwSampleSize;
......@@ -448,7 +448,7 @@ static HRESULT AVISplitter_ProcessStreamList(AVISplitterImpl * This, const BYTE
if (IsEqualGUID(&amt.formattype, &FORMAT_WaveFormatEx))
{
memcpy(&amt.subtype, &MEDIATYPE_Video, sizeof(GUID));
amt.subtype = MEDIATYPE_Video;
amt.subtype.Data1 = ((WAVEFORMATEX *)amt.pbFormat)->wFormatTag;
}
......
......@@ -26,7 +26,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(quartz);
HRESULT CopyMediaType(AM_MEDIA_TYPE * pDest, const AM_MEDIA_TYPE *pSrc)
{
memcpy(pDest, pSrc, sizeof(AM_MEDIA_TYPE));
*pDest = *pSrc;
if (!pSrc->pbFormat) return S_OK;
if (!(pDest->pbFormat = CoTaskMemAlloc(pSrc->cbFormat)))
return E_OUTOFMEMORY;
......
......@@ -609,7 +609,7 @@ static HRESULT WINAPI FileSource_Load(IFileSourceFilter * iface, LPCOLESTR pszFi
This->pmt->pbFormat = NULL;
This->pmt->pUnk = NULL;
This->pmt->lSampleSize = 0;
memcpy(&This->pmt->formattype, &FORMAT_None, sizeof(FORMAT_None));
This->pmt->formattype = FORMAT_None;
hr = GetClassMediaFile(pReader, pszFileName, &This->pmt->majortype, &This->pmt->subtype);
if (FAILED(hr))
{
......
......@@ -188,9 +188,9 @@ static HRESULT WINAPI BaseMemAllocator_SetProperties(IMemAllocator * iface, ALLO
hr = E_OUTOFMEMORY;
else
{
memcpy(This->pProps, pRequest, sizeof(*This->pProps));
memcpy(pActual, pRequest, sizeof(*pActual));
*This->pProps = *pRequest;
*pActual = *pRequest;
hr = S_OK;
}
......
......@@ -317,9 +317,9 @@ static HRESULT MPEGSplitter_init_audio(MPEGSplitterImpl *This, const BYTE *heade
ppiOutput->pFilter = (IBaseFilter*)This;
wsprintfW(ppiOutput->achName, wszAudioStream);
memcpy(&pamt->formattype, &FORMAT_WaveFormatEx, sizeof(GUID));
memcpy(&pamt->majortype, &MEDIATYPE_Audio, sizeof(GUID));
memcpy(&pamt->subtype, &MEDIASUBTYPE_MPEG1AudioPayload, sizeof(GUID));
pamt->formattype = FORMAT_WaveFormatEx;
pamt->majortype = MEDIATYPE_Audio;
pamt->subtype = MEDIASUBTYPE_MPEG1AudioPayload;
pamt->lSampleSize = 0;
pamt->bFixedSizeSamples = TRUE;
......
......@@ -200,7 +200,7 @@ HRESULT OutputPin_Init(const PIN_INFO * pPinInfo, const ALLOCATOR_PROPERTIES * p
pPinImpl->pConnectSpecific = OutputPin_ConnectSpecific;
if (props)
{
memcpy(&pPinImpl->allocProps, props, sizeof(pPinImpl->allocProps));
pPinImpl->allocProps = *props;
if (pPinImpl->allocProps.cbAlign == 0)
pPinImpl->allocProps.cbAlign = 1;
}
......
......@@ -256,13 +256,13 @@ static HRESULT WAVEParser_InputPin_PreConnect(IPin * iface, IPin * pConnectPin)
return E_FAIL;
}
memcpy(&amt.majortype, &MEDIATYPE_Audio, sizeof(GUID));
memcpy(&amt.formattype, &FORMAT_WaveFormatEx, sizeof(GUID));
amt.majortype = MEDIATYPE_Audio;
amt.formattype = FORMAT_WaveFormatEx;
amt.cbFormat = chunk.cb;
amt.pbFormat = CoTaskMemAlloc(amt.cbFormat);
amt.pUnk = NULL;
hr = IAsyncReader_SyncRead(This->pReader, pos, amt.cbFormat, amt.pbFormat);
memcpy(&amt.subtype, &MEDIATYPE_Audio, sizeof(GUID));
amt.subtype = MEDIATYPE_Audio;
amt.subtype.Data1 = ((WAVEFORMATEX*)amt.pbFormat)->wFormatTag;
pos += chunk.cb;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment