From 512dcfac01d5395855cf2aff96ecd62ededb05aa Mon Sep 17 00:00:00 2001 From: trav90 Date: Wed, 25 Jul 2018 22:37:39 -0500 Subject: [EME] Add support for sbgp and sgpd boxes in the traf box --- dom/media/fmp4/MP4Demuxer.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'dom/media') diff --git a/dom/media/fmp4/MP4Demuxer.cpp b/dom/media/fmp4/MP4Demuxer.cpp index 70b176699..a871d73b9 100644 --- a/dom/media/fmp4/MP4Demuxer.cpp +++ b/dom/media/fmp4/MP4Demuxer.cpp @@ -350,7 +350,12 @@ MP4TrackDemuxer::GetNextSample() nsAutoPtr writer(sample->CreateWriter()); writer->mCrypto.mMode = mInfo->mCrypto.mMode; writer->mCrypto.mIVSize = mInfo->mCrypto.mIVSize; - writer->mCrypto.mKeyId.AppendElements(mInfo->mCrypto.mKeyId); + + // 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. + if (writer->mCrypto.mKeyId.Length() == 0) { + writer->mCrypto.mKeyId.AppendElements(mInfo->mCrypto.mKeyId); + } } return sample.forget(); } -- cgit v1.2.3 From 165a8d5057687bbcfc14ccdc084579372faf9860 Mon Sep 17 00:00:00 2001 From: trav90 Date: Wed, 25 Jul 2018 22:39:12 -0500 Subject: [EME] Add support for sbgp and sgpd boxes occuring in the sampletable --- dom/media/fmp4/MP4Demuxer.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'dom/media') 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 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); } } -- cgit v1.2.3