If the codec hasn't even been fully initialized, calling these functions in the shutdown code could cause a crash.