OK, so the call to
is crashing. I'm going to take a leap and guess that the extra entry in the AMOVIESETUP_FILTER structure is mucking things up:
line 59
In the MS SDK doc, the structure doesn't take a final class ID, but interestingly, just removing that extra member doesn't work because mpaudioswitcher is pulling in a set of DirectShow header files that are local to MediaPortal (from mediaportal\Core.cpp\mpc-hc_subs\src\BaseClasses). And in that directory is a combase.h file with a definition of AMOVIESETUP_FILTER in it with the offending extra member. So I also had to remove "..\..\mediaportal\Core.cpp\mpc-hc_subs\src\BaseClasses" from the INCLUDEs and substitute $(DSHOW_BASE). Anybody know why MediaPortal has this local copy of the DirectShow headers?
I'm guessing the 2 conflicting definitions of AMOVIESETUP_FILTER are causing the problem and perhaps it's causing the DLL initialization code that is filling in the last member to either clobber something, or overwrite memory that in some cases isn't allocated.
Giant hypothesis there, but it's a bug that should be fixed anyway even if it's not what's causing the crash.
Attached is a new build with that bug fixed to try out.
Code:
AMovieDllRegisterServer2(TRUE)
line 59
Code:
{&__uuidof(CAudioSwitcherFilter), L"MediaPortal AudioSwitcher", MERIT_DO_NOT_USE, countof(sudpPins), sudpPins, CLSID_LegacyAmFilterCategory}
In the MS SDK doc, the structure doesn't take a final class ID, but interestingly, just removing that extra member doesn't work because mpaudioswitcher is pulling in a set of DirectShow header files that are local to MediaPortal (from mediaportal\Core.cpp\mpc-hc_subs\src\BaseClasses). And in that directory is a combase.h file with a definition of AMOVIESETUP_FILTER in it with the offending extra member. So I also had to remove "..\..\mediaportal\Core.cpp\mpc-hc_subs\src\BaseClasses" from the INCLUDEs and substitute $(DSHOW_BASE). Anybody know why MediaPortal has this local copy of the DirectShow headers?
I'm guessing the 2 conflicting definitions of AMOVIESETUP_FILTER are causing the problem and perhaps it's causing the DLL initialization code that is filling in the last member to either clobber something, or overwrite memory that in some cases isn't allocated.
Giant hypothesis there, but it's a bug that should be fixed anyway even if it's not what's causing the crash.
Attached is a new build with that bug fixed to try out.
United States of America