Refactor FIFO callback.

This commit is contained in:
Paul Kronenwetter 2022-05-22 14:20:03 -04:00
parent 9ad1e22470
commit e0f96ffabe

View file

@ -351,25 +351,16 @@ class RF:
data_in48k = data_in48k[48:] data_in48k = data_in48k[48:]
length_x = len(x) length_x = len(x)
if ( for data_buffer, receive in [
not self.datac0_buffer.nbuffer + length_x (self.datac0_buffer, True),
> self.datac0_buffer.size (self.datac1_buffer, RECEIVE_DATAC1),
): (self.datac3_buffer, RECEIVE_DATAC3),
self.datac0_buffer.push(x) ]:
if (
if ( not data_buffer.nbuffer + length_x > data_buffer.size
not self.datac1_buffer.nbuffer + length_x and receive
> self.datac1_buffer.size ):
and RECEIVE_DATAC1 data_buffer.push(x)
):
self.datac1_buffer.push(x)
if (
not self.datac3_buffer.nbuffer + length_x
> self.datac3_buffer.size
and RECEIVE_DATAC3
):
self.datac3_buffer.push(x)
def mkfifo_write_callback(self): def mkfifo_write_callback(self):
"""Support testing by writing the audio data to a pipe.""" """Support testing by writing the audio data to a pipe."""