Skip to content

Commit

Permalink
cras: Reorder cras_iodev_list stream_list_changed_cb
Browse files Browse the repository at this point in the history
Reorder stream_list_changed_cb to put
cras_speak_on_mute_detector_streams_changed in the last order. It is to
avoid crash because cras_speak_on_mute_detector_streams_changed can
delete an element from all_streams variable, making it to have an
invalid pointer.

BUG=b:367182967
TEST=tast run ${DUT} audio.CrasSpeakOnMuteDetection.rtc_stream_without_apm

Disallow-Recycled-Builds: tast-failures
Change-Id: I6a07e620f6c840ebc066ba49b53bdb745c14e19c
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/adhd/+/5872341
Reviewed-by: Curtis Malainey <cujomalainey@chromium.org>
Tested-by: chromeos-cop-builder@chromeos-cop.iam.gserviceaccount.com <chromeos-cop-builder@chromeos-cop.iam.gserviceaccount.com>
Auto-Submit: Norman Bintang <normanbt@chromium.org>
Reviewed-by: Li-Yu Yu <aaronyu@google.com>
Tested-by: Norman Bintang <normanbt@chromium.org>
Commit-Queue: Norman Bintang <normanbt@chromium.org>
  • Loading branch information
Norman Bintang committed Sep 23, 2024
1 parent 5b04a3b commit d041c02
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion cras/src/server/cras_iodev_list.c
Original file line number Diff line number Diff line change
Expand Up @@ -1548,10 +1548,12 @@ static bool can_use_dsp_input_effects(struct cras_rstream* all_streams) {
}

static int stream_list_changed_cb(struct cras_rstream* all_streams) {
cras_speak_on_mute_detector_streams_changed(all_streams);
cras_ewma_power_reporter_streams_changed(all_streams);
// TODO(eddyhsu): utilize multiple endpoint for DSP NC.
set_aec_on_dsp_is_disallowed(!can_use_dsp_input_effects(all_streams));
// TODO(b/368164769): Refactor cras_speak_on_mute_detector_streams_changed so
// it doesn't modify all_streams. Reference: b/367182967
cras_speak_on_mute_detector_streams_changed(all_streams);

return 0;
}
Expand Down

0 comments on commit d041c02

Please sign in to comment.