summaryrefslogtreecommitdiffstats
path: root/media/libmediaplayerservice/MetadataRetrieverClient.cpp
diff options
context:
space:
mode:
authorEric Laurent <elaurent@google.com>2009-09-24 07:03:14 -0700
committerEric Laurent <elaurent@google.com>2009-09-24 23:49:40 -0700
commit824b6a4a67166c3937400702944f659bd0d5d386 (patch)
tree6191f9487ca60d2bf8dbaa16dd8889dd0f594376 /media/libmediaplayerservice/MetadataRetrieverClient.cpp
parentcdc9847ba4caa93817a8edf3014919d4480298ad (diff)
downloadframeworks_av-824b6a4a67166c3937400702944f659bd0d5d386.zip
frameworks_av-824b6a4a67166c3937400702944f659bd0d5d386.tar.gz
frameworks_av-824b6a4a67166c3937400702944f659bd0d5d386.tar.bz2
Fix issue 2142613: ToneGenerator: short tones sometimes don't play on sholes or over A2DP.
When the AudioTrack callback notification size is relatively high (Which is the case on Sholes and over A2DP), it is likely that the end of tone is reached during the first callback. In this case, the AudioTrack is stopped before exiting the callback which causes 2 problems: - 1: If the AudioFlinger thread is scheduled before we exit the ToneGenerator callback, the track can be stopped and reset before the data is actually marked as present in the buffer by the AudioTrack callback => no audio will be processed by AudioFlinger. - 2: In this case, the data write index in the AudioTrack buffer is incremented after the track was reset by the AudioFlinger which leaves unplayed data in the buffer. This data will be played the next time the AudioTrack is started if not flushed in between. The fix consists in adding an intermediate state to ToneGenerator state machine so that we exit the callback function when the stop condition is reached and stop the AudioTrack the next time we execute the callback.
Diffstat (limited to 'media/libmediaplayerservice/MetadataRetrieverClient.cpp')
0 files changed, 0 insertions, 0 deletions