Skip to content

Commit

Permalink
avoid deadlock when challenge is not present
Browse files Browse the repository at this point in the history
  • Loading branch information
skywojciechowskim committed Oct 24, 2024
1 parent 72f7050 commit 9fcb844
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions library/source/OpenCDMSessionPrivate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -207,9 +207,9 @@ bool OpenCDMSessionPrivate::getChallengeData(std::vector<uint8_t> &challengeData
return false;
}
std::unique_lock<std::mutex> lock{m_mutex};
m_challengeCv.wait(lock, [this]() { return !m_challengeData.empty(); });
m_challengeCv.wait_for(lock, std::chrono::seconds{1}, [this]() { return !m_challengeData.empty(); });
challengeData = m_challengeData;
return true;
return !challengeData.empty();
}

void OpenCDMSessionPrivate::addProtectionMeta(GstBuffer *buffer, GstBuffer *subSample, const uint32_t subSampleCount,
Expand Down

0 comments on commit 9fcb844

Please sign in to comment.