[FragmentedSampleReader] Check default_isProtected before add senc #1710
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
PR #1688 introduced a kind of workaround to add SENC box when missing
this caused a kind of problem with smoothstreaming
smoothstreaming as usual is a bit shitting format
since dont have initialization segment a custom MOOV box is created manually from
inputstream.adaptive/src/common/AdaptiveUtils.cpp
Lines 76 to 78 in c77b406
the problem is a bit wide, i think that FragmentedSampleReader code can be potentially improved
but its impossible to me make a good code cleanup and or a better fix
since atm i dont have at my hand all streams that i can use to test all use cases
this part of code is as cat and mice
inputstream.adaptive/src/samplereader/FragmentedSampleReader.cpp
Lines 391 to 409 in c77b406
we need to check for missing SENC before call
AP4_CencSampleInfoTable::Create
to prevent that Create method to failsbut on Issue thread the smoothstreaming (playready) manifest converted to widevine, must not use
CAdaptiveCencSampleDecrypter
,since the video stream of the Issue dont have SAIZ/SAIO/SENC, SENC is so created,
and if i understand correctly this seem to prevent the use of widevine decrypter from
CFragmentedSampleReader::ReadSample()
as kind of solution i have set TENC
default_isProtected
parameter to 0 that means "not encrypted", this is not so clean solution, but i have no better ideas atm since i have no way to make tests for each use caseanyway TENC
default_isProtected
parameter is not so important to bento4 source code, and also we dont have code that depends from it, then should be a kind of solution that at least does not produce side effectsSidenote: TENC
default_isProtected
on bento4 allow to have values different from 0 and 1, its weird,looks like bento4
default_isProtected
param support is a sort of custom implementation that dont follow the MP4 standardat least im not able to find similar specs
Motivation and context
fix #1708
How has this been tested?
user tested his SS video
and some segments are here IssueSegments.zip
another use case is from sample provided by PR #1688
Screenshots (if appropriate):
Types of change
Checklist: