Bug 1118593 - Disable MoofParser for encrypted streams. r=kentuckyfriedtakahe
authorChris Pearce <cpearce@mozilla.com>
Wed, 07 Jan 2015 17:09:27 +1300
changeset 222364 36ff8406cca7ceb5cd939a003e7cb56a7a281bd0
parent 222363 c71e4fb1d36c094192abfc22d5454b9cfc8bedb9
child 222365 80f15029ae68eef0d3b299097284780c1bab1a91
push id10683
push usercbook@mozilla.com
push dateWed, 07 Jan 2015 13:30:50 +0000
treeherderfx-team@3a1103c584cb [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskentuckyfriedtakahe
bugs1118593
milestone37.0a1
Bug 1118593 - Disable MoofParser for encrypted streams. r=kentuckyfriedtakahe
media/libstagefright/binding/mp4_demuxer.cpp
--- a/media/libstagefright/binding/mp4_demuxer.cpp
+++ b/media/libstagefright/binding/mp4_demuxer.cpp
@@ -107,30 +107,30 @@ MP4Demuxer::Init()
       if (track->start() != OK) {
         return false;
       }
       mPrivate->mAudio = track;
       mAudioConfig.Update(metaData, mimeType);
       nsRefPtr<Index> index = new Index(mPrivate->mAudio->exportIndex(),
                                         mSource, mAudioConfig.mTrackId, mMonitor);
       mPrivate->mIndexes.AppendElement(index);
-      if (index->IsFragmented()) {
+      if (index->IsFragmented() && !mAudioConfig.crypto.valid) {
         mPrivate->mAudioIterator = new SampleIterator(index);
       }
     } else if (!mPrivate->mVideo.get() && !strncmp(mimeType, "video/", 6)) {
       sp<MediaSource> track = e->getTrack(i);
       if (track->start() != OK) {
         return false;
       }
       mPrivate->mVideo = track;
       mVideoConfig.Update(metaData, mimeType);
       nsRefPtr<Index> index = new Index(mPrivate->mVideo->exportIndex(),
                                         mSource, mVideoConfig.mTrackId, mMonitor);
       mPrivate->mIndexes.AppendElement(index);
-      if (index->IsFragmented()) {
+      if (index->IsFragmented() && !mVideoConfig.crypto.valid) {
         mPrivate->mVideoIterator = new SampleIterator(index);
       }
     }
   }
   sp<MetaData> metaData = e->getMetaData();
   mCrypto.Update(metaData);
 
   return mPrivate->mAudio.get() || mPrivate->mVideo.get();