From 9a1c8892f6835325db6931529dc74bf98cf0aee8 Mon Sep 17 00:00:00 2001 From: Andy Hung Date: Wed, 3 Dec 2014 11:37:42 -0800 Subject: Fix getTimestamp if offload thread is not initialized. Returns INVALID_OPERATION. Bug: 18605649 Change-Id: I440fb687fbf9249098e049982fa83bcd1515fd80 --- services/audioflinger/Threads.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/services/audioflinger/Threads.cpp b/services/audioflinger/Threads.cpp index 08d9eb1..dab6d91 100644 --- a/services/audioflinger/Threads.cpp +++ b/services/audioflinger/Threads.cpp @@ -2688,7 +2688,8 @@ status_t AudioFlinger::PlaybackThread::getTimestamp_l(AudioTimestamp& timestamp) if (mNormalSink != 0) { return mNormalSink->getTimestamp(timestamp); } - if ((mType == OFFLOAD || mType == DIRECT) && mOutput->stream->get_presentation_position) { + if ((mType == OFFLOAD || mType == DIRECT) + && mOutput != NULL && mOutput->stream->get_presentation_position) { uint64_t position64; int ret = mOutput->stream->get_presentation_position( mOutput->stream, &position64, ×tamp.mTime); -- cgit v1.1