]> wimlib.net Git - wimlib/blobdiff - src/split.c
Rewrite of write_stream_list(), and writing packed resources
[wimlib] / src / split.c
index 167105eb47a68ec982741158624deb5956c92480..01bb75fc817f5ba3f211b659252e61c7c5750bf5 100644 (file)
@@ -148,8 +148,13 @@ add_stream_to_swm(struct wim_lookup_table_entry *lte, void *_swm_info)
        struct swm_info *swm_info = _swm_info;
        u64 stream_size;
 
-       /* TODO */
-       stream_size = lte->rspec->size_in_wim;
+       /* We want the compressed size of the stream, but use the uncompressed
+        * size if the compressed size is not available or not relevant.  */
+       if (lte->resource_location == RESOURCE_IN_WIM &&
+           (!lte_is_partial(lte) || lte->rspec->size_in_wim < lte->size))
+               stream_size = lte->rspec->size_in_wim;
+       else
+               stream_size = lte->size;
 
        /* - Start first part if no parts have been started so far;
         * - Start next part if adding this stream exceeds maximum part size,