|
@@ -44,6 +44,11 @@ HlsStreamRecorder.prototype.updateIndex = function(update) {
|
|
|
if (!this.index) {
|
|
if (!this.index) {
|
|
|
this.index = new m3u8parse.M3U8Playlist(update);
|
|
this.index = new m3u8parse.M3U8Playlist(update);
|
|
|
if (!this.index.variant) {
|
|
if (!this.index.variant) {
|
|
|
|
|
+ if (this.index.version < 2) {
|
|
|
|
|
+ // version 2 is required to support the remapped IV attribute
|
|
|
|
|
+ this.index.version = 2;
|
|
|
|
|
+ debug('changed index version to:', this.index.version);
|
|
|
|
|
+ }
|
|
|
this.index.segments = [];
|
|
this.index.segments = [];
|
|
|
this.index.first_seq_no = self.seq;
|
|
this.index.first_seq_no = self.seq;
|
|
|
this.index.type = 'EVENT';
|
|
this.index.type = 'EVENT';
|
|
@@ -119,15 +124,6 @@ HlsStreamRecorder.prototype.process = function(obj, next) {
|
|
|
// create our own uri
|
|
// create our own uri
|
|
|
segment.uri = util.format('%s.%s', this.segmentName(this.seq), mime.extension(meta.mime));
|
|
segment.uri = util.format('%s.%s', this.segmentName(this.seq), mime.extension(meta.mime));
|
|
|
|
|
|
|
|
- // manually set iv if sequence based, since we generate our own sequence numbering
|
|
|
|
|
- if (segment.key && !segment.key.iv) {
|
|
|
|
|
- segment.key.hexadecimalInteger('iv', obj.seq);
|
|
|
|
|
- if (this.index.version > 2) {
|
|
|
|
|
- this.index.version = 2;
|
|
|
|
|
- debug('changed index version to:', this.index.version);
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
// save the stream segment
|
|
// save the stream segment
|
|
|
var stream = oncemore(obj.stream);
|
|
var stream = oncemore(obj.stream);
|
|
|
stream.pipe(fs.createWriteStream(path.join(this.dst, segment.uri)));
|
|
stream.pipe(fs.createWriteStream(path.join(this.dst, segment.uri)));
|