Backed out changeset 2ae0864c76bc (bug 1319992)

This commit is contained in:
Sebastian Hengst 2016-12-19 12:38:28 +01:00
Родитель 088b219e17
Коммит 05f0d649cb
2 изменённых файлов: 9 добавлений и 8 удалений

Просмотреть файл

@ -19,6 +19,7 @@
#include "mozilla/ClearOnShutdown.h"
#include "mozilla/Preferences.h"
#include "mozilla/Telemetry.h"
#include "mozilla/Mutex.h"
#include "mozilla/SharedThreadPool.h"
#include "mozilla/SyncRunnable.h"
#include "nsContentUtils.h"
@ -414,7 +415,7 @@ MediaFormatReader::DecoderFactory::DoInitDecoder(TrackType aTrack)
[this, &data, &ownerData] (TrackType aTrack) {
data.mInitPromise.Complete();
data.mStage = Stage::None;
MutexAutoLock lock(ownerData.mMutex);
MonitorAutoLock mon(ownerData.mMonitor);
ownerData.mDecoder = data.mDecoder.forget();
ownerData.mDescription = ownerData.mDecoder->GetDescriptionName();
mOwner->SetVideoDecodeThreshold();
@ -2645,11 +2646,11 @@ MediaFormatReader::GetMozDebugReaderData(nsAString& aString)
const char* videoName = audioName;
if (HasAudio()) {
MutexAutoLock lock(mAudio.mMutex);
MonitorAutoLock mon(mAudio.mMonitor);
audioName = mAudio.mDescription;
}
if (HasVideo()) {
MutexAutoLock mon(mVideo.mMutex);
MonitorAutoLock mon(mVideo.mMonitor);
videoName = mVideo.mDescription;
}

Просмотреть файл

@ -10,7 +10,7 @@
#include "mozilla/Atomics.h"
#include "mozilla/Maybe.h"
#include "mozilla/TaskQueue.h"
#include "mozilla/Mutex.h"
#include "mozilla/Monitor.h"
#include "MediaEventSource.h"
#include "MediaDataDemuxer.h"
@ -209,7 +209,7 @@ private:
uint32_t aNumOfMaxError)
: mOwner(aOwner)
, mType(aType)
, mMutex("DecoderData")
, mMonitor("DecoderData")
, mDescription("shutdown")
, mUpdateScheduled(false)
, mDemuxEOS(false)
@ -243,14 +243,14 @@ private:
// Callback that receives output and error notifications from the decoder.
nsAutoPtr<DecoderCallback> mCallback;
// Mutex protecting mDescription and mDecoder.
Mutex mMutex;
// Monitor protecting mDescription and mDecoder.
Monitor mMonitor;
// The platform decoder.
RefPtr<MediaDataDecoder> mDecoder;
const char* mDescription;
void ShutdownDecoder()
{
MutexAutoLock lock(mMutex);
MonitorAutoLock mon(mMonitor);
if (mDecoder) {
mDecoder->Shutdown();
}