Commit 20d01be1 authored by Max Kellermann's avatar Max Kellermann

input/mms: use class ScopeUnlock

parent d6b62d75
......@@ -51,16 +51,14 @@ protected:
void
MmsInputStream::Open()
{
Unlock();
{
const ScopeUnlock unlock(mutex);
mms = mmsx_connect(nullptr, nullptr, GetURI(), 128 * 1024);
if (mms == nullptr) {
Lock();
throw std::runtime_error("mmsx_connect() failed");
mms = mmsx_connect(nullptr, nullptr, GetURI(), 128 * 1024);
if (mms == nullptr)
throw std::runtime_error("mmsx_connect() failed");
}
Lock();
/* TODO: is this correct? at least this selects the ffmpeg
decoder, which seems to work fine */
SetMimeType("audio/x-ms-wma");
......
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