Quick answer
Run sfc /scannow in an elevated command prompt, then reset Windows Media Player via Settings > Apps > Windows Media Player > Advanced options > Reset.
Why this happens
I've seen this error pop up mostly on Windows 10 version 22H2 and Windows 11 after a major update, or when someone tries to play a file with a missing codec like HEVC or AC-3. The system API call that WMP relies on—usually mfplat.dll or wmcodecdsp.dll—returns a null pointer, and WMP gives up with that generic failure message. It's not a WMP bug per se; it's almost always a corrupted system file or a codec registry key that got nuked during an update. I've also seen it after a failed install of third-party codec packs like K-Lite or CCCP, but those are less common now.
The trigger? You're trying to play a .mkv, .mp4 with AAC audio, or a .wmv file. The error shows up mid-playback or right when you double-click the file. You'll also see it if your user profile's Media Player database got corrupted—happens more than you'd think.
Step-by-step fix
- Run System File Checker — Open Command Prompt as administrator (
Win + X, then choose Command Prompt (Admin) or Terminal (Admin)). Typesfc /scannowand hit Enter. Let it finish; it takes about 15 minutes on a modern SSD. If it finds corrupt files, reboot and retry WMP. - Reset Windows Media Player — Go to
Settings > Apps > Installed apps(orApps & features), find Windows Media Player, click the three dots, selectAdvanced options, then clickReset. This clears all library data and settings, which fixes that corrupted database issue I mentioned. - Reinstall Media Feature Pack — If you're on Windows 10 N or Windows 11 N, this is your culprit. Go to
Settings > Optional featuresand add the Media Feature Pack. Non-N users can skip this. - Install missing codecs — Download the official HEVC video extensions from Microsoft Store (the free one from device manufacturer) or install the AV1 codec. If you're playing AC-3 audio, get the Dolby Audio Extensions. Third-party packs are risky—stick to Microsoft's.
Alternative fixes if the main ones fail
- Register the API DLLs — Run this in an elevated command prompt:
regsvr32 mfplat.dll, thenregsvr32 wmcodecdsp.dll. Reboot after. This re-registers the Media Foundation platform, which WMP leans on. - Create a new user profile — If the error follows you after a reset, your user profile is toast. Create a new local account, log into it, and try the same file. If it works, migrate your data over. I've seen this fix it when nothing else did.
- Run DISM — Before you give up, run
DISM /Online /Cleanup-Image /RestoreHealthin an admin command prompt. It repairs the system image itself. SFC can't fix everything; DISM does the deeper work.
Prevention tip
Stick to Microsoft-published codecs from the Store, and avoid the old-school codec packs. They haven't been needed since Windows 10. Also, run sfc /scannow once a month if you're on Windows Insider builds—they're notorious for breaking these API calls. If you see this error after a feature update, just reset WMP first. Nine times out of ten, that's the whole fix.
One last thing: if you're playing something from a network drive or external USB, copy the file to your local desktop first. I've wasted hours chasing API errors that were just latency or permissions on the source drive.