From c89bb3d030ac1a87b3ed95e36073d2a426cdac4e Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Fri, 2 Mar 2018 13:41:44 -0700 Subject: [PATCH] openal: "reattempt" -> "retry" --- panda/src/audiotraits/config_openalAudio.cxx | 16 ++++++++-------- panda/src/audiotraits/config_openalAudio.h | 2 +- panda/src/audiotraits/openalAudioManager.cxx | 12 ++++++------ 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/panda/src/audiotraits/config_openalAudio.cxx b/panda/src/audiotraits/config_openalAudio.cxx index 36803e7d04..a3340477c2 100644 --- a/panda/src/audiotraits/config_openalAudio.cxx +++ b/panda/src/audiotraits/config_openalAudio.cxx @@ -30,21 +30,21 @@ ConfigVariableString openal_device PRC_DESC("Specify the OpenAL device string for audio playback (no quotes). If this " "is not specified, the OpenAL default device is used.")); -ConfigVariableInt openal_buffer_delete_reattempts -("openal-buffer-delete-reattempts", 5, +ConfigVariableInt openal_buffer_delete_retries +("openal-buffer-delete-retries", 5, PRC_DESC("If deleting a buffer fails due to still being in use, the OpenAL " - "sound plugin will wait a moment and reattempt deletion, with an " - "exponentially-increasing delay for each attempt. This number " - "specifies how many repeat attempts (not counting the initial attempt) " + "sound plugin will wait a moment and retry deletion, with an " + "exponentially-increasing delay for each try. This number " + "specifies how many repeat tries (not counting the initial try) " "should be made before giving up and raising an error.")); ConfigVariableDouble openal_buffer_delete_delay ("openal-buffer-delete-delay", 0.001, PRC_DESC("If deleting a buffer fails due to still being in use, the OpenAL " - "sound plugin will wait a moment and reattempt deletion, with an " - "exponentially-increasing delay for each attempt. This number " + "sound plugin will wait a moment and retry deletion, with an " + "exponentially-increasing delay for each try. This number " "specifies how long, in seconds, the OpenAL plugin will wait after " - "its first failed attempt. The second attempt will be double this " + "its first failed try. The second try will be double this " "delay, the third quadruple, and so on.")); diff --git a/panda/src/audiotraits/config_openalAudio.h b/panda/src/audiotraits/config_openalAudio.h index 96d3429519..6817362e31 100644 --- a/panda/src/audiotraits/config_openalAudio.h +++ b/panda/src/audiotraits/config_openalAudio.h @@ -26,7 +26,7 @@ extern "C" EXPCL_OPENAL_AUDIO void init_libOpenALAudio(); extern "C" EXPCL_OPENAL_AUDIO Create_AudioManager_proc *get_audio_manager_func_openal_audio(); extern ConfigVariableString openal_device; -extern ConfigVariableInt openal_buffer_delete_reattempts; +extern ConfigVariableInt openal_buffer_delete_retries; extern ConfigVariableDouble openal_buffer_delete_delay; #endif // CONFIG_OPENALAUDIO_H diff --git a/panda/src/audiotraits/openalAudioManager.cxx b/panda/src/audiotraits/openalAudioManager.cxx index bc254d4791..f093aae8b6 100644 --- a/panda/src/audiotraits/openalAudioManager.cxx +++ b/panda/src/audiotraits/openalAudioManager.cxx @@ -1140,7 +1140,7 @@ discard_excess_cache(int sample_limit) { void OpenALAudioManager:: delete_buffer(ALuint buffer) { ReMutexHolder holder(_lock); - int attempt = 0; + int tries = 0; ALuint error; // Keep trying until we succeed (or give up). @@ -1154,13 +1154,13 @@ delete_buffer(ALuint buffer) { } else if (error != AL_INVALID_OPERATION) { // We weren't expecting that. This should be reported. break; - } else if (attempt >= openal_buffer_delete_reattempts.get_value()) { - // We ran out of reattempts. Give up. + } else if (tries >= openal_buffer_delete_retries.get_value()) { + // We ran out of retries. Give up. break; } else { - // Make another attempt after (delay * 2^n) seconds. - Thread::sleep(openal_buffer_delete_delay.get_value() * (1 << attempt)); - attempt++; + // Make another try after (delay * 2^n) seconds. + Thread::sleep(openal_buffer_delete_delay.get_value() * (1 << tries)); + tries++; } }