music-metadata 8.1.2 → 8.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/lib/mp4/Atom.js +5 -2
  2. package/package.json +2 -2
package/lib/mp4/Atom.js CHANGED
@@ -1,5 +1,6 @@
1
1
  import initDebug from 'debug';
2
2
  import * as AtomToken from './AtomToken.js';
3
+ import { Header } from './AtomToken.js';
3
4
  const debug = initDebug('music-metadata:parser:MP4:Atom');
4
5
  export class Atom {
5
6
  static async readAtom(tokenizer, dataHandler, parent, remaining) {
@@ -52,8 +53,10 @@ export class Atom {
52
53
  return this.readAtoms(tokenizer, dataHandler, this.getPayloadLength(remaining));
53
54
  case 'meta': // Metadata Atom, ref: https://developer.apple.com/library/content/documentation/QuickTime/QTFF/Metadata/Metadata.html#//apple_ref/doc/uid/TP40000939-CH1-SW8
54
55
  // meta has 4 bytes of padding, ignore
55
- await tokenizer.ignore(4);
56
- return this.readAtoms(tokenizer, dataHandler, this.getPayloadLength(remaining) - 4);
56
+ const peekHeader = await tokenizer.peekToken(Header);
57
+ const paddingLength = peekHeader.name === 'hdlr' ? 0 : 4;
58
+ await tokenizer.ignore(paddingLength);
59
+ return this.readAtoms(tokenizer, dataHandler, this.getPayloadLength(remaining) - paddingLength);
57
60
  case 'mdhd': // Media header atom
58
61
  case 'mvhd': // 'movie' => 'mvhd': movie header atom; child of Movie Atom
59
62
  case 'tkhd':
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "music-metadata",
3
3
  "description": "Music metadata parser for Node.js, supporting virtual any audio and tag format.",
4
- "version": "8.1.2",
4
+ "version": "8.1.3",
5
5
  "author": {
6
6
  "name": "Borewit",
7
7
  "url": "https://github.com/Borewit"
@@ -105,7 +105,7 @@
105
105
  "@types/mocha": "^10.0.0",
106
106
  "@types/node": "^18.11.18",
107
107
  "@typescript-eslint/eslint-plugin": "^5.48.0",
108
- "@typescript-eslint/parser": "^5.48.0",
108
+ "@typescript-eslint/parser": "^5.48.1",
109
109
  "c8": "^7.12.0",
110
110
  "chai": "^4.3.7",
111
111
  "chai-as-promised": "^7.1.1",