GNOME Bugzilla – Bug 774689
audiobuffersplit: New element that splits raw audio buffers into equal-sized buffers
Last modified: 2016-11-23 16:19:57 UTC
See commit message
Created attachment 340265 [details] [review] audiobuffersplit: New element that splits raw audio buffers into equal-sized buffers This is useful e.g. if audio buffers should be exactly the duration of a video frame, or if a audio buffers should never be too large because of latency constraints. The element is taking a fractional buffer duration, to allow working with e.g. 1001/30000 as output duration and it accumulates rounding errors in the buffer durations and compensates for them by making some buffers one sample larger than the others.
Created attachment 340267 [details] [review] audiobuffersplit: New element that splits raw audio buffers into equal-sized buffers This is useful e.g. if audio buffers should be exactly the duration of a video frame, or if a audio buffers should never be too large because of latency constraints. The element is taking a fractional buffer duration, to allow working with e.g. 1001/30000 as output duration and it accumulates rounding errors in the buffer durations and compensates for them by making some buffers one sample larger than the others.
I'm guessing you already considered deriving this from audiorate or raw audioparse but decided against it? :)
Yes, changing those to work differently seemed more work than just writing this thing directly. Especially the timestamp handling here vs what baseparse does. audiorate might've been a possible choice but it already does a lot of different things and the code seems complicated enough, and we would have to add a mode to audiorate then also to not fill up gaps with silence. Might make sense to add the discont-wait logic to audiorate though.
Created attachment 340398 [details] [review] audiobuffersplit: New element that splits raw audio buffers into equal-sized buffers This is useful e.g. if audio buffers should be exactly the duration of a video frame, or if a audio buffers should never be too large because of latency constraints. The element is taking a fractional buffer duration, to allow working with e.g. 1001/30000 as output duration and it accumulates rounding errors in the buffer durations and compensates for them by making some buffers one sample larger than the others.
Attachment 340398 [details] pushed as 0acb3d8 - audiobuffersplit: New element that splits raw audio buffers into equal-sized buffers