用 ffplay 播放 opus 文件,错误信息如下:
SDL_OpenAudio (2 channels, 48000 Hz): XAudio2: XAudio2Create() failed at open.
SDL_OpenAudio (1 channels, 48000 Hz): XAudio2: XAudio2Create() failed at open.
SDL_OpenAudio (2 channels, 44100 Hz): XAudio2: XAudio2Create() failed at open.
SDL_OpenAudio (1 channels, 44100 Hz): XAudio2: XAudio2Create() failed at open.
解决方法——在 ffplay.c 的 main 函数开头,加上:
#ifdef _WIN32
CoInitializeEx(NULL, COINIT_MULTITHREADED);
#endif