From a01cc058cd134c3622a14a5f5d2131c7b90007d0 Mon Sep 17 00:00:00 2001 From: Rafostar <40623528+Rafostar@users.noreply.github.com> Date: Thu, 10 Sep 2020 21:41:58 +0200 Subject: [PATCH] Do not display video FPS when unavailable Do not try to display video FPS inside video tracks selection popover button. The FPS value can be zero for example when viewing pictures. --- clapper_src/interface.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/clapper_src/interface.js b/clapper_src/interface.js index 736b3541..fb73e447 100644 --- a/clapper_src/interface.js +++ b/clapper_src/interface.js @@ -142,11 +142,13 @@ class ClapperInterface extends Gtk.Grid switch(info.constructor) { case GstPlayer.PlayerVideoInfo: type = 'video'; - let fps = info.get_framerate(); text = info.get_codec() + ', ' + + info.get_width() + 'x' - + info.get_height() + '@' - + Number((fps[0] / fps[1]).toFixed(2)); + + info.get_height(); + let fps = info.get_framerate(); + fps = Number((fps[0] / fps[1]).toFixed(2)); + if(fps) + text += `@${fps}`; break; case GstPlayer.PlayerAudioInfo: type = 'audio';