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

Commit 6a3969cc authored by Edwin Wong's avatar Edwin Wong
Browse files

Removed mutex lock in addTextSource, and rename to addTextSource_l

to indicate this method needs to be called with a lock hold.

Change-Id: I7e99f0a622e7de49c288be09dd4fc955bbca390b
related-to-bug: 5629511
related-to-bug: 5542712
parent 359f90ce
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -445,7 +445,7 @@ status_t AwesomePlayer::setDataSource_l(const sp<MediaExtractor> &extractor) {
                }
            }
        } else if (!strcasecmp(mime.string(), MEDIA_MIMETYPE_TEXT_3GPP)) {
            addTextSource(i, extractor->getTrack(i));
            addTextSource_l(i, extractor->getTrack(i));
        }
    }

@@ -1347,8 +1347,7 @@ void AwesomePlayer::setAudioSource(sp<MediaSource> source) {
    mAudioTrack = source;
}

void AwesomePlayer::addTextSource(size_t trackIndex, const sp<MediaSource>& source) {
    Mutex::Autolock autoLock(mLock);
void AwesomePlayer::addTextSource_l(size_t trackIndex, const sp<MediaSource>& source) {
    CHECK(source != NULL);

    if (mTextDriver == NULL) {
+1 −1
Original line number Diff line number Diff line
@@ -258,7 +258,7 @@ private:
    void setVideoSource(sp<MediaSource> source);
    status_t initVideoDecoder(uint32_t flags = 0);

    void addTextSource(size_t trackIndex, const sp<MediaSource>& source);
    void addTextSource_l(size_t trackIndex, const sp<MediaSource>& source);

    void onStreamDone();