diff options
author | Uoti Urpala <uau@glyph.nonexistent.invalid> | 2009-07-07 02:26:13 +0300 |
---|---|---|
committer | Uoti Urpala <uau@glyph.nonexistent.invalid> | 2009-07-07 02:34:35 +0300 |
commit | 0eb321bf2c1cc0e048faff26a01f86cdd3ec254f (patch) | |
tree | 71cb9bd9ed121156d3382066c0722c73189afe04 /loader | |
parent | 6d908205fbadbdf7ccdc6c5e0eb918f0b43f16e0 (diff) | |
download | mpv-0eb321bf2c1cc0e048faff26a01f86cdd3ec254f.tar.bz2 mpv-0eb321bf2c1cc0e048faff26a01f86cdd3ec254f.tar.xz |
Remove trailing whitespace from most files
Diffstat (limited to 'loader')
42 files changed, 600 insertions, 608 deletions
diff --git a/loader/afl.c b/loader/afl.c index 36b666bb0a..e9f52e157e 100644 --- a/loader/afl.c +++ b/loader/afl.c @@ -5,7 +5,7 @@ Its content will be based mainly on wine/dlls/msacm32 actually, for audio decompression only the following functions are needed: - + acmStreamOpen ( takes formats of src and dest, returns stream handle ) acmStreamPrepareHeader ( takes stream handler and info on data ) acmStreamConvert ( the same as PrepareHeader ) @@ -13,13 +13,13 @@ acmStreamClose acmStreamSize maybe acmStreamReset - - In future I'll also add functions for format enumeration, + + In future I'll also add functions for format enumeration, but not right now. Modified for use with MPlayer, detailed changelog at http://svn.mplayerhq.hu/mplayer/trunk/ - + ***************************************************************************/ #include "config.h" #include "debug.h" @@ -59,26 +59,26 @@ MMRESULT WINAPI acmDriverAddA(PHACMDRIVERID phadid, HINSTANCE hinstModule, { if (!phadid) return MMSYSERR_INVALPARAM; - + /* Check if any unknown flags */ - if (fdwAdd & + if (fdwAdd & ~(ACM_DRIVERADDF_FUNCTION|ACM_DRIVERADDF_NOTIFYHWND| ACM_DRIVERADDF_GLOBAL)) return MMSYSERR_INVALFLAG; - + /* Check if any incompatible flags */ - if ((fdwAdd & ACM_DRIVERADDF_FUNCTION) && + if ((fdwAdd & ACM_DRIVERADDF_FUNCTION) && (fdwAdd & ACM_DRIVERADDF_NOTIFYHWND)) return MMSYSERR_INVALFLAG; - - /* FIXME: in fact, should GetModuleFileName(hinstModule) and do a + + /* FIXME: in fact, should GetModuleFileName(hinstModule) and do a * LoadDriver on it, to be sure we can call SendDriverMessage on the * hDrvr handle. */ *phadid = (HACMDRIVERID) MSACM_RegisterDriver(NULL, 0, hinstModule); - + /* FIXME: lParam, dwPriority and fdwAdd ignored */ - + return MMSYSERR_NOERROR; } @@ -89,10 +89,10 @@ MMRESULT WINAPI acmDriverClose(HACMDRIVER had, DWORD fdwClose) { PWINE_ACMDRIVER p; PWINE_ACMDRIVER* tp; - + if (fdwClose) return MMSYSERR_INVALFLAG; - + p = MSACM_GetDriver(had); if (!p) return MMSYSERR_INVALHANDLE; @@ -103,12 +103,12 @@ MMRESULT WINAPI acmDriverClose(HACMDRIVER had, DWORD fdwClose) break; } } - + if (p->hDrvr && !p->obj.pACMDriverID->pACMDriverList) CloseDriver(p->hDrvr); - + HeapFree(MSACM_hHeap, 0, p); - + return MMSYSERR_NOERROR; } @@ -123,11 +123,11 @@ MMRESULT WINAPI acmDriverEnum(ACMDRIVERENUMCB fnCallback, DWORD dwInstance, DWOR if (!fnCallback) { return MMSYSERR_INVALPARAM; } - + if (fdwEnum && ~(ACM_DRIVERENUMF_NOLOCAL|ACM_DRIVERENUMF_DISABLED)) { return MMSYSERR_INVALFLAG; } - + for (p = MSACM_pFirstACMDriverID; p; p = p->pNextACMDriverID) { fdwSupport = ACMDRIVERDETAILS_SUPPORTF_CODEC; if (!p->bEnabled) { @@ -138,7 +138,7 @@ MMRESULT WINAPI acmDriverEnum(ACMDRIVERENUMCB fnCallback, DWORD dwInstance, DWOR } (*fnCallback)((HACMDRIVERID) p, dwInstance, fdwSupport); } - + return MMSYSERR_NOERROR; } @@ -148,19 +148,19 @@ MMRESULT WINAPI acmDriverEnum(ACMDRIVERENUMCB fnCallback, DWORD dwInstance, DWOR MMRESULT WINAPI acmDriverID(HACMOBJ hao, PHACMDRIVERID phadid, DWORD fdwDriverID) { PWINE_ACMOBJ pao; - + pao = MSACM_GetObj(hao); if (!pao) return MMSYSERR_INVALHANDLE; - + if (!phadid) return MMSYSERR_INVALPARAM; - + if (fdwDriverID) return MMSYSERR_INVALFLAG; - + *phadid = (HACMDRIVERID) pao->pACMDriverID; - + return MMSYSERR_NOERROR; } @@ -174,12 +174,12 @@ LRESULT WINAPI acmDriverMessage(HACMDRIVER had, UINT uMsg, LPARAM lParam1, LPARA PWINE_ACMDRIVER pad = MSACM_GetDriver(had); if (!pad) return MMSYSERR_INVALPARAM; - + /* FIXME: Check if uMsg legal */ - + if (!SendDriverMessage(pad->hDrvr, uMsg, lParam1, lParam2)) return MMSYSERR_NOTSUPPORTED; - + return MMSYSERR_NOERROR; } @@ -198,14 +198,14 @@ MMRESULT WINAPI acmDriverOpen(PHACMDRIVER phad, HACMDRIVERID hadid, DWORD fdwOpe if (!phad) return MMSYSERR_INVALPARAM; - - padid = MSACM_GetDriverID(hadid); + + padid = MSACM_GetDriverID(hadid); if (!padid) return MMSYSERR_INVALHANDLE; - + if (fdwOpen) return MMSYSERR_INVALFLAG; - + pad = (PWINE_ACMDRIVER) HeapAlloc(MSACM_hHeap, 0, sizeof(WINE_ACMDRIVER)); if (!pad) return MMSYSERR_NOMEM; @@ -221,7 +221,7 @@ MMRESULT WINAPI acmDriverOpen(PHACMDRIVER phad, HACMDRIVERID hadid, DWORD fdwOpe pad->hDrvr = OpenDriverA((long)&icopen); else pad->hDrvr = padid->hInstModule; - + if (!pad->hDrvr) { HeapFree(MSACM_hHeap, 0, pad); return MMSYSERR_ERROR; @@ -245,16 +245,16 @@ MMRESULT WINAPI acmDriverOpen(PHACMDRIVER phad, HACMDRIVERID hadid, DWORD fdwOpe MMRESULT WINAPI acmDriverRemove(HACMDRIVERID hadid, DWORD fdwRemove) { PWINE_ACMDRIVERID padid; - + padid = MSACM_GetDriverID(hadid); if (!padid) return MMSYSERR_INVALHANDLE; - + if (fdwRemove) return MMSYSERR_INVALFLAG; - + MSACM_UnregisterDriver(padid); - + return MMSYSERR_NOERROR; } @@ -267,7 +267,7 @@ PWINE_ACMDRIVERID MSACM_pFirstACMDriverID = NULL; PWINE_ACMDRIVERID MSACM_pLastACMDriverID = NULL; /*********************************************************************** - * MSACM_RegisterDriver32() + * MSACM_RegisterDriver32() */ PWINE_ACMDRIVERID MSACM_RegisterDriver(const char* pszFileName, WORD wFormatTag, @@ -295,7 +295,7 @@ PWINE_ACMDRIVERID MSACM_RegisterDriver(const char* pszFileName, MSACM_pLastACMDriverID = padid; if (!MSACM_pFirstACMDriverID) MSACM_pFirstACMDriverID = padid; - + return padid; } @@ -306,13 +306,13 @@ PWINE_ACMDRIVERID MSACM_RegisterDriver(const char* pszFileName, PWINE_ACMDRIVERID MSACM_UnregisterDriver(PWINE_ACMDRIVERID p) { PWINE_ACMDRIVERID pNextACMDriverID; - + while (p->pACMDriverList) acmDriverClose((HACMDRIVER) p->pACMDriverList, 0); - + if (p->pszFileName) free(p->pszFileName); - + if (p == MSACM_pFirstACMDriverID) MSACM_pFirstACMDriverID = p->pNextACMDriverID; if (p == MSACM_pLastACMDriverID) @@ -322,11 +322,11 @@ PWINE_ACMDRIVERID MSACM_UnregisterDriver(PWINE_ACMDRIVERID p) p->pPrevACMDriverID->pNextACMDriverID = p->pNextACMDriverID; if (p->pNextACMDriverID) p->pNextACMDriverID->pPrevACMDriverID = p->pPrevACMDriverID; - + pNextACMDriverID = p->pNextACMDriverID; - + HeapFree(MSACM_hHeap, 0, p); - + return pNextACMDriverID; } @@ -343,7 +343,7 @@ void MSACM_UnregisterAllDrivers(void) } /*********************************************************************** - * MSACM_GetDriverID32() + * MSACM_GetDriverID32() */ PWINE_ACMDRIVERID MSACM_GetDriverID(HACMDRIVERID hDriverID) { @@ -380,16 +380,16 @@ MMRESULT WINAPI acmStreamOpen(PHACMSTREAM phas, HACMDRIVER had, PWAVEFORMATEX pw MMRESULT ret; int wfxSrcSize; int wfxDstSize; - + TRACE("(%p, 0x%08x, %p, %p, %p, %ld, %ld, %ld)\n", phas, had, pwfxSrc, pwfxDst, pwfltr, dwCallback, dwInstance, fdwOpen); - TRACE("src [wFormatTag=%u, nChannels=%u, nSamplesPerSec=%lu, nAvgBytesPerSec=%lu, nBlockAlign=%u, wBitsPerSample=%u, cbSize=%u]\n", - pwfxSrc->wFormatTag, pwfxSrc->nChannels, pwfxSrc->nSamplesPerSec, pwfxSrc->nAvgBytesPerSec, + TRACE("src [wFormatTag=%u, nChannels=%u, nSamplesPerSec=%lu, nAvgBytesPerSec=%lu, nBlockAlign=%u, wBitsPerSample=%u, cbSize=%u]\n", + pwfxSrc->wFormatTag, pwfxSrc->nChannels, pwfxSrc->nSamplesPerSec, pwfxSrc->nAvgBytesPerSec, pwfxSrc->nBlockAlign, pwfxSrc->wBitsPerSample, pwfxSrc->cbSize); - TRACE("dst [wFormatTag=%u, nChannels=%u, nSamplesPerSec=%lu, nAvgBytesPerSec=%lu, nBlockAlign=%u, wBitsPerSample=%u, cbSize=%u]\n", - pwfxDst->wFormatTag, pwfxDst->nChannels, pwfxDst->nSamplesPerSec, pwfxDst->nAvgBytesPerSec, + TRACE("dst [wFormatTag=%u, nChannels=%u, nSamplesPerSec=%lu, nAvgBytesPerSec=%lu, nBlockAlign=%u, wBitsPerSample=%u, cbSize=%u]\n", + pwfxDst->wFormatTag, pwfxDst->nChannels, pwfxDst->nSamplesPerSec, pwfxDst->nAvgBytesPerSec, pwfxDst->nBlockAlign, pwfxDst->wBitsPerSample, pwfxDst->cbSize); #define SIZEOF_WFX(wfx) (sizeof(WAVEFORMATEX) + ((wfx->wFormatTag == WAVE_FORMAT_PCM) ? 0 : wfx->cbSize)) @@ -414,19 +414,19 @@ MMRESULT WINAPI acmStreamOpen(PHACMSTREAM phas, HACMDRIVER had, PWAVEFORMATEX pw } else { was->drvInst.pwfltr = NULL; } - was->drvInst.dwCallback = dwCallback; + was->drvInst.dwCallback = dwCallback; was->drvInst.dwInstance = dwInstance; was->drvInst.fdwOpen = fdwOpen; - was->drvInst.fdwDriver = 0L; - was->drvInst.dwDriver = 0L; + was->drvInst.fdwDriver = 0L; + was->drvInst.dwDriver = 0L; was->drvInst.has = (HACMSTREAM)was; - + if (had) { if (!(wad = MSACM_GetDriver(had))) { ret = MMSYSERR_INVALPARAM; goto errCleanUp; } - + was->obj.pACMDriverID = wad->obj.pACMDriverID; was->pDrv = wad; was->hAcmDriver = 0; /* not to close it in acmStreamClose */ @@ -446,13 +446,13 @@ MMRESULT WINAPI acmStreamOpen(PHACMSTREAM phas, HACMDRIVER had, PWAVEFORMATEX pw else goto errCleanUp; - ret=acmDriverOpen2(drv_tag); + ret=acmDriverOpen2(drv_tag); if (ret == MMSYSERR_NOERROR) { if ((wad = MSACM_GetDriver(had)) != 0) { was->obj.pACMDriverID = wad->obj.pACMDriverID; was->pDrv = wad; was->hAcmDriver = had; - + ret = SendDriverMessage(wad->hDrvr, ACMDM_STREAM_OPEN, (DWORD)&was->drvInst, 0L); if (ret == MMSYSERR_NOERROR) { if (fdwOpen & ACM_STREAMOPENF_QUERY) { @@ -464,7 +464,7 @@ MMRESULT WINAPI acmStreamOpen(PHACMSTREAM phas, HACMDRIVER had, PWAVEFORMATEX pw acmDriverClose(had, 0L);*/ //if(MSACM_pFirstACMDriverID==NULL) // MSACM_RegisterAllDrivers(); - + for (wadi = MSACM_pFirstACMDriverID; wadi; wadi = wadi->pNextACMDriverID) { /* Check Format */ @@ -476,7 +476,7 @@ MMRESULT WINAPI acmStreamOpen(PHACMSTREAM phas, HACMDRIVER had, PWAVEFORMATEX pw was->obj.pACMDriverID = wad->obj.pACMDriverID; was->pDrv = wad; was->hAcmDriver = had; - + ret = SendDriverMessage(wad->hDrvr, ACMDM_STREAM_OPEN, (DWORD)&was->drvInst, 0L); //lhacm - crash printf("RETOPEN %d\n", ret); //ret = 0; @@ -487,7 +487,7 @@ MMRESULT WINAPI acmStreamOpen(PHACMSTREAM phas, HACMDRIVER had, PWAVEFORMATEX pw break; } } - // no match, close this acm driver and try next one + // no match, close this acm driver and try next one acmDriverClose(had, 0L); } } @@ -506,7 +506,7 @@ MMRESULT WINAPI acmStreamOpen(PHACMSTREAM phas, HACMDRIVER had, PWAVEFORMATEX pw #endif return ret; } -errCleanUp: +errCleanUp: if (phas) *phas = (HACMSTREAM)0; HeapFree(MSACM_hHeap, 0, was); @@ -519,16 +519,16 @@ MMRESULT WINAPI acmStreamClose(HACMSTREAM has, DWORD fdwClose) { PWINE_ACMSTREAM was; MMRESULT ret; - + TRACE("(0x%08x, %ld)\n", has, fdwClose); - + if ((was = ACM_GetStream(has)) == NULL) { return MMSYSERR_INVALHANDLE; } ret = SendDriverMessage(was->pDrv->hDrvr, ACMDM_STREAM_CLOSE, (DWORD)&was->drvInst, 0); if (ret == MMSYSERR_NOERROR) { if (was->hAcmDriver) - acmDriverClose(was->hAcmDriver, 0L); + acmDriverClose(was->hAcmDriver, 0L); HeapFree(MSACM_hHeap, 0, was); #ifdef WIN32_LOADER CodecRelease(); @@ -541,7 +541,7 @@ MMRESULT WINAPI acmStreamClose(HACMSTREAM has, DWORD fdwClose) /*********************************************************************** * acmStreamConvert (MSACM32.38) */ -MMRESULT WINAPI acmStreamConvert(HACMSTREAM has, PACMSTREAMHEADER pash, +MMRESULT WINAPI acmStreamConvert(HACMSTREAM has, PACMSTREAMHEADER pash, DWORD fdwConvert) { PWINE_ACMSTREAM was; @@ -570,7 +570,7 @@ MMRESULT WINAPI acmStreamConvert(HACMSTREAM has, PACMSTREAMHEADER pash, padsh->pbPreparedDst != padsh->pbDst || padsh->cbPreparedDstLength < padsh->cbDstLength) { return MMSYSERR_INVALPARAM; - } + } padsh->fdwConvert = fdwConvert; @@ -586,7 +586,7 @@ MMRESULT WINAPI acmStreamConvert(HACMSTREAM has, PACMSTREAMHEADER pash, /*********************************************************************** * acmStreamPrepareHeader (MSACM32.41) */ -MMRESULT WINAPI acmStreamPrepareHeader(HACMSTREAM has, PACMSTREAMHEADER pash, +MMRESULT WINAPI acmStreamPrepareHeader(HACMSTREAM has, PACMSTREAMHEADER pash, DWORD fdwPrepare) { PWINE_ACMSTREAM was; @@ -594,7 +594,7 @@ MMRESULT WINAPI acmStreamPrepareHeader(HACMSTREAM has, PACMSTREAMHEADER pash, PACMDRVSTREAMHEADER padsh; TRACE("(0x%08x, %p, %ld)\n", has, pash, fdwPrepare); - + if ((was = ACM_GetStream(has)) == NULL) return MMSYSERR_INVALHANDLE; if (!pash || pash->cbStruct < sizeof(ACMSTREAMHEADER)) @@ -669,15 +669,15 @@ MMRESULT WINAPI acmStreamReset(HACMSTREAM has, DWORD fdwReset) /*********************************************************************** * acmStreamSize (MSACM32.43) */ -MMRESULT WINAPI acmStreamSize(HACMSTREAM has, DWORD cbInput, +MMRESULT WINAPI acmStreamSize(HACMSTREAM has, DWORD cbInput, LPDWORD pdwOutputBytes, DWORD fdwSize) { PWINE_ACMSTREAM was; ACMDRVSTREAMSIZE adss; MMRESULT ret; - + TRACE("(0x%08x, %ld, %p, %ld)\n", has, cbInput, pdwOutputBytes, fdwSize); - + if ((was = ACM_GetStream(has)) == NULL) { return MMSYSERR_INVALHANDLE; } @@ -686,7 +686,7 @@ MMRESULT WINAPI acmStreamSize(HACMSTREAM has, DWORD cbInput, } *pdwOutputBytes = 0L; - + switch (fdwSize & ACM_STREAMSIZEF_QUERYMASK) { case ACM_STREAMSIZEF_DESTINATION: adss.cbDstLength = cbInput; @@ -696,13 +696,13 @@ MMRESULT WINAPI acmStreamSize(HACMSTREAM has, DWORD cbInput, adss.cbSrcLength = cbInput; adss.cbDstLength = 0; break; - default: + default: return MMSYSERR_INVALFLAG; } - + adss.cbStruct = sizeof(adss); adss.fdwSize = fdwSize; - ret = SendDriverMessage(was->pDrv->hDrvr, ACMDM_STREAM_SIZE, + ret = SendDriverMessage(was->pDrv->hDrvr, ACMDM_STREAM_SIZE, (DWORD)&was->drvInst, (DWORD)&adss); if (ret == MMSYSERR_NOERROR) { switch (fdwSize & ACM_STREAMSIZEF_QUERYMASK) { @@ -721,7 +721,7 @@ MMRESULT WINAPI acmStreamSize(HACMSTREAM has, DWORD cbInput, /*********************************************************************** * acmStreamUnprepareHeader (MSACM32.44) */ -MMRESULT WINAPI acmStreamUnprepareHeader(HACMSTREAM has, PACMSTREAMHEADER pash, +MMRESULT WINAPI acmStreamUnprepareHeader(HACMSTREAM has, PACMSTREAMHEADER pash, DWORD fdwUnprepare) { PWINE_ACMSTREAM was; @@ -729,7 +729,7 @@ MMRESULT WINAPI acmStreamUnprepareHeader(HACMSTREAM has, PACMSTREAMHEADER pash, PACMDRVSTREAMHEADER padsh; TRACE("(0x%08x, %p, %ld)\n", has, pash, fdwUnprepare); - + if ((was = ACM_GetStream(has)) == NULL) return MMSYSERR_INVALHANDLE; if (!pash || pash->cbStruct < sizeof(ACMSTREAMHEADER)) @@ -750,7 +750,7 @@ MMRESULT WINAPI acmStreamUnprepareHeader(HACMSTREAM has, PACMSTREAMHEADER pash, padsh->pbPreparedDst != padsh->pbDst || padsh->cbPreparedDstLength < padsh->cbDstLength) { return MMSYSERR_INVALPARAM; - } + } padsh->fdwConvert = fdwUnprepare; diff --git a/loader/com.h b/loader/com.h index 27f6a916b7..6bbbc55b7d 100644 --- a/loader/com.h +++ b/loader/com.h @@ -71,7 +71,7 @@ struct IClassFactory struct IClassFactory_vt* vt; }; -#ifdef WIN32_LOADER +#ifdef WIN32_LOADER long CoCreateInstance(GUID* rclsid, struct IUnknown* pUnkOuter, long dwClsContext, const GUID* riid, void** ppv); void* CoTaskMemAlloc(unsigned long cb); diff --git a/loader/dmo/DMO_AudioDecoder.c b/loader/dmo/DMO_AudioDecoder.c index 033133c6fc..1b08757349 100644 --- a/loader/dmo/DMO_AudioDecoder.c +++ b/loader/dmo/DMO_AudioDecoder.c @@ -14,7 +14,7 @@ #include "DMO_AudioDecoder.h" struct DMO_AudioDecoder -{ +{ DMO_MEDIA_TYPE m_sOurType, m_sDestType; DMO_Filter* m_pDMO_Filter; char* m_sVhdr; @@ -44,17 +44,17 @@ DMO_AudioDecoder * DMO_AudioDecoder_Open(char* dllname, GUID* guid, WAVEFORMATEX Setup_LDT_Keeper(); Setup_FS_Segment(); #endif - + this = malloc(sizeof(DMO_AudioDecoder)); - + this->m_iFlushed=1; - + sz = 18 + wf->cbSize; this->m_sVhdr = malloc(sz); memcpy(this->m_sVhdr, wf, sz); this->m_sVhdr2 = malloc(18); memcpy(this->m_sVhdr2, this->m_sVhdr, 18); - + pWF = (WAVEFORMATEX*)this->m_sVhdr2; pWF->wFormatTag = 1; pWF->wBitsPerSample = 16; @@ -62,7 +62,7 @@ DMO_AudioDecoder * DMO_AudioDecoder_Open(char* dllname, GUID* guid, WAVEFORMATEX pWF->nBlockAlign = 2*pWF->nChannels; //pWF->nChannels * (pWF->wBitsPerSample + 7) / 8; pWF->nAvgBytesPerSec = pWF->nBlockAlign * pWF->nSamplesPerSec; pWF->cbSize = 0; - + memset(&this->m_sOurType, 0, sizeof(this->m_sOurType)); this->m_sOurType.majortype=MEDIATYPE_Audio; this->m_sOurType.subtype=MEDIASUBTYPE_PCM; @@ -92,7 +92,7 @@ print_wave_header((WAVEFORMATEX *)this->m_sVhdr2, MSGL_V); free(this); return NULL; } - + return this; } @@ -120,7 +120,7 @@ int DMO_AudioDecoder_Convert(DMO_AudioDecoder *this, const void* in_data, unsign #ifdef WIN32_LOADER Setup_FS_Segment(); #endif - + //m_pDMO_Filter->m_pMedia->vt->Lock(m_pDMO_Filter->m_pMedia, 1); bufferin = CMediaBufferCreate(in_size, (void*)in_data, in_size, 1); r = this->m_pDMO_Filter->m_pMedia->vt->ProcessInput(this->m_pDMO_Filter->m_pMedia, 0, @@ -148,7 +148,7 @@ int DMO_AudioDecoder_Convert(DMO_AudioDecoder *this, const void* in_data, unsign ((IMediaBuffer*)db.pBuffer)->vt->GetBufferAndLength((IMediaBuffer*)db.pBuffer, 0, &written); ((IMediaBuffer*)db.pBuffer)->vt->Release((IUnknown*)db.pBuffer); - + //printf("RESULTB: %d 0x%x %ld\n", r, r, written); //printf("Converted %d -> %d\n", in_size, out_size); } diff --git a/loader/dmo/DMO_VideoDecoder.c b/loader/dmo/DMO_VideoDecoder.c index 9f3e9d7eb8..d5a56ebefd 100644 --- a/loader/dmo/DMO_VideoDecoder.c +++ b/loader/dmo/DMO_VideoDecoder.c @@ -20,7 +20,7 @@ struct DMO_VideoDecoder { IVideoDecoder iv; - + DMO_Filter* m_pDMO_Filter; AM_MEDIA_TYPE m_sOurType, m_sDestType; VIDEOINFOHEADER* m_sVhdr; @@ -63,7 +63,7 @@ struct ct { int cap; char *name; }; - + static ct check[] = { { fccI420, 12, &MEDIASUBTYPE_I420, CAP_I420, NULL }, { fccYV12, 12, &MEDIASUBTYPE_YV12, CAP_YV12, NULL }, @@ -86,10 +86,10 @@ DMO_VideoDecoder * DMO_VideoDecoder_Open(char* dllname, GUID* guid, BITMAPINFOHE DMO_VideoDecoder *this; HRESULT result; ct* c; - + this = malloc(sizeof(DMO_VideoDecoder)); memset( this, 0, sizeof(DMO_VideoDecoder)); - + this->m_sVhdr2 = 0; this->m_iLastQuality = -1; this->m_iMaxAuto = maxauto; @@ -103,10 +103,10 @@ DMO_VideoDecoder * DMO_VideoDecoder_Open(char* dllname, GUID* guid, BITMAPINFOHE /*try*/ { unsigned int bihs; - + bihs = (format->biSize < (int) sizeof(BITMAPINFOHEADER)) ? sizeof(BITMAPINFOHEADER) : format->biSize; - + this->iv.m_bh = malloc(bihs); memcpy(this->iv.m_bh, format, bihs); this->iv.m_bh->biSize = bihs; @@ -118,7 +118,7 @@ DMO_VideoDecoder * DMO_VideoDecoder_Open(char* dllname, GUID* guid, BITMAPINFOHE this->iv.m_iPlaypos = -1; this->iv.m_fQuality = 0.0f; this->iv.m_bCapable16b = true; - + bihs += sizeof(VIDEOINFOHEADER) - sizeof(BITMAPINFOHEADER); this->m_sVhdr = malloc(bihs); memset(this->m_sVhdr, 0, bihs); @@ -162,7 +162,7 @@ DMO_VideoDecoder * DMO_VideoDecoder_Open(char* dllname, GUID* guid, BITMAPINFOHE this->m_sDestType.pUnk = 0; this->m_sDestType.cbFormat = sizeof(VIDEOINFOHEADER); this->m_sDestType.pbFormat = (char*)this->m_sVhdr2; - + memset(&this->iv.m_obh, 0, sizeof(this->iv.m_obh)); memcpy(&this->iv.m_obh, this->iv.m_bh, sizeof(this->iv.m_obh) < (unsigned) this->iv.m_bh->biSize ? sizeof(this->iv.m_obh) : (unsigned) this->iv.m_bh->biSize); @@ -175,7 +175,7 @@ DMO_VideoDecoder * DMO_VideoDecoder_Open(char* dllname, GUID* guid, BITMAPINFOHE this->m_pDMO_Filter = DMO_FilterCreate(dllname, guid, &this->m_sOurType, &this->m_sDestType); - + if (!this->m_pDMO_Filter) { printf("Failed to create DMO filter\n"); @@ -217,7 +217,7 @@ DMO_VideoDecoder * DMO_VideoDecoder_Open(char* dllname, GUID* guid, BITMAPINFOHE break; #endif default: - + this->m_Caps = CAP_NONE; printf("Decoder supports the following formats: "); @@ -275,7 +275,7 @@ void DMO_VideoDecoder_StartInternal(DMO_VideoDecoder *this) Debug printf("DMO_VideoDecoder_StartInternal\n"); //cout << "DSSTART" << endl; this->m_pDMO_Filter->Start(this->m_pDMO_Filter); - + props.cBuffers = 1; props.cbBuffer = this->m_sDestType.lSampleSize; @@ -283,7 +283,7 @@ void DMO_VideoDecoder_StartInternal(DMO_VideoDecoder *this) props.cbPrefix = 0; this->m_pDMO_Filter->m_pAll->vt->SetProperties(this->m_pDMO_Filter->m_pAll, &props, &props1); this->m_pDMO_Filter->m_pAll->vt->Commit(this->m_pDMO_Filter->m_pAll); -#endif +#endif this->iv.m_State = START; } @@ -301,7 +301,7 @@ int DMO_VideoDecoder_DecodeInternal(DMO_VideoDecoder *this, const void* src, int DMO_OUTPUT_DATA_BUFFER db; CMediaBuffer* bufferin; //+ uint8_t* imdata = dest ? dest->Data() : 0; - + Debug printf("DMO_VideoDecoder_DecodeInternal(%p,%p,%d,%d,%p)\n",this,src,size,is_keyframe,imdata); // this->m_pDMO_Filter->m_pAll->vt->GetBuffer(this->m_pDMO_Filter->m_pAll, &sample, 0, 0, 0); @@ -362,14 +362,14 @@ int DMO_VideoDecoder_SetDestFmt(DMO_VideoDecoder *this, int bits, unsigned int c { HRESULT result; int should_test=1; - + Debug printf("DMO_VideoDecoder_SetDestFmt (%p, %d, %d)\n",this,bits,(int)csp); - + /* if (!CImage::Supported(csp, bits)) return -1; */ // BitmapInfo temp = m_obh; - + if (!csp) // RGB { int ok = true; @@ -400,7 +400,7 @@ int DMO_VideoDecoder_SetDestFmt(DMO_VideoDecoder *this, int bits, unsigned int c this->iv.m_obh.biCompression=3;//BI_BITFIELDS this->iv.m_obh.biSizeImage=abs((int)(2*this->iv.m_obh.biWidth*this->iv.m_obh.biHeight)); } - + if( bits == 16 ) { this->iv.m_obh.colors[0]=0xF800; this->iv.m_obh.colors[1]=0x07E0; @@ -552,4 +552,3 @@ int DMO_VideoDecoder_SetDirection(DMO_VideoDecoder *this, int d) this->m_sVhdr2->bmiHeader.biHeight = this->iv.m_obh.biHeight; |