|
From: Tapio V. <aa...@us...> - 2010-08-21 14:02:15
|
Module: performous
Branch: joinmenu
Commit: b1e1ce75226efc39966c30ce01747642c9b1934c
Author: Lasse Karkkainen <tro...@tr...>
Date: Tue Aug 17 01:00:39 2010 +0300
Avoid spawning Ffmpeg objects for empty filenames
---
game/audio.cc | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/game/audio.cc b/game/audio.cc
index bfba389..7cd15f7 100644
--- a/game/audio.cc
+++ b/game/audio.cc
@@ -75,6 +75,7 @@ public:
typedef std::map<std::string,std::string> Files;
Music(Files const& filenames, unsigned int sr, bool preview): srate(sr), m_pos(), m_syncTime(getTime()), m_preview(preview), fadeLevel(), fadeRate() {
for (Files::const_iterator it = filenames.begin(), end = filenames.end(); it != end; ++it) {
+ if (it->second.empty()) continue; // Skip tracks with no filenames; FIXME: Why do we even have those here, shouldn't they be eliminated earlier?
tracks.insert(it->first, std::auto_ptr<Track>(new Track(it->second, sr)));
}
}
|