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
diff --git a/media/libstagefright/AwesomePlayer.cpp b/media/libstagefright/AwesomePlayer.cpp
index cc3fae6..8b92d1e 100644
--- a/media/libstagefright/AwesomePlayer.cpp
+++ b/media/libstagefright/AwesomePlayer.cpp
@@ -445,7 +445,7 @@
}
}
} else if (!strcasecmp(mime.string(), MEDIA_MIMETYPE_TEXT_3GPP)) {
- addTextSource(i, extractor->getTrack(i));
+ addTextSource_l(i, extractor->getTrack(i));
}
}
@@ -1347,8 +1347,7 @@
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) {
diff --git a/media/libstagefright/include/AwesomePlayer.h b/media/libstagefright/include/AwesomePlayer.h
index 1409dc7..909654a 100644
--- a/media/libstagefright/include/AwesomePlayer.h
+++ b/media/libstagefright/include/AwesomePlayer.h
@@ -258,7 +258,7 @@
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();