diff options
author | Praveen Chavan <pchavan@codeaurora.org> | 2015-10-19 14:44:52 -0700 |
---|---|---|
committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2015-10-26 19:21:19 -0700 |
commit | bbb9b1da50edbbed193b342be19b62e232254f27 (patch) | |
tree | e9b4a7ebbc032f037cfe0e842ef757bc71917d88 /media/libmediaplayerservice/nuplayer/GenericSource.h | |
parent | 04fdb627d164cc81c8fa2830db1b20cf1261aea4 (diff) | |
download | frameworks_av-bbb9b1da50edbbed193b342be19b62e232254f27.zip frameworks_av-bbb9b1da50edbbed193b342be19b62e232254f27.tar.gz frameworks_av-bbb9b1da50edbbed193b342be19b62e232254f27.tar.bz2 |
GenericSource: Synchronize access to dataSource
DataSource and HTTPSource can be accessed/modified by
GenericSource's looper and Client's thread which can
lead to race conditions when copying the sp<>.
Add a Mutex lock to synchronize such accesses and avoid
race conditions.
CRs-Fixed: 906899
Change-Id: I2fb4b4a7079e638e151f4fe67a780007a4011652
Diffstat (limited to 'media/libmediaplayerservice/nuplayer/GenericSource.h')
-rw-r--r-- | media/libmediaplayerservice/nuplayer/GenericSource.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/media/libmediaplayerservice/nuplayer/GenericSource.h b/media/libmediaplayerservice/nuplayer/GenericSource.h index 0181947..beaee9a 100644 --- a/media/libmediaplayerservice/nuplayer/GenericSource.h +++ b/media/libmediaplayerservice/nuplayer/GenericSource.h @@ -136,6 +136,7 @@ protected: int64_t mOffset; int64_t mLength; + Mutex mSourceLock; sp<DataSource> mDataSource; sp<NuCachedSource2> mCachedSource; sp<DataSource> mHttpSource; |