summaryrefslogtreecommitdiffstats
path: root/media/libstagefright/httplive/LiveSession.cpp
diff options
context:
space:
mode:
authorLajos Molnar <lajos@google.com>2014-03-14 05:14:32 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2014-03-14 05:14:32 +0000
commita0b94395dc82c90ca437bb6fed7aa01fcbbffffe (patch)
tree26d750db38c77c32eaecad081ec986e1ffe772c4 /media/libstagefright/httplive/LiveSession.cpp
parent43d3f40b389904a2bdf4fd4ef8e8b914cf5a4b67 (diff)
parent5b297ba76271e8554758cbd569e73720bc914af6 (diff)
downloadframeworks_av-a0b94395dc82c90ca437bb6fed7aa01fcbbffffe.zip
frameworks_av-a0b94395dc82c90ca437bb6fed7aa01fcbbffffe.tar.gz
frameworks_av-a0b94395dc82c90ca437bb6fed7aa01fcbbffffe.tar.bz2
am 5b297ba7: am 67a10c52: Merge "httplive: clear access units before returning from seekTo." into klp-dev
* commit '5b297ba76271e8554758cbd569e73720bc914af6': httplive: clear access units before returning from seekTo.
Diffstat (limited to 'media/libstagefright/httplive/LiveSession.cpp')
-rw-r--r--media/libstagefright/httplive/LiveSession.cpp26
1 files changed, 19 insertions, 7 deletions
diff --git a/media/libstagefright/httplive/LiveSession.cpp b/media/libstagefright/httplive/LiveSession.cpp
index ce2b934..0df6abd 100644
--- a/media/libstagefright/httplive/LiveSession.cpp
+++ b/media/libstagefright/httplive/LiveSession.cpp
@@ -67,7 +67,8 @@ LiveSession::LiveSession(
mRealTimeBaseUs(0ll),
mReconfigurationInProgress(false),
mSwitchInProgress(false),
- mDisconnectReplyID(0) {
+ mDisconnectReplyID(0),
+ mSeekReplyID(0) {
if (mUIDValid) {
mHTTPDataSource->setUID(mUID);
}
@@ -234,6 +235,10 @@ status_t LiveSession::seekTo(int64_t timeUs) {
sp<AMessage> response;
status_t err = msg->postAndAwaitResponse(&response);
+ uint32_t replyID;
+ CHECK(response == mSeekReply && 0 != mSeekReplyID);
+ mSeekReply.clear();
+ mSeekReplyID = 0;
return err;
}
@@ -259,15 +264,12 @@ void LiveSession::onMessageReceived(const sp<AMessage> &msg) {
case kWhatSeek:
{
- uint32_t replyID;
- CHECK(msg->senderAwaitsResponse(&replyID));
+ CHECK(msg->senderAwaitsResponse(&mSeekReplyID));
status_t err = onSeek(msg);
- sp<AMessage> response = new AMessage;
- response->setInt32("err", err);
-
- response->postReply(replyID);
+ mSeekReply = new AMessage;
+ mSeekReply->setInt32("err", err);
break;
}
@@ -297,6 +299,11 @@ void LiveSession::onMessageReceived(const sp<AMessage> &msg) {
CHECK_GT(mContinuationCounter, 0);
if (--mContinuationCounter == 0) {
mContinuation->post();
+
+ if (mSeekReplyID != 0) {
+ CHECK(mSeekReply != NULL);
+ mSeekReply->postReply(mSeekReplyID);
+ }
}
}
break;
@@ -1032,6 +1039,11 @@ void LiveSession::changeConfiguration(
if (mContinuationCounter == 0) {
msg->post();
+
+ if (mSeekReplyID != 0) {
+ CHECK(mSeekReply != NULL);
+ mSeekReply->postReply(mSeekReplyID);
+ }
}
}