Browse Source

use new attribute helpers

this also fixes an incorrectly generated IV value problem
Gil Pedersen 11 years ago
parent
commit
281d38844f
2 changed files with 3 additions and 4 deletions
  1. 2 3
      lib/recorder.js
  2. 1 1
      package.json

+ 2 - 3
lib/recorder.js

@@ -52,7 +52,7 @@ HlsStreamRecorder.prototype.updateIndex = function(update) {
       if (!isNaN(this.startOffset)) {
         var offset = this.startOffset;
         if (offset < 0) offset = Math.min(offset, -3 * this.target_duration);
-        this.index.start = { offset: offset };
+        this.index.start.decimalInteger('offset', offset);
       }
     } else {
       debug('programs', this.index.programs);
@@ -121,8 +121,7 @@ HlsStreamRecorder.prototype.process = function(obj, next) {
 
   // manually set iv if sequence based, since we generate our own sequence numbering 
   if (segment.key && !segment.key.iv) {
-    var seqStr = obj.seq.toString();
-    segment.key.iv = '0x00000000000000000000000000000000'.slice(-seqStr.length) + seqStr;
+    segment.key.hexadecimalInteger('iv', obj.seq);
     if (this.index.version > 2) {
       this.index.version = 2;
       debug('changed index version to:', this.index.version);

+ 1 - 1
package.json

@@ -30,7 +30,7 @@
     "commander": "~1.1.1",
     "debug": "~0.7.0",
     "deep-equal": "0.0.0",
-    "m3u8parse": "^0.1.7",
+    "m3u8parse": "^0.1.8",
     "measured": "~0.1.3",
     "mime": "^1.2.11",
     "oncemore": "~0.1.0",