Skip to content

Commit

Permalink
Reset mixer and element before Refresh
Browse files Browse the repository at this point in the history
This fixes an issue when Refresh fails but the mixer or element is still
pointing to the old address.

Bug: b/201413038
Test: None
Change-Id: Ic7f8d88d1c4c911e81756785455a84ec92c6c814
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3739406
Reviewed-by: Kenneth MacKay <kmackay@chromium.org>
Commit-Queue: Mingyu Kang <kenkangxgwe@google.com>
Cr-Commit-Position: refs/heads/main@{#1019905}
  • Loading branch information
kenkangxgwe authored and Chromium LUCI CQ committed Jul 1, 2022
1 parent 0bfa6d2 commit 70a05b7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion chromecast/media/cma/backend/alsa/scoped_alsa_mixer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ void ScopedAlsaMixer::Refresh() {
LOG(INFO) << "Opening mixer element \"" << mixer_element_name_
<< "\" on device \"" << mixer_device_name_ << "\"";
}

mixer = nullptr;
element = nullptr;
int alsa_err = alsa_->MixerOpen(&mixer, 0);
if (alsa_err < 0) {
LOG(ERROR) << "MixerOpen error: " << alsa_->StrError(alsa_err);
Expand Down

0 comments on commit 70a05b7

Please sign in to comment.