OSDN Git Service

AudioFlinger: mix track only when really ready (2)
authorEric Laurent <elaurent@google.com>
Wed, 18 Jan 2012 03:20:12 +0000 (19:20 -0800)
committerEric Laurent <elaurent@google.com>
Wed, 18 Jan 2012 20:27:38 +0000 (12:27 -0800)
commit2774144fa8283f1a7b43e17a53c97dec0c366dd3
tree5c73ae7daf8480e7ce2cc862790332401688931b
parent86d24aa35adf82512d341d9aaebd62b36b0a0847
AudioFlinger: mix track only when really ready (2)

This problem due to the way audio buffers are mixed when
low power mode is active was addressed by commits 19ddf0eb
and 8a04fe03 but only partially. As a matter of fact, when more
than one audio track is playing, the problem is still present.
This is most noticeable when playing music with screen off
and a notification or navigation instruction is played: in this case,
the music or notification is likely to skip.

The fix consists in declaring the mixer ready if all active tracks
are ready. Previous behavior was to declare ready if at least one track was
ready. To avoid that one application failing to fill the track buffer blocks other
tracks indefinitely, this condition is respected only if the mixer was ready
in the previous round.

Issue 5799167.

Change-Id: Iabd4ca08d3d45f563d9824c8a03c2c68a43ae179
services/audioflinger/AudioFlinger.cpp
services/audioflinger/AudioFlinger.h