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 {
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
You can’t perform that action at this time.
0 commit comments