summaryrefslogtreecommitdiffstats
path: root/services/audioflinger/AudioFlinger.cpp
diff options
context:
space:
mode:
authorGlenn Kasten <gkasten@google.com>2012-02-03 07:45:13 -0800
committerAndroid (Google) Code Review <android-gerrit@google.com>2012-02-03 07:45:13 -0800
commitf81e97e4ec8b01965a5b36987f886cf5001f71ff (patch)
tree25df07b2a8864a1d6b33d2ff0defaecb048e7c39 /services/audioflinger/AudioFlinger.cpp
parent84afa3b51ac48f84ed62489529ce78cba7fca00e (diff)
parent77c1119ea0b5cb32287088ceeeb7e3b6bd14a85d (diff)
downloadframeworks_av-f81e97e4ec8b01965a5b36987f886cf5001f71ff.zip
frameworks_av-f81e97e4ec8b01965a5b36987f886cf5001f71ff.tar.gz
frameworks_av-f81e97e4ec8b01965a5b36987f886cf5001f71ff.tar.bz2
Merge "No need to check a wp<> for 0 before promote()"
Diffstat (limited to 'services/audioflinger/AudioFlinger.cpp')
-rw-r--r--services/audioflinger/AudioFlinger.cpp22
1 files changed, 8 insertions, 14 deletions
diff --git a/services/audioflinger/AudioFlinger.cpp b/services/audioflinger/AudioFlinger.cpp
index 7d87d92..b31040c 100644
--- a/services/audioflinger/AudioFlinger.cpp
+++ b/services/audioflinger/AudioFlinger.cpp
@@ -267,13 +267,10 @@ status_t AudioFlinger::dumpClients(int fd, const Vector<String16>& args)
result.append("Clients:\n");
for (size_t i = 0; i < mClients.size(); ++i) {
- wp<Client> wClient = mClients.valueAt(i);
- if (wClient != 0) {
- sp<Client> client = wClient.promote();
- if (client != 0) {
- snprintf(buffer, SIZE, " pid: %d\n", client->pid());
- result.append(buffer);
- }
+ sp<Client> client = mClients.valueAt(i).promote();
+ if (client != 0) {
+ snprintf(buffer, SIZE, " pid: %d\n", client->pid());
+ result.append(buffer);
}
}
@@ -1444,13 +1441,10 @@ status_t AudioFlinger::PlaybackThread::dumpTracks(int fd, const Vector<String16>
result.append(buffer);
result.append(" Name Clien Typ Fmt Chn mask Session Buf S M F SRate LeftV RighV Serv User Main buf Aux Buf\n");
for (size_t i = 0; i < mActiveTracks.size(); ++i) {
- wp<Track> wTrack = mActiveTracks[i];
- if (wTrack != 0) {
- sp<Track> track = wTrack.promote();
- if (track != 0) {
- track->dump(buffer, SIZE);
- result.append(buffer);
- }
+ sp<Track> track = mActiveTracks[i].promote();
+ if (track != 0) {
+ track->dump(buffer, SIZE);
+ result.append(buffer);
}
}
write(fd, result.string(), result.size());