From 4f8fc5a1534d452a072eab2e1eebd4ffa744ac4a Mon Sep 17 00:00:00 2001 From: Manikanta Kanamarlapudi Date: Fri, 6 Nov 2015 19:16:31 +0530 Subject: Revert "GenericSource: Synchronize access to dataSource" This reverts commit a5c3b990807732d1c4a7c1290cba06a605675973. Change-Id: I1f267cf7ab90b1f5c38e0659df02c8ef518382ed --- .../nuplayer/GenericSource.cpp | 28 +++++----------------- .../libmediaplayerservice/nuplayer/GenericSource.h | 1 - 2 files changed, 6 insertions(+), 23 deletions(-) (limited to 'media/libmediaplayerservice') diff --git a/media/libmediaplayerservice/nuplayer/GenericSource.cpp b/media/libmediaplayerservice/nuplayer/GenericSource.cpp index d761bdf..7c99f11 100644 --- a/media/libmediaplayerservice/nuplayer/GenericSource.cpp +++ b/media/libmediaplayerservice/nuplayer/GenericSource.cpp @@ -128,7 +128,6 @@ status_t NuPlayer::GenericSource::setDataSource( status_t NuPlayer::GenericSource::setDataSource(const sp& source) { resetDataSource(); - Mutex::Autolock _l(mSourceLock); mDataSource = source; return OK; } @@ -156,12 +155,7 @@ status_t NuPlayer::GenericSource::initFromDataSource() { return UNKNOWN_ERROR; } } else if (mIsStreaming) { - sp dataSource; - { - Mutex::Autolock _l(mSourceLock); - dataSource = mDataSource; - } - if (!dataSource->sniff(&mimeType, &confidence, &dummy)) { + if (!mDataSource->sniff(&mimeType, &confidence, &dummy)) { return UNKNOWN_ERROR; } isWidevineStreaming = !strcasecmp( @@ -393,7 +387,6 @@ void NuPlayer::GenericSource::onPrepareAsync() { } } - Mutex::Autolock _l(mSourceLock); mDataSource = DataSource::CreateFromURI( mHTTPService, uri, &mUriHeaders, &contentType, static_cast(mHttpSource.get()), @@ -401,7 +394,6 @@ void NuPlayer::GenericSource::onPrepareAsync() { } else { mIsWidevine = false; - Mutex::Autolock _l(mSourceLock); mDataSource = new FileSource(mFd, mOffset, mLength); mFd = -1; } @@ -493,7 +485,6 @@ void NuPlayer::GenericSource::finishPrepareAsync() { void NuPlayer::GenericSource::notifyPreparedAndCleanup(status_t err) { if (err != OK) { { - Mutex::Autolock _l(mSourceLock); mDataSource.clear(); mCachedSource.clear(); mHttpSource.clear(); @@ -550,20 +541,13 @@ void NuPlayer::GenericSource::resume() { } void NuPlayer::GenericSource::disconnect() { - sp dataSource, httpSource; - { - Mutex::Autolock _l(mSourceLock); - dataSource = mDataSource; - httpSource = mHttpSource; - } - - if (dataSource != NULL) { + if (mDataSource != NULL) { // disconnect data source - if (dataSource->flags() & DataSource::kIsCachingDataSource) { - static_cast(dataSource.get())->disconnect(); + if (mDataSource->flags() & DataSource::kIsCachingDataSource) { + static_cast(mDataSource.get())->disconnect(); } - } else if (httpSource != NULL) { - static_cast(httpSource.get())->disconnect(); + } else if (mHttpSource != NULL) { + static_cast(mHttpSource.get())->disconnect(); } } diff --git a/media/libmediaplayerservice/nuplayer/GenericSource.h b/media/libmediaplayerservice/nuplayer/GenericSource.h index c1d6e3e..ebc1fdc 100644 --- a/media/libmediaplayerservice/nuplayer/GenericSource.h +++ b/media/libmediaplayerservice/nuplayer/GenericSource.h @@ -137,7 +137,6 @@ protected: int64_t mOffset; int64_t mLength; - Mutex mSourceLock; sp mDataSource; sp mCachedSource; sp mHttpSource; -- cgit v1.1