Skip to content

Commit d9753a8

Browse files
authored
Fix SeqManager::GetMaxOutput() (#1840)
1 parent 9646b68 commit d9753a8

4 files changed

Lines changed: 173 additions & 63 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
### NEXT
44

55
- Worker: Replace `uint64_t` hash with `TupleKey` in `TransportTuple` to avoid hash collisions ([1823](https://github.com/versatica/mediasoup/pull/1823)).
6+
- Worker: Fix `SeqManager::GetMaxOutput()` ([1840](https://github.com/versatica/mediasoup/pull/1840)).
67

78
### 3.20.8
89

rust/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
### NEXT
44

55
- Worker: Replace `uint64_t` hash with `TupleKey` in `TransportTuple` to avoid hash collisions ([1823](https://github.com/versatica/mediasoup/pull/1823)).
6+
- Worker: Fix `SeqManager::GetMaxOutput()` ([1840](https://github.com/versatica/mediasoup/pull/1840)).
67

78
### 0.22.8
89

worker/src/RTC/SeqManager.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,10 @@ namespace RTC
187187
template<typename T, uint8_t N>
188188
T SeqManager<T, N>::GetMaxOutput() const
189189
{
190-
return this->maxOutput;
190+
// 'maxOutput' is stored in the offset-less space (as 'base' and comparisons
191+
// use it), so apply 'initialOutput' here, just like `Input()` does before
192+
// returning the output to the caller.
193+
return (this->maxOutput + this->initialOutput) & SeqManager::MaxValue;
191194
}
192195

193196
/*

0 commit comments

Comments
 (0)