Explorar el Código

Library: fixed corner-case where a thumbnail was created but failed to be displayed

Felix Paul Kühne hace 12 años
padre
commit
3e11eaac93
Se han modificado 2 ficheros con 10 adiciones y 0 borrados
  1. 5 0
      AspenProject/VLCPlaylistGridView.m
  2. 5 0
      AspenProject/VLCPlaylistTableViewCell.m

+ 5 - 0
AspenProject/VLCPlaylistGridView.m

@@ -131,6 +131,11 @@
                 [_thumbnailCacheIndex removeObject:objID];
                 [_thumbnailCacheIndex insertObject:objID atIndex:0];
                 displayedImage = [_thumbnailCache objectForKey:objID];
+                if (!displayedImage) {
+                    displayedImage = mediaObject.computedThumbnail;
+                    if (displayedImage)
+                        [_thumbnailCache setObject:displayedImage forKey:objID];
+                }
             } else {
                 if (_thumbnailCacheIndex.count >= MAX_CACHE_SIZE) {
                     [_thumbnailCache removeObjectForKey:[_thumbnailCacheIndex lastObject]];

+ 5 - 0
AspenProject/VLCPlaylistTableViewCell.m

@@ -114,6 +114,11 @@
                 [_thumbnailCacheIndex removeObject:objID];
                 [_thumbnailCacheIndex insertObject:objID atIndex:0];
                 displayedImage = [_thumbnailCache objectForKey:objID];
+                if (!displayedImage) {
+                    displayedImage = mediaObject.computedThumbnail;
+                    if (displayedImage)
+                        [_thumbnailCache setObject:displayedImage forKey:objID];
+                }
             } else {
                 if (_thumbnailCacheIndex.count >= MAX_CACHE_SIZE) {
                     [_thumbnailCache removeObjectForKey:[_thumbnailCacheIndex lastObject]];