MCPcopy Create free account
hub / github.com/Nevcairiel/LAVFilters / Decrypt

Method Decrypt

common/DSUtilLite/DeCSS/DeCSSInputPin.cpp:46–73  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

44}
45
46void CDeCSSPinHelper::Decrypt(IMediaSample *pSample)
47{
48 long len = pSample->GetActualDataLength();
49
50 BYTE *p = nullptr;
51 if (SUCCEEDED(pSample->GetPointer(&p)) && len > 0)
52 {
53 if (m_mt.majortype == MEDIATYPE_DVD_ENCRYPTED_PACK && len == 2048 && (p[0x14] & 0x30))
54 {
55 CSSdescramble(p, m_TitleKey);
56 p[0x14] &= ~0x30;
57
58 IMediaSample2 *pMS2 = nullptr;
59 if (SUCCEEDED(pSample->QueryInterface(&pMS2)) && pMS2)
60 {
61 AM_SAMPLE2_PROPERTIES props;
62 memset(&props, 0, sizeof(props));
63 if (SUCCEEDED(pMS2->GetProperties(sizeof(props), (BYTE *)&props)) &&
64 (props.dwTypeSpecificFlags & AM_UseNewCSSKey))
65 {
66 props.dwTypeSpecificFlags &= ~AM_UseNewCSSKey;
67 pMS2->SetProperties(sizeof(props), (BYTE *)&props);
68 }
69 pMS2->Release();
70 }
71 }
72 }
73}
74
75void CDeCSSPinHelper::StripPacket(BYTE *&p, long &len)
76{

Callers

nothing calls this directly

Calls 8

SUCCEEDEDFunction · 0.85
CSSdescrambleFunction · 0.85
GetPropertiesMethod · 0.80
GetActualDataLengthMethod · 0.45
GetPointerMethod · 0.45
QueryInterfaceMethod · 0.45
SetPropertiesMethod · 0.45
ReleaseMethod · 0.45

Tested by

no test coverage detected