diff options
author | Glenn Kasten <gkasten@google.com> | 2014-01-16 15:06:36 -0800 |
---|---|---|
committer | Glenn Kasten <gkasten@google.com> | 2014-01-16 17:01:04 -0800 |
commit | 0cde076ddb283c84c3801a2df4cc3df99bd1577f (patch) | |
tree | 9f1d49f9fc52a5cedea8e0bd14555a70ab5772b0 /media/libmedia/IAudioFlinger.cpp | |
parent | a238b9b43a2b8dac60e0fd8700daa6cd4f644547 (diff) | |
download | frameworks_av-0cde076ddb283c84c3801a2df4cc3df99bd1577f.zip frameworks_av-0cde076ddb283c84c3801a2df4cc3df99bd1577f.tar.gz frameworks_av-0cde076ddb283c84c3801a2df4cc3df99bd1577f.tar.bz2 |
Cleanup createTrack error handling
Similar to cleanup done earlier for openRecord in this CL:
> Change-Id: I84897dd7d30b370640b54e928f230604b873cb68
Bug: 10888816
Change-Id: I804a47f898e0319a60a9bd58906bbb037e45cc25
Diffstat (limited to 'media/libmedia/IAudioFlinger.cpp')
-rw-r--r-- | media/libmedia/IAudioFlinger.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/media/libmedia/IAudioFlinger.cpp b/media/libmedia/IAudioFlinger.cpp index c9c8d58..ecbb5bf 100644 --- a/media/libmedia/IAudioFlinger.cpp +++ b/media/libmedia/IAudioFlinger.cpp @@ -138,6 +138,17 @@ public: name = reply.readString8(); lStatus = reply.readInt32(); track = interface_cast<IAudioTrack>(reply.readStrongBinder()); + if (lStatus == NO_ERROR) { + if (track == 0) { + ALOGE("createTrack should have returned an IAudioTrack"); + lStatus = UNKNOWN_ERROR; + } + } else { + if (track != 0) { + ALOGE("createTrack returned an IAudioTrack but with status %d", lStatus); + track.clear(); + } + } } if (status != NULL) { *status = lStatus; @@ -795,6 +806,7 @@ status_t BnAudioFlinger::onTransact( (audio_stream_type_t) streamType, sampleRate, format, channelMask, frameCount, &flags, buffer, output, tid, &sessionId, name, clientUid, &status); + LOG_ALWAYS_FATAL_IF((track != 0) != (status == NO_ERROR)); } reply->writeInt32(flags); reply->writeInt32(sessionId); |