Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix avc dec conf rec #299

Merged
merged 1 commit into from
Nov 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

- Nothing yet
### Fixed

- Parsing of AVCDecoderConfigurationRecord

## [0.40.2] - 2023-11-17

Expand Down
12 changes: 6 additions & 6 deletions avc/avcdecoderconfigurationrecord.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,12 +102,14 @@ func DecodeAVCDecConfRec(data []byte) (DecConfRec, error) {
// ISO/IEC 14496-15 2017 says that
// Compatible extensions to this record will extend it and
// will not change the configuration version code.
//Readers should be prepared to ignore unrecognized
// Readers should be prepared to ignore unrecognized
// data beyond the definition of the data they understand
//(e.g. after the parameter sets in this specification).
// (e.g. after the parameter sets in this specification).

switch AVCProfileIndication {
case 100, 110, 122, 144: // From ISO/IEC 14496-15 2017 Section 5.3.3.1.2
case 66, 77, 88: // From ISO/IEC 14496-15 2017 Section 5.3.3.1.2
// No extra bytes
default:
if pos == len(data) { // Not according to standard, but have been seen
adcr.NoTrailingInfo = true
return adcr, nil
Expand All @@ -119,8 +121,6 @@ func DecodeAVCDecConfRec(data []byte) (DecConfRec, error) {
if adcr.NumSPSExt != 0 {
return adcr, ErrCannotParseAVCExtension
}
default:
// No more data to read
}

return adcr, nil
Expand All @@ -136,7 +136,7 @@ func (a *DecConfRec) Size() uint64 {
totalSize += 2 + len(nalu)
}
switch a.AVCProfileIndication {
case 66, 77, 88: // From ISO/IEC 14496-15 2019 Section 5.3.1.1.2
case 66, 77, 88: // From ISO/IEC 14496-15 2017 Section 5.3.1.1.2
// No extra bytes
default:
if !a.NoTrailingInfo {
Expand Down
Loading