File tree Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -137,13 +137,14 @@ class SPDIFStream : public AudioStreamX {
137
137
bool begin (SPDIFConfig cfg) {
138
138
LOGD (LOG_METHOD);
139
139
// 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 )) {
141
141
LOGE (" Unsupported number of channels: %d" , cfg.channels );
142
142
return false ;
143
143
}
144
- if (info .bits_per_sample != 16 ) {
144
+ if (cfg .bits_per_sample != 16 ) {
145
145
LOGE (" Unsupported bits per sample: %d - must be 16!" ,
146
- info.bits_per_sample );
146
+ cfg.bits_per_sample );
147
+ return false ;
147
148
}
148
149
149
150
if (i2sOn) {
@@ -224,8 +225,6 @@ class SPDIFStream : public AudioStreamX {
224
225
spdif_ptr += 2 ; // advance to next audio data
225
226
226
227
if (spdif_ptr >= &spdif_buf[SPDIF_BUF_ARRAY_SIZE]) {
227
- size_t i2s_write_len;
228
-
229
228
// set block start preamble
230
229
((uint8_t *)spdif_buf)[SYNC_OFFSET] ^= SYNC_FLIP;
231
230
You can’t perform that action at this time.
0 commit comments