summaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
authorAndy Hung <hunga@google.com>2014-12-03 11:37:42 -0800
committerAndy Hung <hunga@google.com>2014-12-03 16:12:35 -0800
commit9a1c8892f6835325db6931529dc74bf98cf0aee8 (patch)
tree8b6d6b4dcaf964cf16c68bdc5080239126d2caac /services
parentab05b4ccb8ea59079d7f773aa0e090029c479bad (diff)
downloadframeworks_av-9a1c8892f6835325db6931529dc74bf98cf0aee8.zip
frameworks_av-9a1c8892f6835325db6931529dc74bf98cf0aee8.tar.gz
frameworks_av-9a1c8892f6835325db6931529dc74bf98cf0aee8.tar.bz2
Fix getTimestamp if offload thread is not initialized.
Returns INVALID_OPERATION. Bug: 18605649 Change-Id: I440fb687fbf9249098e049982fa83bcd1515fd80
Diffstat (limited to 'services')
-rw-r--r--services/audioflinger/Threads.cpp3
1 files changed, 2 insertions, 1 deletions
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, &timestamp.mTime);