Skip to content

Commit

Permalink
A couple more unit tests for matroska in codecs and update changelog …
Browse files Browse the repository at this point in the history
…for release.
  • Loading branch information
codedread committed Oct 20, 2023
1 parent bb0f403 commit 2d0bb47
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 0 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,15 @@

All notable changes to this project will be documented in this file.

## [1.1.4] - 2023-10-19

### Changed

- codecs: Add support for DTS audio codec and AV1 video codec.
- codecs: Update how Matroska video/audio files are detected (video/x-matroska).
[Issue #43](https://github.com/codedread/bitjs/issues/43)
- untar: Fix long path/filenames in 'ustar' format. [Issue #42](https://github.com/codedread/bitjs/issues/43)

## [1.1.3] - 2023-10-15

### Changed
Expand Down
32 changes: 32 additions & 0 deletions tests/codecs.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,21 @@ describe('codecs test suite', () => {
format: { format_name: 'matroska,webm' },
streams: [ { codec_type: 'video', codec_name: 'vp8' } ],
})).equals('video/webm');
expect(getShortMIMEString({
format: { format_name: 'matroska,webm' },
streams: [ { codec_type: 'video', codec_name: 'vp9' } ],
})).equals('video/webm');
expect(getShortMIMEString({
format: { format_name: 'matroska,webm' },
streams: [ { codec_type: 'video', codec_name: 'av1' } ],
})).equals('video/webm');
});

it('detects WEBM audio', () => {
expect(getShortMIMEString({
format: { format_name: 'matroska,webm' },
streams: [ { codec_type: 'audio', codec_name: 'opus' } ],
})).equals('audio/webm');
expect(getShortMIMEString({
format: { format_name: 'matroska,webm' },
streams: [ { codec_type: 'audio', codec_name: 'vorbis' } ],
Expand All @@ -129,9 +141,29 @@ describe('codecs test suite', () => {
format: { format_name: 'matroska,webm' },
streams: [ { codec_type: 'video', codec_name: 'h264' } ],
})).equals('video/x-matroska');

expect(getShortMIMEString({
format: { format_name: 'matroska,webm' },
streams: [
{ codec_type: 'audio', codec_name: 'aac' },
{ codec_type: 'video', codec_name: 'vp9' },
],
})).equals('video/x-matroska');

expect(getShortMIMEString({
format: { format_name: 'matroska,webm' },
streams: [
{ codec_type: 'audio', codec_name: 'vorbis' },
{ codec_type: 'video', codec_name: 'h264' },
],
})).equals('video/x-matroska');
});

it('detects Matroska audio', () => {
expect(getShortMIMEString({
format: { format_name: 'matroska,webm' },
streams: [ { codec_type: 'audio', codec_name: 'aac' } ],
})).equals('audio/x-matroska');
expect(getShortMIMEString({
format: { format_name: 'matroska,webm' },
streams: [ { codec_type: 'audio', codec_name: 'dts' } ],
Expand Down

0 comments on commit 2d0bb47

Please sign in to comment.