Skip to content

Commit

Permalink
Fix mp4 conversion error where no video metaData exists (#579)
Browse files Browse the repository at this point in the history
  • Loading branch information
gadyaari authored Feb 12, 2018
1 parent 0020b8a commit dd5b10d
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions lib/entry/FlavorDownloader.js
Original file line number Diff line number Diff line change
Expand Up @@ -393,15 +393,17 @@ var FlavorDownloader = (function() {
}

function diagnosticsPushData(mp4Data) {
this.mediaInfo.resolution = mp4Data.metaData.resolution;
this.mediaInfo.bitrate_kbps = mp4Data.metaData.bitrate_kbps;
this.mediaInfo.frameRate = mp4Data.metaData.framerate;
if (this.mediaInfo.actualFramerateArray.length === numOfFrameRateSamples) {
this.mediaInfo.actualFramerateArray.shift();
if (mp4Data.video && mp4Data.ts_info.video) {
this.mediaInfo.resolution = mp4Data.metaData.resolution;
this.mediaInfo.frameRate = mp4Data.metaData.framerate;
if (this.mediaInfo.actualFramerateArray.length === numOfFrameRateSamples) {
this.mediaInfo.actualFramerateArray.shift();
}
this.mediaInfo.actualFramerateArray.push(+(mp4Data.ts_info.video.frameCount / (mp4Data.ts_info.video.duration / 1000)).toFixed(decimalDigitsCount));
this.mediaInfo.keyFramesDistance = mp4Data.metaData.keyFrameDistance;
}
this.mediaInfo.actualFramerateArray.push(+(mp4Data.ts_info.video.frameCount / (mp4Data.ts_info.video.duration / 1000)).toFixed(decimalDigitsCount));
this.mediaInfo.bitrate_kbps = mp4Data.metaData.bitrate_kbps;
this.mediaInfo.lastChunkName = mp4Data.chunkName;
this.mediaInfo.keyFramesDistance = mp4Data.metaData.keyFrameDistance;
this.mediaInfo.drift = this.playlistGenerator.driftInfo[this.flavor];
}

Expand Down

0 comments on commit dd5b10d

Please sign in to comment.