Skip to content

Commit

Permalink
Fix oggwriter creating invalid first page
Browse files Browse the repository at this point in the history
previousTimestamp default value is not 0 but 1
  • Loading branch information
BambooTuna authored and Sean-Der committed Nov 18, 2020
1 parent 32c082f commit 1ffa87e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,7 @@ Check out the **[contributing wiki](https://github.com/pion/webrtc/wiki/Contribu
* [Sean Knight](https://github.com/SeanKnight)
* [o0olele](https://github.com/o0olele)
* [Bo Shi](https://github.com/bshimc)
* [Suzuki Takeo](https://github.com/BambooTuna)

### License
MIT License - see [LICENSE](LICENSE) for full text
2 changes: 1 addition & 1 deletion pkg/media/oggwriter/oggwriter.go
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ func (i *OggWriter) WriteRTP(packet *rtp.Packet) error {
payload := opusPacket.Payload[0:]

// Should be equivalent to sampleRate * duration
if i.previousTimestamp != 0 {
if i.previousTimestamp != 1 {
increment := packet.Timestamp - i.previousTimestamp
i.previousGranulePosition += uint64(increment)
}
Expand Down

0 comments on commit 1ffa87e

Please sign in to comment.