Open Sora-yx opened 7 months ago
There are a few things that can be done:
Compiling our own version of FFMPEG could help reduce file size of the avcodec, avformat and avutil DLLs, but it probably won't help reduce the number of DLLs, and figuring out how to compile it is not easy. I don't know if merging everything into a single DLL is realistic, but if the goal is just to have fewer files we could put the DLLs in archives and unpack them on mod loader startup or something.
As for something that could be done right now:
1) It would be nice if the dependencies installer/updater used a single window for all dependencies (like when updating multiple mods) instead of creating a new window for each dependency. This would make the process seem faster and less distracting.
2) There are a lot of places in the UI when the Manager sits there doing nothing because of Task.Delay()
, which makes mod and loader installation feel slower. These delays could be shortened (ideally removed) on release builds, and only enabled on debug builds or under some specific conditions for testing purposes, like when holding the Shift key.
Yeah, I plan to merge the installation of the dependencies in a single task, but it's gonna take a bit since the class wasn't made with multiple downloads in mind. As for Task.Delay, it's been a while so I don't recall why they got implemented, but I can probably reduce or remove some.
As for moving to 7z, one issue is all the previous versions of the Manager will continue to look for the zip link, which would force us to have both the zip and 7z version hosted and I'm not super fan of that, but I don't think there is any other solution sadly, unless there is a way to redirect the link.
Meanwhile FFMPEG gets implemented, we can probably implement the manifest already since I think the most important part is to not re download the dependencies every time.
I was able to rework bass_vgmstream and its vgmstream submodule to reuse the same avutil, avcodec, avformat and swresample DLLs as those required for the FFMPEG player. avcodec and avformat DLLs are much larger than vgmstream-exclusive DLLs but at least we won't need two sets of DLLs anymore.
More progress: I recompiled vgmstream
and bass_vgmstream
to use the latest FFMPEG 7.1 DLLs (XP compatible build, audio confirmed working on XP), so we can now use the latest versions of FFMPEG DLLs for both the video and audio players.
I've also disabled support for the following in vgmstream
and bass_vgmstream
:
libg719_decode
(music from Namco games) - freed one DLLLibAtrac9
(format of PS4 and Vita music) - freed one DLLlibcelt
(.fsb and other related formats) - freed two DLLslibspeex
(voice format in some EA games) - freed one DLLTotal: -5 DLLs, -8 if you count shared avcodec
, avformat
etc. that are now reused
The BASS/FFMPEG dependencier folder looks like this:
The FFMPEG video player will require swscale
(already there in the screenshot) and the sadx-ffmpeg-player
DLL, so that's 11 DLLs in total. 15MB at maximum 7Z compression without the player DLL.
Another idea: we could merge sadx-ffmpeg-player
with bass_vgmstream
and use a single DLL for the ModLoader to play both video and audio. That would make it 10 DLLs in total.
I made some changes to the "SADX" version of bass_vgmstream and built a version without libspeex.dll
, libatrac9.dll
, libcelt-0061.dll
, libcelt-0110.dll
and libg719_decode.dll
. It works with vgmstream's custom FFMPEG DLLs and is ready to be used with the current version of the Mod Loader.
Also got rid of jansson.dll
which is no longer used.
Very nice, this will become much more manageable.
As for moving to 7z, one issue is all the previous versions of the Manager will continue to look for the zip link, which would force us to have both the zip and 7z version hosted and I'm not super fan of that, but I don't think there is any other solution sadly, unless there is a way to redirect the link.
Now that I learned that the archive is shipped inside the Manager's EXE, this point doesn't make sense to me.
Currently the dependencies have two issues:
Possible Solution:
Ideally, I'd love to be able to do the last solution with BASS, as I don't like how it requires 14 DLLs alone, but sadly merging them would be complicated.