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.
This commit is contained in:
Rafostar
2020-09-10 21:41:58 +02:00
parent 1fdbf09cbd
commit a01cc058cd

View File

@@ -142,11 +142,13 @@ class ClapperInterface extends Gtk.Grid
switch(info.constructor) { switch(info.constructor) {
case GstPlayer.PlayerVideoInfo: case GstPlayer.PlayerVideoInfo:
type = 'video'; type = 'video';
let fps = info.get_framerate();
text = info.get_codec() + ', ' + text = info.get_codec() + ', ' +
+ info.get_width() + 'x' + info.get_width() + 'x'
+ info.get_height() + '@' + info.get_height();
+ Number((fps[0] / fps[1]).toFixed(2)); let fps = info.get_framerate();
fps = Number((fps[0] / fps[1]).toFixed(2));
if(fps)
text += `@${fps}`;
break; break;
case GstPlayer.PlayerAudioInfo: case GstPlayer.PlayerAudioInfo:
type = 'audio'; type = 'audio';