summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLi Sun <sunli@codeaurora.org>2015-07-30 19:09:56 +0800
committerLinux Build Service Account <lnxbuild@localhost>2015-10-06 03:24:51 -0600
commit56d4cd10c3adfa448852fc101780e0b519d8bac8 (patch)
tree7824f91cc5d44ad4e4711f050b227e477d6a2cbc
parenteea5a54a1f478594b9086abeabd5f7fc1b4cca61 (diff)
downloadframeworks_av-56d4cd10c3adfa448852fc101780e0b519d8bac8.zip
frameworks_av-56d4cd10c3adfa448852fc101780e0b519d8bac8.tar.gz
frameworks_av-56d4cd10c3adfa448852fc101780e0b519d8bac8.tar.bz2
rtsp: Don't post AUTimeout check during pause when EOS is nearing
Fix crash issues while repeated pause/resume. The root cause is: While doing repeated pause-resume operation in RTSP streaming, some times, the accessunit timeout check is being posted when the streaming paused, and even after receving the EOS. Due to this check, after the EOS, the number of packets received will be zero and the session gets Teardown while the streaming is paused. Upon resume, it leads to check failure and crash. Cancel the timeout check if pause is not issued to MyHandler when nearing EOS. Change-Id: I897d8e18b0dbc29fc1099e7b3d1b5ccc16426a4d CRs-Fixed: 636312, 676054
-rw-r--r--media/libmediaplayerservice/nuplayer/RTSPSource.cpp4
-rw-r--r--media/libstagefright/rtsp/MyHandler.h13
2 files changed, 17 insertions, 0 deletions
diff --git a/media/libmediaplayerservice/nuplayer/RTSPSource.cpp b/media/libmediaplayerservice/nuplayer/RTSPSource.cpp
index aae46d8..f641f80 100644
--- a/media/libmediaplayerservice/nuplayer/RTSPSource.cpp
+++ b/media/libmediaplayerservice/nuplayer/RTSPSource.cpp
@@ -132,6 +132,10 @@ void NuPlayer::RTSPSource::pause() {
// Check if EOS or ERROR is received
if (source != NULL && source->isFinished(mediaDurationUs)) {
+ if (mHandler != NULL) {
+ ALOGI("Nearing EOS...No Pause is issued");
+ mHandler->cancelTimeoutCheck();
+ }
return;
}
}
diff --git a/media/libstagefright/rtsp/MyHandler.h b/media/libstagefright/rtsp/MyHandler.h
index e105b15..2eea5c9 100644
--- a/media/libstagefright/rtsp/MyHandler.h
+++ b/media/libstagefright/rtsp/MyHandler.h
@@ -107,6 +107,7 @@ struct MyHandler : public AHandler {
kWhatEOS = 'eos!',
kWhatSeekDiscontinuity = 'seeD',
kWhatNormalPlayTimeMapping = 'nptM',
+ kWhatCancelCheck = 'canC',
};
MyHandler(
@@ -255,6 +256,11 @@ struct MyHandler : public AHandler {
msg->post();
}
+ void cancelTimeoutCheck() {
+ sp<AMessage> msg = new AMessage('canC', this);
+ msg->post();
+ }
+
static void addRR(const sp<ABuffer> &buf) {
uint8_t *ptr = buf->data() + buf->size();
ptr[0] = 0x80 | 0;
@@ -1402,6 +1408,13 @@ struct MyHandler : public AHandler {
break;
}
+ case 'canC':
+ {
+ ALOGV("cancel checking timeout");
+ mCheckGeneration++;
+ break;
+ }
+
default:
TRESPASS();
break;