mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-09 19:35:51 +00:00
Bug 1349128 - Remove duplicated AndroidDecoderModule in mCurrentPDMs if both PDMAndroidMediaCodecEnabled and PDMAndroidMediaCodecPreferred are set to true; r=jya
The AndroidDecoderModule will be added into PDM queue twice if both PDMAndroidMediaCodecEnabled and PDMAndroidMediaCodecPreferred are set to true. It should be inserted into the head of the PDM queue in this case, and appended to the tail if only PDMAndroidMediaCodecEnabled is true. MozReview-Commit-ID: Fj0z0meeb1V --HG-- extra : rebase_source : 1d7f2b10fd4360d3f641ad6517e9f95afcb99768
This commit is contained in:
parent
f0a98a30fa
commit
ddc78aa48d
@ -343,13 +343,6 @@ PDMFactory::CreatePDMs()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef MOZ_WIDGET_ANDROID
|
|
||||||
if(MediaPrefs::PDMAndroidMediaCodecPreferred() &&
|
|
||||||
MediaPrefs::PDMAndroidMediaCodecEnabled()) {
|
|
||||||
m = new AndroidDecoderModule();
|
|
||||||
StartupPDM(m);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
#ifdef XP_WIN
|
#ifdef XP_WIN
|
||||||
if (MediaPrefs::PDMWMFEnabled()) {
|
if (MediaPrefs::PDMWMFEnabled()) {
|
||||||
m = new WMFDecoderModule();
|
m = new WMFDecoderModule();
|
||||||
@ -387,7 +380,7 @@ PDMFactory::CreatePDMs()
|
|||||||
#ifdef MOZ_WIDGET_ANDROID
|
#ifdef MOZ_WIDGET_ANDROID
|
||||||
if(MediaPrefs::PDMAndroidMediaCodecEnabled()){
|
if(MediaPrefs::PDMAndroidMediaCodecEnabled()){
|
||||||
m = new AndroidDecoderModule();
|
m = new AndroidDecoderModule();
|
||||||
StartupPDM(m);
|
StartupPDM(m, MediaPrefs::PDMAndroidMediaCodecPreferred());
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -410,10 +403,14 @@ PDMFactory::CreateNullPDM()
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
PDMFactory::StartupPDM(PlatformDecoderModule* aPDM)
|
PDMFactory::StartupPDM(PlatformDecoderModule* aPDM, bool aInsertAtBeginning)
|
||||||
{
|
{
|
||||||
if (aPDM && NS_SUCCEEDED(aPDM->Startup())) {
|
if (aPDM && NS_SUCCEEDED(aPDM->Startup())) {
|
||||||
|
if (aInsertAtBeginning) {
|
||||||
|
mCurrentPDMs.InsertElementAt(0, aPDM);
|
||||||
|
} else {
|
||||||
mCurrentPDMs.AppendElement(aPDM);
|
mCurrentPDMs.AppendElement(aPDM);
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
@ -55,7 +55,7 @@ private:
|
|||||||
void CreatePDMs();
|
void CreatePDMs();
|
||||||
void CreateNullPDM();
|
void CreateNullPDM();
|
||||||
// Startup the provided PDM and add it to our list if successful.
|
// Startup the provided PDM and add it to our list if successful.
|
||||||
bool StartupPDM(PlatformDecoderModule* aPDM);
|
bool StartupPDM(PlatformDecoderModule* aPDM, bool aInsertAtBeginning = false);
|
||||||
// Returns the first PDM in our list supporting the mimetype.
|
// Returns the first PDM in our list supporting the mimetype.
|
||||||
already_AddRefed<PlatformDecoderModule>
|
already_AddRefed<PlatformDecoderModule>
|
||||||
GetDecoder(const TrackInfo& aTrackInfo,
|
GetDecoder(const TrackInfo& aTrackInfo,
|
||||||
|
Loading…
Reference in New Issue
Block a user