Skip to content

Conversation

@alastor0325
Copy link
Contributor

@kinetiknz Could you help me review whether my draft is on the right track? It adds support for more codecs that may be available in Gecko, and introduces a new method which will be used to calculate the total frame count for AAC. Thanks!

In gecko, AacCodecSpecificData has an attribute mMediaFrameCount, which
is calculated by

> Media frame count = total frame count - delay frame count - padding frame count.

Nestegg already has methods to get the delay frame amount (codec_delay
in nestegg_audio_params) and the padding frame amount (
nestegg_packet_discard_padding).

In order to know the total frame count, we have to know the timestamp of
the last packet in AAC stream. Therefore, we add a new method
nestegg_read_last_packet to achieve that.
Copy link
Collaborator

@kinetiknz kinetiknz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, just some minor nits and a question.

}

int
nestegg_read_last_packet(nestegg * context, unsigned int track,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How important is the performance of this? Scanning through the entire stream could be a little expensive for large streams, if Cues are present we could improve this by scanning from the last marked Cluster. That can be a future improvement if needed, doesn't need to be changed now.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Then I will post another PR to improve this.

@kinetiknz kinetiknz merged commit 0e61363 into mozilla:master Sep 3, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants