From a1151185c7eb3b4c483f7067deba1775fd0a2510 Mon Sep 17 00:00:00 2001 From: Lajos Molnar Date: Wed, 8 Apr 2015 16:30:31 -0700 Subject: stagefright: LiveSession: delay consuming reply ID for seek Only consume reply ID when actually handling the seek. Bug: 20123914 Change-Id: I2112ee1b89f8193b487ea2b0b3b7050ba3413864 --- media/libstagefright/httplive/LiveSession.cpp | 25 +++++++++---------------- media/libstagefright/httplive/LiveSession.h | 2 +- 2 files changed, 10 insertions(+), 17 deletions(-) (limited to 'media/libstagefright/httplive') 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 &msg) { case kWhatSeek: { - sp 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 &msg) { +void LiveSession::onSeek(const sp &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 addFetcher(const char *uri); void onConnect(const sp &msg); - status_t onSeek(const sp &msg); + void onSeek(const sp &msg); void onFinishDisconnect2(); // If given a non-zero block_size (default 0), it is used to cap the number of -- cgit v1.1