summaryrefslogtreecommitdiffstats
path: root/dom/media/fmp4/MP4Demuxer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'dom/media/fmp4/MP4Demuxer.cpp')
-rw-r--r--dom/media/fmp4/MP4Demuxer.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/dom/media/fmp4/MP4Demuxer.cpp b/dom/media/fmp4/MP4Demuxer.cpp
index a871d73b9..646897468 100644
--- a/dom/media/fmp4/MP4Demuxer.cpp
+++ b/dom/media/fmp4/MP4Demuxer.cpp
@@ -349,11 +349,11 @@ MP4TrackDemuxer::GetNextSample()
if (sample->mCrypto.mValid) {
nsAutoPtr<MediaRawDataWriter> writer(sample->CreateWriter());
writer->mCrypto.mMode = mInfo->mCrypto.mMode;
- writer->mCrypto.mIVSize = mInfo->mCrypto.mIVSize;
- // The length of the key will be zero if no key was specified in the sample
- // information, meaning we should fall back to the default key.
+ // Only use the default key parsed from the moov if we haven't already got
+ // one from the sample group description.
if (writer->mCrypto.mKeyId.Length() == 0) {
+ writer->mCrypto.mIVSize = mInfo->mCrypto.mIVSize;
writer->mCrypto.mKeyId.AppendElements(mInfo->mCrypto.mKeyId);
}
}