readfile: Disable delayed data reading for compressed blend files master
authorCampbell Barton <ideasman42@gmail.com>
Sun, 24 Feb 2019 01:47:48 +0000 (12:47 +1100)
committerCampbell Barton <ideasman42@gmail.com>
Sun, 24 Feb 2019 01:47:48 +0000 (12:47 +1100)
Seeking gzip files is very slow, disable it.

Resolves T61880

source/blender/blenloader/intern/readfile.c

index b04fa5d..6fc96c8 100644 (file)
@@ -1156,12 +1156,6 @@ static int fd_read_gzip_from_file(FileData *filedata, void *buffer, uint size)
        return (readsize);
 }
 
-static off_t fd_seek_gzip_from_file(FileData *filedata, off_t offset, int whence)
-{
-       filedata->file_offset = gzseek(filedata->gzfiledes, offset, whence);
-       return filedata->file_offset;
-}
-
 /* Memory reading. */
 
 static int fd_read_from_memory(FileData *filedata, void *buffer, uint size)
@@ -1328,8 +1322,8 @@ static FileData *blo_filedata_from_file_open(const char *filepath, ReportList *r
                        return NULL;
                }
                else {
+                       /* 'seek_fn' is too slow for gzip, don't set it. */
                        read_fn = fd_read_gzip_from_file;
-                       seek_fn = fd_seek_gzip_from_file;
                }
        }