Commit c662576c authored by sigbjornf's avatar sigbjornf Committed by Commit bot

MediaStreamSource: verify unlocked state when finalizing.

To diagnose an audio thread crash condition, verify that the lock
over audio consumers that MediaStreamSource keeps, isn't held when it is
being finalized. If it is, then the audio thread is active using the
MediaStreamSource object..which is not a well-formed state to be in.

R=
BUG=682945

Review-Url: https://codereview.chromium.org/2741663004
Cr-Commit-Position: refs/heads/master@{#456029}
parent afaa76ff
......@@ -55,6 +55,13 @@ MediaStreamSource::MediaStreamSource(const String& id,
m_readyState(readyState),
m_requiresConsumer(requiresConsumer) {}
MediaStreamSource::~MediaStreamSource() {
// Verify that the audio thread isn't consuming audio.
// TODO(sof): remove once crbug.com/682945 has been diagnosed.
MutexTryLocker tryLocker(m_audioConsumersLock);
CHECK(tryLocker.locked());
}
void MediaStreamSource::setReadyState(ReadyState readyState) {
if (m_readyState != ReadyStateEnded && m_readyState != readyState) {
m_readyState = readyState;
......
......@@ -75,6 +75,8 @@ class PLATFORM_EXPORT MediaStreamSource final
ReadyState = ReadyStateLive,
bool requiresConsumer = false);
~MediaStreamSource();
const String& id() const { return m_id; }
StreamType type() const { return m_type; }
const String& name() const { return m_name; }
......
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