Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit c95cfbb8 authored by John Grossman's avatar John Grossman
Browse files

TimedAudioTrack: Optimize the queue trim operation.



Hand merge from ics-aah

> TimedAudioTrack: Optimize the queue trim operation.
>
> Don't perform the end PTS calculation for each buffer during trimming.
> Instead, only calculate the ending PTS of a buffer if there is no next
> buffer in the queue.  This optimization assumes that the buffers being
> queued are in monotonic media time order (a fair assumption for now)
> and that the timestamps in the audio are contiguous (not a requirement
> for this API, but a reality of how it is being used right now).
>
> In the case where the audio is discontinuous on purpose, it is
> that this optimization will cause the system hold one extra buffer
> which it could have safely trimmed.  It should not be much of an issue
> since in real life the audio is almost always contiguous, and as long
> as the media clock is running and the mixer is mixing, the buffer will
> be used up and discard as part of the normal flow anyway.
>
> Change-Id: I00061e85ee7d5651fcf80751646c7d7415894a14
> Signed-off-by: default avatarJohn Grossman <johngro@google.com>

Change-Id: I0054b58e1389fa005aa990cb5710caf4af7b706a
Signed-off-by: default avatarJohn Grossman <johngro@google.com>
parent 8d314b70
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment