Skip to content

Commit 3dd4865

Browse files
committed
SPDIFStream wrong size
1 parent caad3fb commit 3dd4865

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/AudioExperiments/AudioSPDIF.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -320,6 +320,7 @@ class SPDIFStream16Bit2Channels : public AudioStreamX {
320320
(uint32_t)(((bmc_tab[*p] << 16) ^ bmc_tab[*(p + 1)]) << 1) >> 1;
321321

322322
p += 2;
323+
result +=2;
323324
spdif_ptr += 2; // advance to next audio data
324325

325326
if (spdif_ptr >= &spdif_buf[SPDIF_BUF_ARRAY_SIZE]) {
@@ -328,12 +329,12 @@ class SPDIFStream16Bit2Channels : public AudioStreamX {
328329
// set block start preamble
329330
((uint8_t *)spdif_buf)[SYNC_OFFSET] ^= SYNC_FLIP;
330331

331-
result += out->write((uint8_t *)spdif_buf, sizeof(spdif_buf));
332+
out->write((uint8_t *)spdif_buf, sizeof(spdif_buf));
332333
spdif_ptr = spdif_buf;
333334
}
334335
}
335336

336-
return result / 4;
337+
return result;
337338
}
338339

339340
protected:

0 commit comments

Comments
 (0)