summaryrefslogtreecommitdiffstats
path: root/media/libstagefright/httplive
diff options
context:
space:
mode:
authorLajos Molnar <lajos@google.com>2015-04-08 16:30:31 -0700
committerLajos Molnar <lajos@google.com>2015-04-08 16:39:48 -0700
commita1151185c7eb3b4c483f7067deba1775fd0a2510 (patch)
tree4880847e0c5a86eb7223c0ec11d54c4cea92fc42 /media/libstagefright/httplive
parent86f79e3f3bc1de7b4e4dd045de8962b8a62ab5d5 (diff)
downloadframeworks_av-a1151185c7eb3b4c483f7067deba1775fd0a2510.zip
frameworks_av-a1151185c7eb3b4c483f7067deba1775fd0a2510.tar.gz
frameworks_av-a1151185c7eb3b4c483f7067deba1775fd0a2510.tar.bz2
stagefright: LiveSession: delay consuming reply ID for seek
Only consume reply ID when actually handling the seek. Bug: 20123914 Change-Id: I2112ee1b89f8193b487ea2b0b3b7050ba3413864
Diffstat (limited to 'media/libstagefright/httplive')
-rw-r--r--media/libstagefright/httplive/LiveSession.cpp25
-rw-r--r--media/libstagefright/httplive/LiveSession.h2
2 files changed, 10 insertions, 17 deletions
diff --git a/media/libstagefright/httplive/LiveSession.cpp b/media/libstagefright/httplive/LiveSession.cpp
index f7a4a0d..26f8da1 100644
--- a/media/libstagefright/httplive/LiveSession.cpp
+++ b/media/libstagefright/httplive/LiveSession.cpp
@@ -498,16 +498,15 @@ void LiveSession::onMessageReceived(const sp<AMessage> &msg) {
case kWhatSeek:
{
- sp<AReplyToken> seekReplyID;
- CHECK(msg->senderAwaitsResponse(&seekReplyID));
- mSeekReplyID = seekReplyID;
- mSeekReply = new AMessage;
-
- status_t err = onSeek(msg);
-
- if (err != OK) {
+ if (mReconfigurationInProgress) {
msg->post(50000);
+ break;
}
+
+ CHECK(msg->senderAwaitsResponse(&mSeekReplyID));
+ mSeekReply = new AMessage;
+
+ onSeek(msg);
break;
}
@@ -1372,16 +1371,10 @@ HLSTime LiveSession::latestMediaSegmentStartTime() const {
return audioTime < videoTime ? videoTime : audioTime;
}
-status_t LiveSession::onSeek(const sp<AMessage> &msg) {
+void LiveSession::onSeek(const sp<AMessage> &msg) {
int64_t timeUs;
CHECK(msg->findInt64("timeUs", &timeUs));
-
- if (!mReconfigurationInProgress) {
- changeConfiguration(timeUs);
- return OK;
- } else {
- return -EWOULDBLOCK;
- }
+ changeConfiguration(timeUs);
}
status_t LiveSession::getDuration(int64_t *durationUs) const {
diff --git a/media/libstagefright/httplive/LiveSession.h b/media/libstagefright/httplive/LiveSession.h
index e4f1b97..c587f40 100644
--- a/media/libstagefright/httplive/LiveSession.h
+++ b/media/libstagefright/httplive/LiveSession.h
@@ -237,7 +237,7 @@ private:
sp<PlaylistFetcher> addFetcher(const char *uri);
void onConnect(const sp<AMessage> &msg);
- status_t onSeek(const sp<AMessage> &msg);
+ void onSeek(const sp<AMessage> &msg);
void onFinishDisconnect2();
// If given a non-zero block_size (default 0), it is used to cap the number of