Implemented ADTS packetizer sample number reporting
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
7b6b11dd6c
commit
9e01c732f3
|
@ -27,7 +27,7 @@ Collection of audio utilities for decoding/encoding files and streams.
|
|||
| **TTA** | ❌ | - | - |
|
||||
| **MP3** | ✅ | ✅ | ✅ |
|
||||
| **Ogg** | ✅ | ✅ | ✅* |
|
||||
| **ADTS** | ✅ | ✅ | ❌ |
|
||||
| **ADTS** | ✅ | ✅ | ✅ |
|
||||
|
||||
|
||||
## Dependencies
|
||||
|
|
|
@ -12,8 +12,9 @@ type AdtsPacketizer struct {
|
|||
}
|
||||
|
||||
type AdtsPacket struct {
|
||||
header *aac_adts.ADTSHeader
|
||||
data []byte
|
||||
sampleNumber int64
|
||||
header *aac_adts.ADTSHeader
|
||||
data []byte
|
||||
}
|
||||
|
||||
func (p *AdtsPacket) KeepMode() KeepMode {
|
||||
|
@ -21,7 +22,7 @@ func (p *AdtsPacket) KeepMode() KeepMode {
|
|||
}
|
||||
|
||||
func (p *AdtsPacket) GetSampleNumber() int64 {
|
||||
return 0
|
||||
return p.sampleNumber
|
||||
}
|
||||
|
||||
func (p *AdtsPacket) GetData() []byte {
|
||||
|
@ -46,6 +47,8 @@ func (o *AdtsPacketizer) GetPacket() Packet {
|
|||
if _, err := o.reader.Read(packet.data); err != nil {
|
||||
return nil
|
||||
}
|
||||
packet.sampleNumber = o.samples
|
||||
o.samples += 1024 //always this fixed size per frame
|
||||
|
||||
return packet
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue