forked from security/hakurei
internal/pipewire: work around remote sequence quirk
Remote sequence sometimes start with a non-zero value, and keeps the same value for a while before going back to zero. Conditions for reproducing this behaviour is not yet known. This change works around this behaviour. Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
@@ -674,6 +674,12 @@ func (ctx *Context) consume(receiveRemaining []byte) (remaining []byte, err erro
|
||||
if err = header.UnmarshalBinary(remaining[:SizeHeader]); err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
// remote sequence sometimes do not start with 0
|
||||
if ctx.remoteSequence == 0 {
|
||||
ctx.remoteSequence = header.Sequence
|
||||
}
|
||||
|
||||
if header.Sequence != ctx.remoteSequence {
|
||||
return remaining, UnexpectedSequenceError(header.Sequence)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user