views:

56

answers:

1

My WPF app seems to be crashing when I flip a media element around quickly. Debugging with WinDbg shows it as crashing with the following stack trace:

0:028:x86> k 20
ChildEBP RetAddr  
15aff648 07acb2a9 wmp!CMGSessionHost::GetPDFromTopologySourceNode0+0xb
15aff670 07a080fc wmp!CMGSessionHost::IsWindowsMediaContent+0x8a
15aff688 07acd838 wmp!CMGPlayer::HandleOnError+0x2b
15aff6d8 07c9270c wmp!CMGSessionHost::HandleTopologySet+0x583
15aff714 07c928b9 wmp!CMGSessionHost::OnDShowSourceCreated+0x82
15aff720 6e701f7b wmp!CMGSessionHost::OnDShowSourceCreatedAsyncCallback::Invoke+0x16
15aff730 6e701b3c MFPlat!CCompletionPort::InvokeCallback+0x12
15aff838 6e708cab MFPlat!CWorkQueue::CThread::ThreadMain+0xa5
15aff840 74e71287 MFPlat!CWorkQueue::CThread::ThreadFunc+0xd
15aff878 74e71328 msvcrt!_endthreadex+0x44
15aff880 76473677 msvcrt!_endthreadex+0xce
15aff88c 76f79d72 KERNEL32!BaseThreadInitThunk+0xe
15aff8cc 76f79d45 ntdll_76f40000!__RtlUserThreadStart+0x70
15aff8e4 00000000 ntdll_76f40000!_RtlUserThreadStart+0x1b
0:028:x86> u 7a00881
wmp!CMGSessionHost::GetPDFromTopologySourceNode0:
07a00881 8bff            mov     edi,edi
07a00883 55              push    ebp
07a00884 8bec            mov     ebp,esp
07a00886 83ec0c          sub     esp,0Ch
07a00889 8b4508          mov     eax,dword ptr [ebp+8]
07a0088c 8b08            mov     ecx,dword ptr [eax]
07a0088e 56              push    esi
07a0088f 57              push    edi
0:028:x86> r
eax=00000000 ebx=00000000 ecx=15aff668 edx=00010000 esi=00000000 edi=05c53460
eip=07a0088c esp=15aff63c ebp=15aff648 iopl=0         nv up ei pl nz ac pe nc
cs=0023  ss=002b  ds=002b  es=002b  fs=0053  gs=002b             efl=00010216
wmp!CMGSessionHost::GetPDFromTopologySourceNode0+0xb:
07a0088c 8b08            mov     ecx,dword ptr [eax]  ds:002b:00000000=????????

Which to me looks like the callback from the interior of windows media player after it has opened the media is falling over with null pointer because I've changed the source too quickly.

I am stopping the current video before I change over the source, however I'm wondering if I should wait until I've gotten back a MediaOpened event before I change the source again.

Anyone else run into this and if so how did they fix it?

A: 

I opened a support case with Microsoft on this and got back a hot fix, note in my case it was specific to playing back XVID / DIVX files.

http://support.microsoft.com/kb/981880

My guess is that the XVID codec was opening everything twice and closing it down once leaving behind some pointers and some open file handles as well.

PeterI