Skip to content

Commit

Permalink
add more strict format check for player.
Browse files Browse the repository at this point in the history
  • Loading branch information
aikiriao committed Sep 18, 2024
1 parent 16e6399 commit f3c12cb
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions tools/srla_player/srla_player_wasapi.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include "srla_player.h"
#include <assert.h>
#include <stdio.h>

#include <windows.h>

Expand Down Expand Up @@ -87,10 +88,13 @@ void SRLAPlayer_Initialize(const struct SRLAPlayerConfig* config)

/* 出力フォーマットが対応しているかチェック */
{
WAVEFORMATEX closest_format, * pformat;
WAVEFORMATEX closest_format, *pformat;
pformat = &closest_format;
hr = IAudioClient_IsFormatSupported(audio_client, AUDCLNT_SHAREMODE_SHARED, &format, &pformat);
assert(SUCCEEDED(hr));
if (hr != S_OK) {
fprintf(stderr, "Unsupported format for WASAPI Playback. \n");
exit(1);
}
}

/* クライアント初期化 */
Expand Down

0 comments on commit f3c12cb

Please sign in to comment.