Skip to content

Commit

Permalink
[Widevine] DecodeVideo: fix unencrypted packets
Browse files Browse the repository at this point in the history
  • Loading branch information
peak3d committed Mar 26, 2020
1 parent fe54cc5 commit 2de39b3
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions wvdecrypter/wvdecrypter.cpp
Expand Up @@ -1285,12 +1285,12 @@ SSD_DECODE_RETVAL WV_CencSingleSampleDecrypter::DecodeVideo(void* hostInstance,
cdm_in.iv = sample->iv;
cdm_in.iv_size = sample->iv ? 16 : 0;
cdm_in.timestamp = sample->pts;
cdm_in.encryption_scheme = cdm::EncryptionScheme::kCenc;
cdm_in.encryption_scheme = sample->kid ? cdm::EncryptionScheme::kCenc : cdm::EncryptionScheme::kUnencrypted;
cdm_in.pattern = { 0,0 };

uint8_t unencryptedKID = 0x31;
cdm_in.key_id = sample->kid ? sample->kid : &unencryptedKID;
cdm_in.key_id_size = sample->kid ? 16 : 1;
uint8_t unencryptedKID [] = { 0 };
cdm_in.key_id = sample->kid ? sample->kid : unencryptedKID;
cdm_in.key_id_size = sample->kid ? 16 : 0;

if (sample->dataSize)
drained_ = false;
Expand All @@ -1313,7 +1313,7 @@ SSD_DECODE_RETVAL WV_CencSingleSampleDecrypter::DecodeVideo(void* hostInstance,
{
if (ret == cdm::Status::kNoKey)
{
char buf[36]; buf[32] = 0;
char buf[36]; buf[0] = buf[32] = 0;
AP4_FormatHex(cdm_in.key_id, cdm_in.key_id_size, buf);
Log(SSD_HOST::LL_ERROR, "DecodeVideo: kNoKey for key %s", buf);
return VC_EOF;
Expand Down

0 comments on commit 2de39b3

Please sign in to comment.