Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

matroska-subtitles

Package Overview
Dependencies
Maintainers
1
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

matroska-subtitles - npm Package Compare versions

Comparing version 2.0.1 to 2.0.2

22

index.js

@@ -15,5 +15,5 @@ const Writable = require('stream').Writable

var currentTrack = null
var currentSubtitleBlock = null
var currentClusterTimecode = null
let currentTrack = null
let currentSubtitleBlock = null
let currentClusterTimecode = null

@@ -34,3 +34,3 @@ this.decoder = new ebml.Decoder()

var self = this
const self = this

@@ -58,3 +58,3 @@ function _onMetaData (chunk) {

if (SUBTITLE_TYPES.includes(currentTrack.CodecID)) {
var track = {
const track = {
number: currentTrack.TrackNumber,

@@ -93,8 +93,8 @@ language: currentTrack.Language,

if (chunk[1].name === 'Block') {
var block = ebmlBlock(chunk[1].data)
const block = ebmlBlock(chunk[1].data)
if (self.subtitleTracks.has(block.trackNumber)) {
var type = self.subtitleTracks.get(block.trackNumber).type
const type = self.subtitleTracks.get(block.trackNumber).type
var subtitle = {
const subtitle = {
text: block.frames[0].toString('utf8'),

@@ -106,9 +106,9 @@ time: (block.timecode + currentClusterTimecode) * self.timecodeScale

// extract SSA/ASS keys
var values = subtitle.text.split(',')
const values = subtitle.text.split(',')
// ignore read-order, and skip layer if ssa
var i = type === 'ssa' ? 2 : 1
const i = type === 'ssa' ? 2 : 1
for (; i < 9; i++) {
subtitle[ASS_KEYS[i]] = values[i]
}
// re-append extra text that might have been splitted
// re-append extra text that might have been split
for (i = 9; i < values.length; i++) {

@@ -115,0 +115,0 @@ subtitle.text += ',' + values[i]

{
"name": "matroska-subtitles",
"version": "2.0.1",
"version": "2.0.2",
"description": "Writable stream for parsing embedded .mkv subtitles.",

@@ -5,0 +5,0 @@ "main": "index.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc