I am making a program on Visual Studio using C#. This program plays a video when the user presses a button. I use the Windows Media Player library to play the video and all worked fine, until I tried it on a laptop with dual graphics adapters. These are Intel HD Graphics 4600 and R9 M256X. On the laptop, any attempt to play the video leads to the program crashing immediately, with Visual Studio reporting an access violation (error 0xC0000005) in the console. I tried putting the code that plays the video in a try-catch block, but nothing was not caught.
Through testing, I noticed that the crash happens if in Radeon settings under the tab "Switchable graphics" I set my program to either Not assigned (default) or High performance but all works well if I set it to Power saving.
Ideally, I need a way to stop this from happening altogether, but a way to test if it is going to crash beforehand will suffice.
Some things of note:
User contributions licensed under CC BY-SA 3.0