From 5e837a61739e0da01c76c2b7ceb6a9dda491d34f Mon Sep 17 00:00:00 2001 From: amtins Date: Sat, 12 Aug 2023 14:22:01 +0200 Subject: [PATCH] refactor(stream-inf): uses the parseResolution function to extract a resolution object --- src/parse-stream.js | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/src/parse-stream.js b/src/parse-stream.js index 8f7fcc2..9556212 100644 --- a/src/parse-stream.js +++ b/src/parse-stream.js @@ -319,16 +319,7 @@ export default class ParseStream extends Stream { event.attributes = parseAttributes(match[1]); if (event.attributes.RESOLUTION) { - const split = event.attributes.RESOLUTION.split('x'); - const resolution = {}; - - if (split[0]) { - resolution.width = parseInt(split[0], 10); - } - if (split[1]) { - resolution.height = parseInt(split[1], 10); - } - event.attributes.RESOLUTION = resolution; + event.attributes.RESOLUTION = parseResolution(event.attributes.RESOLUTION); } if (event.attributes.BANDWIDTH) { event.attributes.BANDWIDTH = parseInt(event.attributes.BANDWIDTH, 10);