summaryrefslogtreecommitdiffstats
path: root/media
diff options
context:
space:
mode:
authorRobert Shih <robertshih@google.com>2014-08-29 18:25:05 -0700
committerRobert Shih <robertshih@google.com>2014-09-18 18:23:42 -0700
commit800599cdd50737de1cde483a34b39923750b0658 (patch)
tree036fa8649be8b1427e08d95904fdfbe0cffb9d9a /media
parent2973994af39d55b58728df3dca067594e826ea2a (diff)
downloadframeworks_av-800599cdd50737de1cde483a34b39923750b0658.zip
frameworks_av-800599cdd50737de1cde483a34b39923750b0658.tar.gz
frameworks_av-800599cdd50737de1cde483a34b39923750b0658.tar.bz2
LiveSession: do not drop seek request
Bug: 17538727 Change-Id: I28658b2779ac16512ff54adbe536d01790e6449e
Diffstat (limited to 'media')
-rw-r--r--media/libstagefright/httplive/LiveSession.cpp27
1 files changed, 17 insertions, 10 deletions
diff --git a/media/libstagefright/httplive/LiveSession.cpp b/media/libstagefright/httplive/LiveSession.cpp
index b465566..13cf50c 100644
--- a/media/libstagefright/httplive/LiveSession.cpp
+++ b/media/libstagefright/httplive/LiveSession.cpp
@@ -347,10 +347,6 @@ 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;
}
@@ -376,12 +372,16 @@ void LiveSession::onMessageReceived(const sp<AMessage> &msg) {
case kWhatSeek:
{
- CHECK(msg->senderAwaitsResponse(&mSeekReplyID));
+ uint32_t seekReplyID;
+ CHECK(msg->senderAwaitsResponse(&seekReplyID));
+ mSeekReplyID = seekReplyID;
+ mSeekReply = new AMessage;
status_t err = onSeek(msg);
- mSeekReply = new AMessage;
- mSeekReply->setInt32("err", err);
+ if (err != OK) {
+ msg->post(50000);
+ }
break;
}
@@ -416,7 +416,10 @@ void LiveSession::onMessageReceived(const sp<AMessage> &msg) {
if (mSeekReplyID != 0) {
CHECK(mSeekReply != NULL);
+ mSeekReply->setInt32("err", OK);
mSeekReply->postReply(mSeekReplyID);
+ mSeekReplyID = 0;
+ mSeekReply.clear();
}
}
}
@@ -1070,10 +1073,11 @@ status_t LiveSession::onSeek(const sp<AMessage> &msg) {
CHECK(msg->findInt64("timeUs", &timeUs));
if (!mReconfigurationInProgress) {
- changeConfiguration(timeUs, getBandwidthIndex());
+ changeConfiguration(timeUs, mCurBandwidthIndex);
+ return OK;
+ } else {
+ return -EWOULDBLOCK;
}
-
- return OK;
}
status_t LiveSession::getDuration(int64_t *durationUs) const {
@@ -1225,7 +1229,10 @@ void LiveSession::changeConfiguration(
if (mSeekReplyID != 0) {
CHECK(mSeekReply != NULL);
+ mSeekReply->setInt32("err", OK);
mSeekReply->postReply(mSeekReplyID);
+ mSeekReplyID = 0;
+ mSeekReply.clear();
}
}
}