Is there something wrong with my DirectX SDK?
-
When i try to use the
RenderFile
function on anIGraphBuilder
i get a ton of errors. I've also tried downloading a sample file that is guaranteed to work, but i still get the errors. Here's the code from the sample:#include <windows.h>
#include <objbase.h>
#include <dShow.h>int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
{
HRESULT hr;
IGraphBuilder* pGraphBuilder;
IMediaControl* pMediaControl;
WCHAR MediaFile[MAX_PATH];CoInitialize(NULL); hr = CoCreateInstance(CLSID\_FilterGraph, NULL, CLSCTX\_ALL, IID\_IGraphBuilder, (void\*\*)&pGraphBuilder); if (FAILED(hr)) return -1; MultiByteToWideChar(CP\_ACP, 0, lpCmdLine, -1, MediaFile, MAX\_PATH); hr = pGraphBuilder->RenderFile(MediaFile, NULL); if (FAILED(hr)) return -2; hr = pGraphBuilder->QueryInterface(IID\_IMediaControl, (void\*\*)&pMediaControl); if (FAILED(hr)) return -3; hr = pMediaControl->Run(); if (FAILED(hr)) return -4; Sleep(10000); pMediaControl->Stop(); pMediaControl->Release(); pGraphBuilder->Release(); CoUninitialize(); return 0;
}
I set up VS .NET so the commandline contains a valid media file. When it performs the RenderFile function it loads in a sec or so and comes with a bunch of erros like these:
ASSERT failed.
g_cFGObjects == 0
At line 6002 d:\xpclient\multimedia\dshow\filters\core\filgraph\filgraph\filgraph.cpp
Continue? (Cancel to debug)ASSERT failed.
Executable: DShowTut1.exe Pid 720 Tid 2cc. Module quartz.dll, 26 objects left active!
At line 317 of d:\xpclient\multimedia\published\dxmdev\dshowdev\base\dllentry.cpp
Continue? (Cancel to debug)sometimes it also pops up with additional erros like:
m_dwRecursionCount == 0 && m_dwOwnerThreadId == 0
At line 58 of d:\xpclient\multimedia\dshow\filters\core\filgraph\filgraph\msgmutex.cpp
Continue? (Cancel to Debug)And then exits. Anyone know what could be wrong? Thanks all! -Rune Svendsen