summaryrefslogtreecommitdiffstats
path: root/media
diff options
context:
space:
mode:
authorRobert Shih <robertshih@google.com>2014-09-25 00:11:20 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2014-09-25 00:11:21 +0000
commitec5206c99694d263ac099bf2c37f8119f43f74f1 (patch)
tree97f9b8a1c0204e43e63e6b376b2112f067a92439 /media
parent50373731b2438912e467ae34c92c712bb84d8a75 (diff)
parent800599cdd50737de1cde483a34b39923750b0658 (diff)
downloadframeworks_av-ec5206c99694d263ac099bf2c37f8119f43f74f1.zip
frameworks_av-ec5206c99694d263ac099bf2c37f8119f43f74f1.tar.gz
frameworks_av-ec5206c99694d263ac099bf2c37f8119f43f74f1.tar.bz2
Merge "LiveSession: do not drop seek request" into lmp-dev
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 a289637..7a9a1a3 100644
--- a/media/libstagefright/httplive/LiveSession.cpp
+++ b/media/libstagefright/httplive/LiveSession.cpp
@@ -353,10 +353,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;
}
@@ -382,12 +378,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;
}
@@ -422,7 +422,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();
}
}
}
@@ -1094,10 +1097,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 {
@@ -1254,7 +1258,10 @@ void LiveSession::changeConfiguration(
if (mSeekReplyID != 0) {
CHECK(mSeekReply != NULL);
+ mSeekReply->setInt32("err", OK);
mSeekReply->postReply(mSeekReplyID);
+ mSeekReplyID = 0;
+ mSeekReply.clear();
}
}
}