Skip to content

Commit

Permalink
Merge pull request #360 from Eyevinn/pos-in-errors
Browse files Browse the repository at this point in the history
feat: add pos in decoder error messages
  • Loading branch information
tobbee authored Jul 4, 2024
2 parents fca95ba + a2217a3 commit 49da44b
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Added

- Box decoder error messages include start position

### Fixed

- Overflow in calculatiing sample decode time
- Overflow in calculating sample decode time

## [0.45.0] - 2024-06-06

Expand Down
2 changes: 1 addition & 1 deletion mp4/box.go
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ func DecodeBox(startPos uint64, r io.Reader) (Box, error) {
b, err = d(h, startPos, r)
}
if err != nil {
return nil, fmt.Errorf("decode %s: %w", h.Name, err)
return nil, fmt.Errorf("decode %s pos %d: %w", h.Name, startPos, err)
}

return b, nil
Expand Down
2 changes: 1 addition & 1 deletion mp4/boxsr.go
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ func DecodeBoxSR(startPos uint64, sr bits.SliceReader) (Box, error) {
b, err = d(h, startPos, sr)
}
if err != nil {
return nil, fmt.Errorf("decode box %s: %w", h.Name, err)
return nil, fmt.Errorf("decode %s pos %d: %w", h.Name, startPos, err)
}

return b, nil
Expand Down

0 comments on commit 49da44b

Please sign in to comment.