- int pad_size;
-
- pad_size = (CONFIG_ROCKCHIP_MAX_SPL_SIZE + 0x7ff) / 0x800 * 0x800;
- params->orig_file_size = pad_size;
+ int padding = rkcommon_vrec_header(params, tparams, RK_INIT_SIZE_ALIGN);
+ /*
+ * The file size has not been adjusted at this point (our caller will
+ * eventually add the header/padding to the file_size), so we need to
+ * add up the header_size, file_size and padding ourselves.
+ */
+ int padded_size = tparams->header_size + params->file_size + padding;