Skip to content

Commit

Permalink
fix: support multiple PPS for AVC and HEVC
Browse files Browse the repository at this point in the history
  • Loading branch information
tobbee committed Feb 1, 2024
1 parent 7aef2ea commit 905fd5b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
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 905fd5b

Please sign in to comment.