mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-03 10:22:45 -04:00
openal: assert -> nassert
This commit is contained in:
parent
c89bb3d030
commit
99dc462174
@ -524,7 +524,7 @@ get_sound(const string &file_name, bool positional, int mode) {
|
|||||||
void OpenALAudioManager::
|
void OpenALAudioManager::
|
||||||
uncache_sound(const string& file_name) {
|
uncache_sound(const string& file_name) {
|
||||||
ReMutexHolder holder(_lock);
|
ReMutexHolder holder(_lock);
|
||||||
assert(is_valid());
|
nassertv(is_valid());
|
||||||
Filename path = file_name;
|
Filename path = file_name;
|
||||||
|
|
||||||
VirtualFileSystem *vfs = VirtualFileSystem::get_global_ptr();
|
VirtualFileSystem *vfs = VirtualFileSystem::get_global_ptr();
|
||||||
@ -910,7 +910,7 @@ reduce_sounds_playing_to(unsigned int count) {
|
|||||||
int limit = _sounds_playing.size() - count;
|
int limit = _sounds_playing.size() - count;
|
||||||
while (limit-- > 0) {
|
while (limit-- > 0) {
|
||||||
SoundsPlaying::iterator sound = _sounds_playing.begin();
|
SoundsPlaying::iterator sound = _sounds_playing.begin();
|
||||||
assert(sound != _sounds_playing.end());
|
nassertv(sound != _sounds_playing.end());
|
||||||
// When the user stops a sound, there is still a PT in the user's hand.
|
// When the user stops a sound, there is still a PT in the user's hand.
|
||||||
// When we stop a sound here, however, this can remove the last PT. This
|
// When we stop a sound here, however, this can remove the last PT. This
|
||||||
// can cause an ugly recursion where stop calls the destructor, and the
|
// can cause an ugly recursion where stop calls the destructor, and the
|
||||||
@ -1111,8 +1111,8 @@ discard_excess_cache(int sample_limit) {
|
|||||||
|
|
||||||
while (((int)_expiring_samples.size()) > sample_limit) {
|
while (((int)_expiring_samples.size()) > sample_limit) {
|
||||||
SoundData *sd = (SoundData*)(_expiring_samples.front());
|
SoundData *sd = (SoundData*)(_expiring_samples.front());
|
||||||
assert(sd->_client_count == 0);
|
nassertv(sd->_client_count == 0);
|
||||||
assert(sd->_expire == _expiring_samples.begin());
|
nassertv(sd->_expire == _expiring_samples.begin());
|
||||||
_expiring_samples.pop_front();
|
_expiring_samples.pop_front();
|
||||||
_sample_cache.erase(_sample_cache.find(sd->_movie->get_filename()));
|
_sample_cache.erase(_sample_cache.find(sd->_movie->get_filename()));
|
||||||
audio_debug("Expiring: " << sd->_movie->get_filename().get_basename());
|
audio_debug("Expiring: " << sd->_movie->get_filename().get_basename());
|
||||||
@ -1121,8 +1121,8 @@ discard_excess_cache(int sample_limit) {
|
|||||||
|
|
||||||
while (((int)_expiring_streams.size()) > stream_limit) {
|
while (((int)_expiring_streams.size()) > stream_limit) {
|
||||||
SoundData *sd = (SoundData*)(_expiring_streams.front());
|
SoundData *sd = (SoundData*)(_expiring_streams.front());
|
||||||
assert(sd->_client_count == 0);
|
nassertv(sd->_client_count == 0);
|
||||||
assert(sd->_expire == _expiring_streams.begin());
|
nassertv(sd->_expire == _expiring_streams.begin());
|
||||||
_expiring_streams.pop_front();
|
_expiring_streams.pop_front();
|
||||||
audio_debug("Expiring: " << sd->_movie->get_filename().get_basename());
|
audio_debug("Expiring: " << sd->_movie->get_filename().get_basename());
|
||||||
delete sd;
|
delete sd;
|
||||||
|
@ -201,7 +201,7 @@ stop() {
|
|||||||
if (is_playing()) {
|
if (is_playing()) {
|
||||||
_manager->make_current();
|
_manager->make_current();
|
||||||
|
|
||||||
assert(has_sound_data());
|
nassertv(has_sound_data());
|
||||||
|
|
||||||
alGetError(); // clear errors
|
alGetError(); // clear errors
|
||||||
alSourceStop(_source);
|
alSourceStop(_source);
|
||||||
@ -290,7 +290,7 @@ restart_stalled_audio() {
|
|||||||
ALenum status;
|
ALenum status;
|
||||||
|
|
||||||
if (!is_valid()) return;
|
if (!is_valid()) return;
|
||||||
assert(is_playing());
|
nassertv(is_playing());
|
||||||
|
|
||||||
if (_stream_queued.size() == 0) {
|
if (_stream_queued.size() == 0) {
|
||||||
return;
|
return;
|
||||||
@ -310,7 +310,7 @@ void OpenALAudioSound::
|
|||||||
queue_buffer(ALuint buffer, int samples, int loop_index, double time_offset) {
|
queue_buffer(ALuint buffer, int samples, int loop_index, double time_offset) {
|
||||||
ReMutexHolder holder(OpenALAudioManager::_lock);
|
ReMutexHolder holder(OpenALAudioManager::_lock);
|
||||||
|
|
||||||
assert(is_playing());
|
nassertv(is_playing());
|
||||||
|
|
||||||
// Now push the buffer into the stream queue.
|
// Now push the buffer into the stream queue.
|
||||||
alGetError();
|
alGetError();
|
||||||
@ -336,7 +336,7 @@ ALuint OpenALAudioSound::
|
|||||||
make_buffer(int samples, int channels, int rate, unsigned char *data) {
|
make_buffer(int samples, int channels, int rate, unsigned char *data) {
|
||||||
ReMutexHolder holder(OpenALAudioManager::_lock);
|
ReMutexHolder holder(OpenALAudioManager::_lock);
|
||||||
|
|
||||||
assert(is_playing());
|
nassertr(is_playing(), 0);
|
||||||
|
|
||||||
// Allocate a buffer to hold the data.
|
// Allocate a buffer to hold the data.
|
||||||
alGetError();
|
alGetError();
|
||||||
@ -370,7 +370,7 @@ int OpenALAudioSound::
|
|||||||
read_stream_data(int bytelen, unsigned char *buffer) {
|
read_stream_data(int bytelen, unsigned char *buffer) {
|
||||||
ReMutexHolder holder(OpenALAudioManager::_lock);
|
ReMutexHolder holder(OpenALAudioManager::_lock);
|
||||||
|
|
||||||
assert(has_sound_data());
|
nassertr(has_sound_data(), 0);
|
||||||
|
|
||||||
MovieAudioCursor *cursor = _sd->_stream;
|
MovieAudioCursor *cursor = _sd->_stream;
|
||||||
double length = cursor->length();
|
double length = cursor->length();
|
||||||
@ -423,7 +423,7 @@ void OpenALAudioSound::
|
|||||||
correct_calibrated_clock(double rtc, double t) {
|
correct_calibrated_clock(double rtc, double t) {
|
||||||
ReMutexHolder holder(OpenALAudioManager::_lock);
|
ReMutexHolder holder(OpenALAudioManager::_lock);
|
||||||
|
|
||||||
assert(is_playing());
|
nassertv(is_playing());
|
||||||
|
|
||||||
double cc = (rtc - _calibrated_clock_base) * _calibrated_clock_scale;
|
double cc = (rtc - _calibrated_clock_base) * _calibrated_clock_scale;
|
||||||
double diff = cc-t;
|
double diff = cc-t;
|
||||||
@ -458,8 +458,8 @@ pull_used_buffers() {
|
|||||||
ReMutexHolder holder(OpenALAudioManager::_lock);
|
ReMutexHolder holder(OpenALAudioManager::_lock);
|
||||||
|
|
||||||
if (!is_valid()) return;
|
if (!is_valid()) return;
|
||||||
assert(is_playing());
|
nassertv(is_playing());
|
||||||
assert(has_sound_data());
|
nassertv(has_sound_data());
|
||||||
|
|
||||||
while (_stream_queued.size()) {
|
while (_stream_queued.size()) {
|
||||||
ALuint buffer = 0;
|
ALuint buffer = 0;
|
||||||
@ -517,8 +517,8 @@ push_fresh_buffers() {
|
|||||||
static unsigned char data[65536];
|
static unsigned char data[65536];
|
||||||
|
|
||||||
if (!is_valid()) return;
|
if (!is_valid()) return;
|
||||||
assert(is_playing());
|
nassertv(is_playing());
|
||||||
assert(has_sound_data());
|
nassertv(has_sound_data());
|
||||||
|
|
||||||
if (_sd->_sample) {
|
if (_sd->_sample) {
|
||||||
while ((_loops_completed < _playing_loops) &&
|
while ((_loops_completed < _playing_loops) &&
|
||||||
@ -545,7 +545,7 @@ push_fresh_buffers() {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
ALuint buffer = make_buffer(samples, channels, rate, data);
|
ALuint buffer = make_buffer(samples, channels, rate, data);
|
||||||
if (!is_valid()) return;
|
if (!is_valid() || !buffer) return;
|
||||||
queue_buffer(buffer, samples, loop_index, time_offset);
|
queue_buffer(buffer, samples, loop_index, time_offset);
|
||||||
if (!is_valid()) return;
|
if (!is_valid()) return;
|
||||||
fill += samples;
|
fill += samples;
|
||||||
@ -582,7 +582,7 @@ void OpenALAudioSound::
|
|||||||
cache_time(double rtc) {
|
cache_time(double rtc) {
|
||||||
ReMutexHolder holder(OpenALAudioManager::_lock);
|
ReMutexHolder holder(OpenALAudioManager::_lock);
|
||||||
|
|
||||||
assert(is_playing());
|
nassertv(is_playing());
|
||||||
|
|
||||||
double t=get_calibrated_clock(rtc);
|
double t=get_calibrated_clock(rtc);
|
||||||
double max = _length * _playing_loops;
|
double max = _length * _playing_loops;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user