Skip to content

Commit

Permalink
fix: don't interleave groups (#188)
Browse files Browse the repository at this point in the history
  • Loading branch information
therishidesai authored Sep 27, 2024
1 parent 97f2799 commit ab0f36f
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions moq-sub/src/media.rs
Original file line number Diff line number Diff line change
Expand Up @@ -122,11 +122,9 @@ impl<O: AsyncWrite + Send + Unpin + 'static> Media<O> {
if let TrackReaderMode::Groups(mut groups) = track.mode().await? {
while let Some(group) = groups.next().await? {
let out = out.clone();
tokio::task::spawn(async move {
if let Err(err) = Self::recv_group(group, out).await {
warn!("failed to receive group: {err:?}");
}
});
if let Err(err) = Self::recv_group(group, out).await {
warn!("failed to receive group: {err:?}");
}
}
}
debug!("track {name}: finish");
Expand All @@ -140,7 +138,6 @@ impl<O: AsyncWrite + Send + Unpin + 'static> Media<O> {
let out = out.clone();
let buf = Self::recv_object(object).await?;

// TODO: avoid interleaving out of order fragments
out.lock().await.write_all(&buf).await?;
}

Expand Down

0 comments on commit ab0f36f

Please sign in to comment.