Skip to content

Commit

Permalink
fix: support multiple PPS for AVC and HEVC (#20)
Browse files Browse the repository at this point in the history
  • Loading branch information
tobbee authored Feb 1, 2024
1 parent 7aef2ea commit ac336db
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ go 1.19

require (
github.com/Comcast/gots/v2 v2.2.1
github.com/Eyevinn/mp4ff v0.41.1-0.20240123164056-bbd4656aecc0
github.com/Eyevinn/mp4ff v0.42.0
github.com/asticode/go-astits v1.13.0
github.com/stretchr/testify v1.8.4
)
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
github.com/Comcast/gots/v2 v2.2.1 h1:LU/SRg7p2KQqVkNqInV7I4MOQKAqvWQP/PSSLtygP2s=
github.com/Comcast/gots/v2 v2.2.1/go.mod h1:firJ11on3eUiGHAhbY5cZNqG0OqhQ1+nSZHfsEEzVVU=
github.com/Eyevinn/mp4ff v0.41.1-0.20240123164056-bbd4656aecc0 h1:TVO5vjF4CEAB6OKR0RWMQFvHXtZ+UdKCsp+awECiIVE=
github.com/Eyevinn/mp4ff v0.41.1-0.20240123164056-bbd4656aecc0/go.mod h1:w/6GSa5ghZ1VavzJK6McQ2/flx8mKtcrKDr11SsEweA=
github.com/Eyevinn/mp4ff v0.42.0 h1:I85b/EDTkP77GsoBL8nRV6sfFKZhAXoP6oJHU8fv6kM=
github.com/Eyevinn/mp4ff v0.42.0/go.mod h1:w/6GSa5ghZ1VavzJK6McQ2/flx8mKtcrKDr11SsEweA=
github.com/asticode/go-astikit v0.30.0/go.mod h1:h4ly7idim1tNhaVkdVBeXQZEE3L0xblP7fCWbgwipF0=
github.com/asticode/go-astikit v0.42.0 h1:pnir/2KLUSr0527Tv908iAH6EGYYrYta132vvjXsH5w=
github.com/asticode/go-astikit v0.42.0/go.mod h1:h4ly7idim1tNhaVkdVBeXQZEE3L0xblP7fCWbgwipF0=
Expand Down
4 changes: 2 additions & 2 deletions internal/avc.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ type AvcPS struct {
spss map[uint32]*avc.SPS
ppss map[uint32]*avc.PPS
spsnalu []byte
ppsnalus [][]byte
ppsnalus map[uint32][]byte
Statistics StreamStatistics
}

Expand All @@ -31,7 +31,7 @@ func (a *AvcPS) setSPS(nalu []byte) error {
if a.spss == nil {
a.spss = make(map[uint32]*avc.SPS, 1)
a.ppss = make(map[uint32]*avc.PPS, 1)
a.ppsnalus = make([][]byte, 1)
a.ppsnalus = make(map[uint32][]byte)
}
sps, err := avc.ParseSPSNALUnit(nalu, true)
if err != nil {
Expand Down
4 changes: 2 additions & 2 deletions internal/hevc.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@ type HevcPS struct {
ppss map[uint32]*hevc.PPS
vpsnalu []byte
spsnalu []byte
ppsnalus [][]byte
ppsnalus map[uint32][]byte
Statistics StreamStatistics
}

func (a *HevcPS) setSPS(nalu []byte) error {
if a.spss == nil {
a.spss = make(map[uint32]*hevc.SPS, 1)
a.ppss = make(map[uint32]*hevc.PPS, 1)
a.ppsnalus = make([][]byte, 1)
a.ppsnalus = make(map[uint32][]byte, 1)
}
sps, err := hevc.ParseSPSNALUnit(nalu)
if err != nil {
Expand Down

0 comments on commit ac336db

Please sign in to comment.