Skip to content

Commit

Permalink
Fix: receive hang indefinitely
Browse files Browse the repository at this point in the history
After writing the first bytes from buffer, it doesn't "notify" the reader
and continue to write to the buffer without knowing it is consume entirely or not.

The reader hence can send wrong data to receiver. With incorrect box size, it can hang forever.

`testpic` segment size is small (<65536), so it is not affected.
  • Loading branch information
nvkhoi112358 committed Dec 23, 2024
1 parent 607ba05 commit 7fa8bf2
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions cmd/livesim2/app/cmaf-ingester.go
Original file line number Diff line number Diff line change
Expand Up @@ -683,6 +683,7 @@ func (cs *cmafSource) Write(b []byte) (int, error) {
if nrWritten == len(b) {
break
}
<-cs.writeMoreCh
}
return len(b), nil
}
Expand Down

0 comments on commit 7fa8bf2

Please sign in to comment.