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

Commit 096daf42 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Close socket before posting message to RTSPSource message handler"

parents 4e09f82f fd3bbcb5
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -144,6 +144,10 @@ void NuPlayer::RTSPSource::stop() {
    if (mLooper == NULL) {
        return;
    }

    // Close socket before posting message to RTSPSource message handler.
    close(mHandler->getARTSPConnection()->getSocket());

    sp<AMessage> msg = new AMessage(kWhatDisconnect, this);

    sp<AMessage> dummy;
+2 −0
Original line number Diff line number Diff line
@@ -46,6 +46,8 @@ struct ARTSPConnection : public AHandler {
            const char *url, AString *host, unsigned *port, AString *path,
            AString *user, AString *pass);

    int getSocket() { return mSocket; }

protected:
    virtual ~ARTSPConnection();
    virtual void onMessageReceived(const sp<AMessage> &msg);
+4 −0
Original line number Diff line number Diff line
@@ -257,6 +257,10 @@ struct MyHandler : public AHandler {
        msg->post();
    }

    sp<ARTSPConnection> getARTSPConnection() {
      return mConn;
    }

    static void addRR(const sp<ABuffer> &buf) {
        uint8_t *ptr = buf->data() + buf->size();
        ptr[0] = 0x80 | 0;