Bug 1156689: Part10. Remove static_cast on TrackInfo objects. r=cpearce
authorJean-Yves Avenard <jyavenard@mozilla.com>
Fri, 01 May 2015 15:26:51 +1000
changeset 273345 005828e55212c21f58101785311db67f0747688f
parent 273344 be99748763429b0c7f9f3d4280715c8128797d7e
child 273346 4b77e03a478830b6c62688fc5ac1117e3f684563
push id863
push userraliiev@mozilla.com
push dateMon, 03 Aug 2015 13:22:43 +0000
treeherdermozilla-release@f6321b14228d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerscpearce
bugs1156689
milestone40.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1156689: Part10. Remove static_cast on TrackInfo objects. r=cpearce
dom/media/fmp4/PlatformDecoderModule.cpp
--- a/dom/media/fmp4/PlatformDecoderModule.cpp
+++ b/dom/media/fmp4/PlatformDecoderModule.cpp
@@ -180,36 +180,36 @@ already_AddRefed<MediaDataDecoder>
 PlatformDecoderModule::CreateDecoder(const TrackInfo& aConfig,
                                      FlushableMediaTaskQueue* aTaskQueue,
                                      MediaDataDecoderCallback* aCallback,
                                      layers::LayersBackend aLayersBackend,
                                      layers::ImageContainer* aImageContainer)
 {
   nsRefPtr<MediaDataDecoder> m;
 
-  if (aConfig.IsAudio()) {
-    m = CreateAudioDecoder(static_cast<const AudioInfo&>(aConfig),
+  if (aConfig.GetAsAudioInfo()) {
+    m = CreateAudioDecoder(*aConfig.GetAsAudioInfo(),
                            aTaskQueue,
                            aCallback);
     return m.forget();
   }
 
-  if (!aConfig.IsVideo()) {
+  if (!aConfig.GetAsVideoInfo()) {
     return nullptr;
   }
 
   if (H264Converter::IsH264(aConfig)) {
     m = new H264Converter(this,
-                          static_cast<const VideoInfo&>(aConfig),
+                          *aConfig.GetAsVideoInfo(),
                           aLayersBackend,
                           aImageContainer,
                           aTaskQueue,
                           aCallback);
   } else {
-    m = CreateVideoDecoder(static_cast<const VideoInfo&>(aConfig),
+    m = CreateVideoDecoder(*aConfig.GetAsVideoInfo(),
                            aLayersBackend,
                            aImageContainer,
                            aTaskQueue,
                            aCallback);
   }
   return m.forget();
 }