diff options
Merge branch 'master' of ssh://opensimulator.org/var/git/opensim
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/ClientStack/Linden/UDP/J2KImage.cs | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/J2KImage.cs b/OpenSim/Region/ClientStack/Linden/UDP/J2KImage.cs index e9e2dca..cb9692a 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/J2KImage.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/J2KImage.cs | |||
@@ -56,9 +56,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
56 | public IAssetService AssetService; | 56 | public IAssetService AssetService; |
57 | public UUID AgentID; | 57 | public UUID AgentID; |
58 | public IInventoryAccessModule InventoryAccessModule; | 58 | public IInventoryAccessModule InventoryAccessModule; |
59 | public OpenJPEG.J2KLayerInfo[] Layers; | 59 | private OpenJPEG.J2KLayerInfo[] m_layers; |
60 | public bool IsDecoded; | 60 | public bool IsDecoded { get; private set; } |
61 | public bool HasAsset; | 61 | public bool HasAsset { get; private set; } |
62 | public C5.IPriorityQueueHandle<J2KImage> PriorityQueueHandle; | 62 | public C5.IPriorityQueueHandle<J2KImage> PriorityQueueHandle; |
63 | 63 | ||
64 | private uint m_currentPacket; | 64 | private uint m_currentPacket; |
@@ -170,14 +170,14 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
170 | if (DiscardLevel >= 0 || m_stopPacket == 0) | 170 | if (DiscardLevel >= 0 || m_stopPacket == 0) |
171 | { | 171 | { |
172 | // This shouldn't happen, but if it does, we really can't proceed | 172 | // This shouldn't happen, but if it does, we really can't proceed |
173 | if (Layers == null) | 173 | if (m_layers == null) |
174 | { | 174 | { |
175 | m_log.Warn("[J2KIMAGE]: RunUpdate() called with missing Layers. Canceling texture transfer"); | 175 | m_log.Warn("[J2KIMAGE]: RunUpdate() called with missing Layers. Canceling texture transfer"); |
176 | m_currentPacket = m_stopPacket; | 176 | m_currentPacket = m_stopPacket; |
177 | return; | 177 | return; |
178 | } | 178 | } |
179 | 179 | ||
180 | int maxDiscardLevel = Math.Max(0, Layers.Length - 1); | 180 | int maxDiscardLevel = Math.Max(0, m_layers.Length - 1); |
181 | 181 | ||
182 | // Treat initial texture downloads with a DiscardLevel of -1 a request for the highest DiscardLevel | 182 | // Treat initial texture downloads with a DiscardLevel of -1 a request for the highest DiscardLevel |
183 | if (DiscardLevel < 0 && m_stopPacket == 0) | 183 | if (DiscardLevel < 0 && m_stopPacket == 0) |
@@ -187,9 +187,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
187 | DiscardLevel = (sbyte)Math.Min(DiscardLevel, maxDiscardLevel); | 187 | DiscardLevel = (sbyte)Math.Min(DiscardLevel, maxDiscardLevel); |
188 | 188 | ||
189 | //Calculate the m_stopPacket | 189 | //Calculate the m_stopPacket |
190 | if (Layers.Length > 0) | 190 | if (m_layers.Length > 0) |
191 | { | 191 | { |
192 | m_stopPacket = (uint)GetPacketForBytePosition(Layers[(Layers.Length - 1) - DiscardLevel].End); | 192 | m_stopPacket = (uint)GetPacketForBytePosition(m_layers[(m_layers.Length - 1) - DiscardLevel].End); |
193 | //I don't know why, but the viewer seems to expect the final packet if the file | 193 | //I don't know why, but the viewer seems to expect the final packet if the file |
194 | //is just one packet bigger. | 194 | //is just one packet bigger. |
195 | if (TexturePacketCount() == m_stopPacket + 1) | 195 | if (TexturePacketCount() == m_stopPacket + 1) |
@@ -341,7 +341,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
341 | 341 | ||
342 | private void J2KDecodedCallback(UUID AssetId, OpenJPEG.J2KLayerInfo[] layers) | 342 | private void J2KDecodedCallback(UUID AssetId, OpenJPEG.J2KLayerInfo[] layers) |
343 | { | 343 | { |
344 | Layers = layers; | 344 | m_layers = layers; |
345 | IsDecoded = true; | 345 | IsDecoded = true; |
346 | RunUpdate(); | 346 | RunUpdate(); |
347 | } | 347 | } |
@@ -385,8 +385,11 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
385 | string assetServerURL = string.Empty; | 385 | string assetServerURL = string.Empty; |
386 | if (InventoryAccessModule.IsForeignUser(AgentID, out assetServerURL)) | 386 | if (InventoryAccessModule.IsForeignUser(AgentID, out assetServerURL)) |
387 | { | 387 | { |
388 | m_log.DebugFormat("[J2KIMAGE]: texture {0} not found in local asset storage. Trying user's storage.", id); | 388 | if (!assetServerURL.EndsWith("/") && !assetServerURL.EndsWith("=")) |
389 | AssetService.Get(assetServerURL + "/" + id, InventoryAccessModule, AssetReceived); | 389 | assetServerURL = assetServerURL + "/"; |
390 | |||
391 | m_log.DebugFormat("[J2KIMAGE]: texture {0} not found in local asset storage. Trying user's storage.", assetServerURL + id); | ||
392 | AssetService.Get(assetServerURL + id, InventoryAccessModule, AssetReceived); | ||
390 | return; | 393 | return; |
391 | } | 394 | } |
392 | } | 395 | } |