-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add various file sanity checks #13871
Conversation
Are you able to trim the test videos/files down to be 100kb or less? Will require a force push as well. Rationale is to avoid bloating the git repository for the sake of test data alone. |
Co-authored-by: Salman Ahmed <frenzibyte@gmail.com>
Good call, forgot videos can be quite heavy. |
Going to block this as a personal reminder that it needs to be rebased/force-pushed before merge. |
@Naxesss have you looked into the linux test failures on these? likely bass related. |
Just looked at them now and I'm not really sure what's going on. I also think it's very likely bass related. Ideally I'd just tell the user that they failed parsing the audio, but since I get the same error code regardless of successfully finding no audio or failing to parse existing audio, that's not going to work (as far as I tested earlier anyway). The way Mapset Verifier handles this is using a separate library called |
@smoogipoo when you find a moment can you take a look at this and see if you have any quick ideas/thoughts? curious if the issue repros locally. |
Not @smoogipoo but this does reproduce locally on linux. The video with audio in question has a MPEG-4 AAC audio track, which is not supported on linux without installing extra software. Docs of
Installing that still doesn't make the test pass, though. Unsure why is that, as BASS docs above claim that system-wide fallbacks will be tried after its internal codecs/plugins. |
It's weird to be relying on system libraries in the first place. |
If it's the video check which is failing, can we potentially use the existing |
I've had a very quick and dirty look at whether And even with that I did not test how this would behave on other platforms. |
To bump this, I think using taglib is a good direction. I seem to recall seeing a recent c# (managed) project which does similar things to taglib, but can't seem to find it today. |
The audio-in-video check now uses TagLib-Sharp instead of ManagedBass, and that seems to work on Linux given the CI results. Also makes the code more readable and handles exceptions better. Had to add a |
Because the Stream object is accessed when the mocked object calls `GetStream`, we cannot close it here. The resource should be released upon teardown anyway.
We need the Stream to stay open here because `StreamFileAbstraction` uses it later in the block.
This will need testing on android |
I've refactored the disposal to be in line with expectations. We generally avoid leaving disposal to finalizers ever. |
Willing to go test android, just didn't manage to get to it in time today. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approving pending android testing for merge.
Have tested android on two devices and it doesn't crash, but I did spot a rather elementary oversight (storyboard is not null checked in one of the checks). Doesn't crash but it's ugly. Will be pushing a fix for it shortly. |
Actually, on a re-check, it's more of a problem with
This happens because osu/osu.Game/Beatmaps/WorkingBeatmapCache.cs Lines 194 to 200 in 47b6fb0
I think that scenario can be fixed separately? It's kinda orthogonal to the implementation of the check and will be failing everywhere else if someone tries to access a storyboard of an unsaved beatmap. I'm going to tentatively approve this on that basis, but I am definitely interested in @peppy's opinion on this as well. |
let's open an issue and fix post realm |
Makes further progress on #12091
Note: The below code is used in both
CheckAudioInVideo
andCheckTooShortAudioFiles
. I tried declaring a function inIWorkingBeatmap
and implementing it inWorkingBeatmap
, but something to do with theMock<TestWorkingBeatmap>
inheritance/setup caused a few of the tests to fail and I still haven't managed to figure out why, so ended up undoing that.The verify tab now detects 0-byte files, audio tracks in video files, and too short audio files. This saves the time needed to otherwise open the properties and audio of each individual file to check for these Ranking Criteria violations.