-
Notifications
You must be signed in to change notification settings - Fork 78
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
WAVE: RF64, extended MIME type support, and bug fixes #308
Conversation
The WAVE module can now recognize, read, and validate RF64 files up to 9.22 exabytes in size, support chunks with extended chunk sizes, and files with large sample counts.
- The module can now recognize the subformat GUIDs for PCM and other WAVEFORMAT codecs, allowing them to be identified and interpreted correctly. - Subformat GUIDs are now shown in their standard form instead of as arrays of bytes. - Profile verification for BWF files has been simplified and some code comments clarified.
Setting the format and MIME type information has been moved to after the format signature has been verified to prevent the module from characterizing all files as WAVE files. The MIME type has also been extended to include WAVE codec ID's per RFC 2361.
Fixes an issue where unexpected null data at the end of a chunk could leave the parser at an invalid position to read any subsequent chunks.
Hi, is the requirement of Java 8 mandatory ? Maybe a requirement for java 7 would be enough. In any case, a quick survey is needed before going to java 8... |
The requirement comes from the use of Java 8's new unsigned-operation methods, such as |
676b4fb
to
880dce4
Compare
880dce4
to
f4e1726
Compare
We now verify the amount of bytes skipped using InputStream's `available` method to see how many bytes it's possible to skip beforehand. To support these changes, the `available` method has been implemented for JHOVE's InputStream classes where required, namely RAFInputStream.
- Expanded WAVE example corpora to cover more tests - New check to verify existence of Data chunks - New check to verify Format chunks appear before Data chunks - Improved truncation detection and reporting
ChunkStart values were being reported as BlockStart values, BlockStart values were being reported as SampleOffset values, and SampleOffset values were missing from the report entirely. All values are now reported correctly.
The required Java 8 method `Long.compareUnsigned` has been copied into the WAVE module where it was needed, with a caveat that it should be replaced once Java 8 support has been approved.
f4e1726
to
1757a1c
Compare
The requirement for Java 8 has now been removed, reverting compatibility to Java 6. |
Thanks. Very much appreciated |
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.
We should chat briefly about JHOVE formatting.
} | ||
|
||
private void init () | ||
private void init() |
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.
Super pernickety and I have no good answer but the constructor above is corrected with the open bracket alongside the declaration (correct IMO) but for init just the spacing is corrected. Sorry take that back, mis-read the above and spent too much time recently working through JHOVE's inconsistent spacing / formatting issues.
("tcf:frames", Integer.toString (duration.getFrames ()))); | ||
Long.toString (duration.getSeconds ()))); | ||
_writer.println (margn2 + element ("tcf:frames", | ||
Long.toString (duration.getFrames ()))); |
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.
Mixed spacing by the looks
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.
Oh yeah, the *Handler files are a mess with white-space inconsistencies, even with tabs and spaces on the same line at times, or switching every handful of lines. I originally attempted to fix it, but there was just too much.
The half tabs and half spaces is actually consistent with the code's surrounding lines, which you can see by slowly highlighting line 4370 above.
_writer.println (margn3 + "NumberOfSamples: " + | ||
Integer.toString (start.getSamples ())); | ||
_writer.println (margn3 + "NumberOfSamples: " + | ||
Long.toString (start.getSamples ())); |
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.
Mixed spacing on this and the next four changes from Integer to Long.
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.
Yeah, I probably should have matched the spacing with the line directly above instead of the line beneath, but this is one of those areas that is already in a sea of inconsistencies.
@@ -4378,7 +4378,7 @@ private void writeAESTimeRange (String baseIndent, | |||
_writer.println (margn2 + elementStart ("tcf:samples", | |||
sampleAttrs)); | |||
_writer.println (margn3 + element ("tcf:numberOfSamples", | |||
Integer.toString (duration.getSamples ()) )); | |||
Long.toString (duration.getSamples ()) )); |
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.
Mixed spacing.
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.
A pre-existing issue.
mapLoc[0] = "LEFT"; | ||
mapLoc[1] = "RIGHT"; | ||
break; | ||
|
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.
Mixed spacing.
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.
Looks the same to me... Should we not indent switch cases?
} | ||
for (int i = 0; i < numChannels; i++) { | ||
mapLoc[i] = "UNKNOWN"; | ||
} |
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.
Mixed spacing.
Codecov Report
@@ Coverage Diff @@
## integration #308 +/- ##
=================================================
+ Coverage 43.57% 44.45% +0.87%
- Complexity 3333 3415 +82
=================================================
Files 367 368 +1
Lines 30193 30318 +125
Branches 5976 5994 +18
=================================================
+ Hits 13158 13478 +320
+ Misses 14631 14430 -201
- Partials 2404 2410 +6
Continue to review full report at Codecov.
|
audio/vnd.wave; codec=1
, as per RFC 236100000001-0000-0010-8000-00AA00389B71
, instead of as an array of byte valuesCloses #184 and fixes #278.