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

Add raw unregistered bytes to UserDataUnregistered message #3

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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
2 changes: 1 addition & 1 deletion lib/sei/Message.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export function parseSEI(rbsp: Uint8Array): RawSEIMessage[] {
if (byte !== 0xFF) break
}
// consume message payload & add to list
if (position + payloadSize > length)
if (position + payloadSize > length + 1)
throw TypeError('EOF while reading payload')
result.push([ payloadType, rbsp.subarray(position, position + payloadSize) ])
position += payloadSize
Expand Down
2 changes: 1 addition & 1 deletion lib/sei/UserDataUnregistered.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ export function parseUserDataUnregistered(seiPayload: Uint8Array) {
const dv = new DataView(seiPayload.buffer, seiPayload.byteOffset)
const uuid = dv.getBigUint64(0) << 64n | dv.getBigUint64(8)
// we know this particular SEI message is byte aligned, so nothing to trim. rest is payload
return { uuid, data: seiPayload.subarray(16) }
return { uuid, data: seiPayload.subarray(16), raw: seiPayload }
}