Commit b885f358 authored by Max Kellermann's avatar Max Kellermann

output/control: add missing nullptr checks

Fixes crash when pausing the default partition after an output was moved to another partition. Closes https://github.com/MusicPlayerDaemon/MPD/issues/1147
parent 650a30d7
...@@ -9,6 +9,7 @@ ver 0.22.7 (not yet released) ...@@ -9,6 +9,7 @@ ver 0.22.7 (not yet released)
* database * database
- simple: fix database corruption bug - simple: fix database corruption bug
* output * output
- fix crash when pausing with multiple partitions
- httpd: send header "Access-Control-Allow-Origin: *" - httpd: send header "Access-Control-Allow-Origin: *"
- wasapi: add algorithm for finding usable audio format - wasapi: add algorithm for finding usable audio format
- wasapi: use default device only if none was configured - wasapi: use default device only if none was configured
......
...@@ -118,7 +118,7 @@ AudioOutputControl::GetLogName() const noexcept ...@@ -118,7 +118,7 @@ AudioOutputControl::GetLogName() const noexcept
{ {
assert(!IsDummy()); assert(!IsDummy());
return output->GetLogName(); return output ? output->GetLogName() : name.c_str();
} }
Mixer * Mixer *
...@@ -364,7 +364,7 @@ AudioOutputControl::LockPlay() noexcept ...@@ -364,7 +364,7 @@ AudioOutputControl::LockPlay() noexcept
void void
AudioOutputControl::LockPauseAsync() noexcept AudioOutputControl::LockPauseAsync() noexcept
{ {
if (output->mixer != nullptr && !output->SupportsPause()) if (output && output->mixer != nullptr && !output->SupportsPause())
/* the device has no pause mode: close the mixer, /* the device has no pause mode: close the mixer,
unless its "global" flag is set (checked by unless its "global" flag is set (checked by
mixer_auto_close()) */ mixer_auto_close()) */
......
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