diff options
author | Andreas Huber <andih@google.com> | 2011-02-14 14:14:23 -0800 |
---|---|---|
committer | Andreas Huber <andih@google.com> | 2011-02-14 14:14:23 -0800 |
commit | f1958f9442bc937e1f8c8d9175901500b944b021 (patch) | |
tree | 38afd720c953a64aa9d547ea6a37613da5098a17 /media/libstagefright/rtsp | |
parent | 126ea73dd1919c8a176019c50b1ca96035aef45b (diff) | |
download | frameworks_av-f1958f9442bc937e1f8c8d9175901500b944b021.zip frameworks_av-f1958f9442bc937e1f8c8d9175901500b944b021.tar.gz frameworks_av-f1958f9442bc937e1f8c8d9175901500b944b021.tar.bz2 |
Enable cancelling the rtsp connection process early.
Change-Id: Ie2059c54541ad8c675944d71b39c772b0f6f04c8
related-to-bug: 3452699
Diffstat (limited to 'media/libstagefright/rtsp')
-rw-r--r-- | media/libstagefright/rtsp/ARTSPController.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/media/libstagefright/rtsp/ARTSPController.cpp b/media/libstagefright/rtsp/ARTSPController.cpp index a7563ff..1328d2e 100644 --- a/media/libstagefright/rtsp/ARTSPController.cpp +++ b/media/libstagefright/rtsp/ARTSPController.cpp @@ -69,7 +69,14 @@ status_t ARTSPController::connect(const char *url) { void ARTSPController::disconnect() { Mutex::Autolock autoLock(mLock); - if (mState != CONNECTED) { + if (mState == CONNECTING) { + mState = DISCONNECTED; + mConnectionResult = ERROR_IO; + mCondition.broadcast(); + + mHandler.clear(); + return; + } else if (mState != CONNECTED) { return; } |