зеркало из https://github.com/mozilla/gecko-dev.git
Bug 866664 - Don't call WMFDecoder::IsMP3Enabled() off the main thread. r=padenot
This commit is contained in:
Родитель
6922dd4f66
Коммит
f8fb5e60f0
|
@ -25,6 +25,7 @@ MediaDecoderStateMachine* WMFDecoder::CreateStateMachine()
|
|||
bool
|
||||
WMFDecoder::IsMP3Supported()
|
||||
{
|
||||
MOZ_ASSERT(NS_IsMainThread(), "Must be on main thread.");
|
||||
if (!MediaDecoder::IsWMFEnabled()) {
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -40,7 +40,8 @@ WMFReader::WMFReader(AbstractMediaDecoder* aDecoder)
|
|||
mVideoStride(0),
|
||||
mHasAudio(false),
|
||||
mHasVideo(false),
|
||||
mCanSeek(false)
|
||||
mCanSeek(false),
|
||||
mIsMP3Enabled(WMFDecoder::IsMP3Supported())
|
||||
{
|
||||
NS_ASSERTION(NS_IsMainThread(), "Must be on main thread.");
|
||||
MOZ_COUNT_CTOR(WMFReader);
|
||||
|
@ -388,13 +389,13 @@ WMFReader::ConfigureVideoDecoder()
|
|||
return S_OK;
|
||||
}
|
||||
|
||||
static void
|
||||
GetSupportedAudioCodecs(const GUID** aCodecs, uint32_t* aNumCodecs)
|
||||
void
|
||||
WMFReader::GetSupportedAudioCodecs(const GUID** aCodecs, uint32_t* aNumCodecs)
|
||||
{
|
||||
MOZ_ASSERT(aCodecs);
|
||||
MOZ_ASSERT(aNumCodecs);
|
||||
|
||||
if (WMFDecoder::IsMP3Supported()) {
|
||||
if (mIsMP3Enabled) {
|
||||
static const GUID codecs[] = {
|
||||
MFAudioFormat_AAC,
|
||||
MFAudioFormat_MP3
|
||||
|
|
|
@ -55,6 +55,7 @@ private:
|
|||
HRESULT ConfigureAudioDecoder();
|
||||
HRESULT ConfigureVideoDecoder();
|
||||
HRESULT ConfigureVideoFrameGeometry(IMFMediaType* aMediaType);
|
||||
void GetSupportedAudioCodecs(const GUID** aCodecs, uint32_t* aNumCodecs);
|
||||
|
||||
RefPtr<IMFSourceReader> mSourceReader;
|
||||
RefPtr<WMFByteStream> mByteStream;
|
||||
|
@ -74,6 +75,11 @@ private:
|
|||
bool mHasAudio;
|
||||
bool mHasVideo;
|
||||
bool mCanSeek;
|
||||
|
||||
// We can't call WMFDecoder::IsMP3Supported() on non-main threads, since it
|
||||
// checks a pref, so we cache its value in mIsMP3Enabled and use that on
|
||||
// the decode thread.
|
||||
const bool mIsMP3Enabled;
|
||||
};
|
||||
|
||||
} // namespace mozilla
|
||||
|
|
Загрузка…
Ссылка в новой задаче