Avoid repeating old samples when entering underflow state

This commit is contained in:
Daniel Pieczko
2024-01-03 08:41:45 +00:00
parent f035e1dc13
commit 7b843b1d56
2 changed files with 4 additions and 3 deletions

View File

@@ -10,6 +10,7 @@ HEAD
* RESOLVED: Input stream sending an erroneous zero-length packet when exiting underflow state
* RESOLVED Build failures when XUA_USB_EN = 0
* RESOLVED: Clock configuration issues when ADAT and S/PDIF receive are enabled (#352)
* RESOLVED: Repeated old S/PDIF and ADAT samples when entering underflow state
* CHANGED: QUAD_SPI_FLASH replaced by XUA_QUAD_SPI_FLASH (default: 1)
* CHANGED: UserBufferManagementInit() now takes a sample rate parameter

View File

@@ -1,4 +1,4 @@
// Copyright 2011-2023 XMOS LIMITED.
// Copyright 2011-2024 XMOS LIMITED.
// This Software is subject to the terms of the XMOS Public Licence: Version 1.
#include <xs1.h>
#include <assert.h>
@@ -718,7 +718,7 @@ void clockGen (streaming chanend ?c_spdif_rx, chanend ?c_adat_rx, client interfa
spdifSamps -= 2;
/* spdifSamps could go to -1 */
if(spdifSamps < 0)
if(spdifSamps <= 0)
{
/* We're out of S/PDIF samples, mark underflow condition */
spdifUnderflow = 1;
@@ -799,7 +799,7 @@ void clockGen (streaming chanend ?c_spdif_rx, chanend ?c_adat_rx, client interfa
}
/* adatSamps could go to -1 */
if (adatSamps < 0)
if (adatSamps <= 0)
{
/* we're out of ADAT samples, mark underflow condition */
adatUnderflow = 1;