Commit 04350657 authored by xhwang's avatar xhwang Committed by Commit bot

media: Only unregister a CDM when it has been registered.

A CDM is registered after it's succussfully created (so the CDM ID is valid).
Check the CDM ID to decide whether we need to unregister it.

Review URL: https://codereview.chromium.org/1603413004

Cr-Commit-Position: refs/heads/master@{#370786}
parent 43b45a5c
......@@ -91,9 +91,12 @@ MojoCdmService::MojoCdmService(
}
MojoCdmService::~MojoCdmService() {
if (cdm_id_ == CdmContext::kInvalidCdmId)
return;
g_cdm_manager.Get().UnregisterCdm(cdm_id_);
if (cdm_id_ != CdmContext::kInvalidCdmId && context_)
if (context_)
context_->UnregisterCdm(cdm_id_);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment