summaryrefslogtreecommitdiffstats
path: root/media/libmedia/AudioTrack.cpp
diff options
context:
space:
mode:
authorAndy Hung <hunga@google.com>2015-06-08 13:27:48 -0700
committerAndy Hung <hunga@google.com>2015-06-18 14:42:14 -0700
commit6653c935d2518a713587b3887ca09aa09ebfa7fd (patch)
tree6d9680827227e1a263b27e3eb4206a85a5122297 /media/libmedia/AudioTrack.cpp
parent1f1db8356b599bc40703c907fb69e6e539343532 (diff)
downloadframeworks_av-6653c935d2518a713587b3887ca09aa09ebfa7fd.zip
frameworks_av-6653c935d2518a713587b3887ca09aa09ebfa7fd.tar.gz
frameworks_av-6653c935d2518a713587b3887ca09aa09ebfa7fd.tar.bz2
Return DEAD_OBJECT if getTimestamp cannot restore track
Bug: 21699132 Change-Id: I90443f8674ed949e2546048b231be75cd6fe6615
Diffstat (limited to 'media/libmedia/AudioTrack.cpp')
-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.