Commits

Chris Klimas  committed ff8b85b

Don't cache decoders for long songs

Seems to cause glitches, see
http://love2d.org/forums/viewtopic.php?f=4&t=11571&p=72219#p72219

  • Participants
  • Parent commits 0373d13

Comments (0)

Files changed (1)

File zoetrope/core/cached.lua

 
 		local realPath = self:_absolutePath(path)
 
-		if not self._library.sound[realPath] then
-			if length == 'short' then
+		if length == 'short' then
+			if not self._library.sound[realPath] then
 				self._library.sound[realPath] = love.sound.newSoundData(realPath)
-			elseif length == 'long' then
-				self._library.sound[realPath] = love.sound.newDecoder(realPath)
-			else
-				error('length must be either "short" or "long"')
 			end
+
+			return self._library.sound[path]
+		elseif length == 'long' then
+			return love.sound.newDecoder(realPath)
+		else
+			error('length must be either "short" or "long"')
 		end
-
-		return self._library.sound[path]
 	end,
 
 	-- Method: font