Fix Ogg absolute sample number
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
9e01c732f3
commit
d0976eac62
|
@ -8,11 +8,13 @@ import (
|
|||
)
|
||||
|
||||
type OggPacketizer struct {
|
||||
reader io.Reader
|
||||
reader io.Reader
|
||||
samples int64
|
||||
}
|
||||
|
||||
type OggPacket struct {
|
||||
header struct {
|
||||
sampleNumber int64
|
||||
header struct {
|
||||
Capture [4]byte
|
||||
Revision byte
|
||||
Flags byte
|
||||
|
@ -34,8 +36,7 @@ func (p *OggPacket) KeepMode() KeepMode {
|
|||
}
|
||||
|
||||
func (p *OggPacket) GetSampleNumber() int64 {
|
||||
//TODO
|
||||
return p.header.AbsoluteGranulePosition
|
||||
return p.sampleNumber
|
||||
}
|
||||
|
||||
func (p *OggPacket) GetData() []byte {
|
||||
|
@ -76,5 +77,9 @@ func (o *OggPacketizer) GetPacket() Packet {
|
|||
}
|
||||
}
|
||||
|
||||
//use previous sample number instead
|
||||
packet.sampleNumber = o.samples
|
||||
o.samples = packet.header.AbsoluteGranulePosition
|
||||
|
||||
return packet
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue