Bug 1829437 - Fix GCC -Wuninitialized warnings in MediaTrackGraph r=azebrowski

Differential Revision: https://phabricator.services.mozilla.com/D176196
This commit is contained in:
Emily McDonough 2023-05-03 20:25:16 +00:00
parent 6f3ed0a25b
commit 7e415de1e8

View File

@ -3741,7 +3741,10 @@ class AudioContextOperationControlMessage : public ControlMessage {
void MediaTrackGraphImpl::ApplyAudioContextOperationImpl(
AudioContextOperationControlMessage* aMessage) {
MOZ_ASSERT(OnGraphThread());
AudioContextState state;
// Initialize state to zero. This silences a GCC warning about uninitialized
// values, because although the switch below initializes state for all valid
// enum values, the actual value could be any integer that fits in the enum.
AudioContextState state{0};
switch (aMessage->mAudioContextOperation) {
// Suspend and Close operations may be performed immediately because no
// specific kind of GraphDriver is required. CheckDriver() will schedule