From f90651b3c85890842dbe116745a786249c363063 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jernej=20Fija=C4=8Dko?= Date: Tue, 26 May 2015 14:40:32 +0200 Subject: [PATCH] Check if extradata exists before pushing it into tags --- src/h264-stream.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/h264-stream.js b/src/h264-stream.js index c09dbd57c..e122f1a92 100644 --- a/src/h264-stream.js +++ b/src/h264-stream.js @@ -80,7 +80,7 @@ // Check if keyframe and the length of tags. // This makes sure we write metadata on the first frame of a segment. - if (this._h264Frame.keyFrame || this.tags.length === 0) { + if (this._oldExtraData.extraDataExists() && (this._h264Frame.keyFrame || this.tags.length === 0)) { // Push extra data on every IDR frame in case we did a stream change + seek this.tags.push(this._oldExtraData.metaDataTag(this._h264Frame.pts)); this.tags.push(this._oldExtraData.extraDataTag(this._h264Frame.pts));