Skip to content

Commit b4b0ec4

Browse files
committed
2 parents 396b38d + 82850f6 commit b4b0ec4

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/AudioExperiments/AudioSPDIF.h

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -137,13 +137,14 @@ class SPDIFStream : public AudioStreamX {
137137
bool begin(SPDIFConfig cfg) {
138138
LOGD(LOG_METHOD);
139139
// Some validations to make sure that the config is valid
140-
if (!(cfg.channels == 1 | cfg.channels == 2)) {
140+
if (!(cfg.channels == 1 || cfg.channels == 2)) {
141141
LOGE("Unsupported number of channels: %d", cfg.channels);
142142
return false;
143143
}
144-
if (info.bits_per_sample != 16) {
144+
if (cfg.bits_per_sample != 16) {
145145
LOGE("Unsupported bits per sample: %d - must be 16!",
146-
info.bits_per_sample);
146+
cfg.bits_per_sample);
147+
return false;
147148
}
148149

149150
if (i2sOn) {
@@ -224,8 +225,6 @@ class SPDIFStream : public AudioStreamX {
224225
spdif_ptr += 2; // advance to next audio data
225226

226227
if (spdif_ptr >= &spdif_buf[SPDIF_BUF_ARRAY_SIZE]) {
227-
size_t i2s_write_len;
228-
229228
// set block start preamble
230229
((uint8_t *)spdif_buf)[SYNC_OFFSET] ^= SYNC_FLIP;
231230

0 commit comments

Comments
 (0)