OSDN Git Service

Multithread safety and code reduction
authorGlenn Kasten <gkasten@google.com>
Fri, 30 Sep 2011 21:14:37 +0000 (14:14 -0700)
committerGlenn Kasten <gkasten@google.com>
Tue, 11 Oct 2011 00:46:10 +0000 (17:46 -0700)
commite851581e7a62192f69626b9a0d2e5380a4d3979c
treeb0e539d21ea536aa3fccdd665ad29a5cb399515b
parent2102fe47f517fa51e742d816ad0fc5cff65d3e41
Multithread safety and code reduction

Remove unsafe GenericPlayer::getSampleRate().  getSampleRate() was not
thread-safe as it accessed a member variable updated in the looper thread
without a lock.  If getSampleRate() is ever needed again, the sample rate
is available in the mPcmFormatValues array, which does have a lock.

Replace member variables mChannelMask, mChannelCount, and mSampleRateHz
by local variables for locality and performance.

Change-Id: Ibf92ed090430153d748ded4d0b835e429df47eea
wilhelm/src/android/AacBqToPcmCbRenderer.cpp
wilhelm/src/android/android_AudioSfDecoder.cpp
wilhelm/src/android/android_AudioSfDecoder.h
wilhelm/src/android/android_AudioToCbRenderer.cpp
wilhelm/src/android/android_GenericMediaPlayer.cpp
wilhelm/src/android/android_GenericPlayer.cpp
wilhelm/src/android/android_GenericPlayer.h