@@ -15,7 +15,7 @@ use tracing::debug;
1515// Current problem is generating an output timestamp that lines up with the input's timestamp
1616
1717struct MixerSource {
18- rx : std :: iter :: Peekable < flume :: IntoIter < ( ffmpeg:: frame:: Audio , Timestamp ) > > ,
18+ rx : Receiver < ( ffmpeg:: frame:: Audio , Timestamp ) > ,
1919 info : AudioInfo ,
2020 buffer : VecDeque < ( ffmpeg:: frame:: Audio , Timestamp ) > ,
2121 buffer_last : Option < ( Timestamp , Duration ) > ,
@@ -41,7 +41,7 @@ impl AudioMixerBuilder {
4141 pub fn add_source ( & mut self , info : AudioInfo , rx : Receiver < ( ffmpeg:: frame:: Audio , Timestamp ) > ) {
4242 self . sources . push ( MixerSource {
4343 info,
44- rx : rx . into_iter ( ) . peekable ( ) ,
44+ rx,
4545 buffer : VecDeque :: new ( ) ,
4646 buffer_last : None ,
4747 } ) ;
@@ -184,7 +184,7 @@ impl AudioMixer {
184184 }
185185 }
186186
187- while let Some ( ( frame, timestamp) ) = source. rx . next ( ) {
187+ while let Ok ( ( frame, timestamp) ) = source. rx . try_recv ( ) {
188188 // if gap between incoming and last, insert silence
189189 if let Some ( ( buffer_last_timestamp, buffer_last_duration) ) = source. buffer_last {
190190 let timestamp_elapsed = timestamp. duration_since ( self . timestamps ) ;
0 commit comments