Bug 874325 - Add lock to MediaStreamSource::readAt(). r=doublec

This commit is contained in:
Sotaro Ikeda 2013-06-03 10:41:54 -04:00
parent 58cbdd692d
commit 1591798e76
2 changed files with 2 additions and 0 deletions

View File

@ -98,6 +98,7 @@ ssize_t MediaStreamSource::readAt(off64_t offset, void *data, size_t size)
char *ptr = static_cast<char *>(data);
size_t todo = size;
while (todo > 0) {
Mutex::Autolock autoLock(mLock);
uint32_t bytesRead;
if ((offset != mResource->Tell() &&
NS_FAILED(mResource->Seek(nsISeekableStream::NS_SEEK_SET, offset))) ||

View File

@ -42,6 +42,7 @@ class MediaStreamSource : public DataSource {
typedef mozilla::MediaResource MediaResource;
typedef mozilla::AbstractMediaDecoder AbstractMediaDecoder;
Mutex mLock;
nsRefPtr<MediaResource> mResource;
AbstractMediaDecoder *mDecoder;
public: