Browse Source

SoundSample::SetChunkStream: Log filename on error

pull/5679/head
Gleb Mazovetskiy 3 years ago
parent
commit
f20c58c8a0
  1. 4
      Source/utils/soundsample.cpp

4
Source/utils/soundsample.cpp

@ -117,7 +117,7 @@ int SoundSample::SetChunkStream(std::string filePath, bool isMp3, bool logErrors
SDL_RWops *handle = OpenAssetAsSdlRwOps(filePath.c_str(), /*threadsafe=*/true);
if (handle == nullptr) {
if (logErrors)
LogError(LogCategory::Audio, "OpenAsset failed (from SoundSample::SetChunkStream): {}", SDL_GetError());
LogError(LogCategory::Audio, "OpenAsset failed (from SoundSample::SetChunkStream) for {}: {}", filePath, SDL_GetError());
return -1;
}
file_path_ = std::move(filePath);
@ -126,7 +126,7 @@ int SoundSample::SetChunkStream(std::string filePath, bool isMp3, bool logErrors
if (!stream_->open()) {
stream_ = nullptr;
if (logErrors)
LogError(LogCategory::Audio, "Aulib::Stream::open (from SoundSample::SetChunkStream): {}", SDL_GetError());
LogError(LogCategory::Audio, "Aulib::Stream::open (from SoundSample::SetChunkStream) for {}: {}", file_path_, SDL_GetError());
return -1;
}
return 0;

Loading…
Cancel
Save