-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use a factory pattern in
WavSampleProvider
.
- A factory pattern is easier to use correctly than a construct / initialize pattern. Especially when construct and initialize were always coupled. Prevents limbo states. - New behavior: - Forbid duplicate audio element IDs in `Create`, previously the constructor would overwrite its cache and only keep the metadata for the last ID when there were duplicates (no test coverage). Now that the factory can detect it, it makes sense to entirely prevent it. - Fix crash if the underlying codec config pointers were `nullptr` - Internally cache `channel_ids` in lieu of all `AudioFrameMetadata`. Previously all metadatas needed to be cached between construction and init. With the factory pattern it seems cleaner to just cache what is needed. PiperOrigin-RevId: 686987337
- Loading branch information
Showing
6 changed files
with
305 additions
and
171 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.