summaryrefslogtreecommitdiffstats
path: root/media/libmedia
diff options
context:
space:
mode:
authorAndy Hung <hunga@google.com>2015-06-19 15:57:05 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2015-06-19 15:57:05 +0000
commitf86e831ec0cbdce2d34c48fc567ad91a47099b70 (patch)
treeb6413cb2650e0b25d3000780b0fe2517640a719f /media/libmedia
parentb36bc776545d9758f3bc9a853a5a0fd51280e9fb (diff)
parent6653c935d2518a713587b3887ca09aa09ebfa7fd (diff)
downloadframeworks_av-f86e831ec0cbdce2d34c48fc567ad91a47099b70.zip
frameworks_av-f86e831ec0cbdce2d34c48fc567ad91a47099b70.tar.gz
frameworks_av-f86e831ec0cbdce2d34c48fc567ad91a47099b70.tar.bz2
Merge "Return DEAD_OBJECT if getTimestamp cannot restore track" into mnc-dev
Diffstat (limited to 'media/libmedia')
-rw-r--r--media/libmedia/AudioTrack.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/media/libmedia/AudioTrack.cpp b/media/libmedia/AudioTrack.cpp
index 949bc21..b5d7614 100644
--- a/media/libmedia/AudioTrack.cpp
+++ b/media/libmedia/AudioTrack.cpp
@@ -2207,7 +2207,12 @@ status_t AudioTrack::getTimestamp(AudioTimestamp& timestamp)
}
if (mCblk->mFlags & CBLK_INVALID) {
- restoreTrack_l("getTimestamp");
+ const status_t status = restoreTrack_l("getTimestamp");
+ if (status != OK) {
+ // per getTimestamp() API doc in header, we return DEAD_OBJECT here,
+ // recommending that the track be recreated.
+ return DEAD_OBJECT;
+ }
}
// The presented frame count must always lag behind the consumed frame count.