Refactor audio sample calculation for EAC3#3276
Conversation
Calculate the number of audio samples based on frame size and number of frames for EAC3.
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
|
For #3276, the sample count calculation can overcount when an EC-3 sample contains multiple syncframes for different substreams. In For example, a sample with two substreams and three audio blocks per syncframe may contain four syncframes. This implementation would return |
Enhanced the parseAc3SyncframeAudioSampleCount method to handle EC-3 access units and calculate total audio blocks from independent substreams.
|
Thanks for the update. This fixes the dependent-substream overcount, but I think the duration can still be overcounted when the EC-3 bitstream contains multiple independent substreams. The current code adds audio blocks for every syncframe whose I think this should count only one presentation timeline, for example independent substream 0, or otherwise keep the MP4 EC-3 sample duration fixed at 1536 samples. It would also be good to add tests for an access unit with dependent substreams and one with multiple independent substreams. |
Only accumulates audio blocks when strmtyp == TYPE0 && substreamid == 0 — the primary independent substream
Calculate the number of audio samples based on frame size and number of frames for EAC3.