diff options
Diffstat (limited to 'modules/opus/audio_stream_opus.cpp')
-rw-r--r-- | modules/opus/audio_stream_opus.cpp | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/modules/opus/audio_stream_opus.cpp b/modules/opus/audio_stream_opus.cpp index 615081d818..43b0aecbf1 100644 --- a/modules/opus/audio_stream_opus.cpp +++ b/modules/opus/audio_stream_opus.cpp @@ -119,9 +119,7 @@ Error AudioStreamPlaybackOpus::_load_stream() { Error err; f = FileAccess::open(file, FileAccess::READ, &err); - if (err) { - ERR_FAIL_COND_V(err, err); - } + ERR_FAIL_COND_V_MSG(err, err, "Cannot open file '" + file + "'."); int _err = 0; @@ -185,9 +183,7 @@ Error AudioStreamPlaybackOpus::set_file(const String &p_file) { Error err; f = FileAccess::open(file, FileAccess::READ, &err); - if (err) { - ERR_FAIL_COND_V(err, err); - } + ERR_FAIL_COND_V_MSG(err, err, "Cannot open file '" + file + "'."); int _err; @@ -287,8 +283,7 @@ int AudioStreamPlaybackOpus::mix(int16_t *p_buffer, int p_frames) { int ret = op_read(opus_file, (opus_int16 *)p_buffer, todo * stream_channels, ¤t_section); if (ret < 0) { playing = false; - ERR_EXPLAIN("Error reading Opus File: " + file); - ERR_BREAK(ret < 0); + ERR_BREAK_MSG(ret < 0, "Error reading Opus file: " + file + "."); } else if (ret == 0) { // end of song, reload? op_free(opus_file); |