Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b9c21a88 authored by Andreas Huber's avatar Andreas Huber Committed by Android (Google) Code Review
Browse files

Merge "Enable cancelling the rtsp connection process early."

parents 302b9884 cb218793
Loading
Loading
Loading
Loading
+10 −1
Original line number Diff line number Diff line
@@ -399,6 +399,9 @@ void AwesomePlayer::reset_l() {
        if (mConnectingDataSource != NULL) {
            LOGI("interrupting the connection process");
            mConnectingDataSource->disconnect();
        } else if (mConnectingRTSPController != NULL) {
            LOGI("interrupting the connection process");
            mConnectingRTSPController->disconnect();
        }

        if (mFlags & PREPARING_CONNECTED) {
@@ -409,7 +412,7 @@ void AwesomePlayer::reset_l() {
    }

    if (mFlags & PREPARING) {
        LOGI("waiting until preparation is completes.");
        LOGI("waiting until preparation is completed.");
    }

    while (mFlags & PREPARING) {
@@ -1633,7 +1636,13 @@ status_t AwesomePlayer::finishSetDataSource_l() {
            mLooper->start();
        }
        mRTSPController = new ARTSPController(mLooper);
        mConnectingRTSPController = mRTSPController;

        mLock.unlock();
        status_t err = mRTSPController->connect(mUri.string());
        mLock.lock();

        mConnectingRTSPController.clear();

        LOGI("ARTSPController::connect returned %d", err);

+1 −0
Original line number Diff line number Diff line
@@ -205,6 +205,7 @@ private:

    sp<ALooper> mLooper;
    sp<ARTSPController> mRTSPController;
    sp<ARTSPController> mConnectingRTSPController;

    sp<LiveSession> mLiveSession;

+8 −1
Original line number Diff line number Diff line
@@ -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;
    }