Display shorter names for all audio codecs

This commit is contained in:
Rafostar
2020-09-10 21:32:12 +02:00
parent b446fb943e
commit 1fdbf09cbd

View File

@@ -151,9 +151,12 @@ class ClapperInterface extends Gtk.Grid
case GstPlayer.PlayerAudioInfo: case GstPlayer.PlayerAudioInfo:
type = 'audio'; type = 'audio';
let codec = info.get_codec(); let codec = info.get_codec();
// This one is too long to fit nicely in UI if(codec.includes('(')) {
if(codec.startsWith('Free Lossless Audio Codec')) codec = codec.substring(
codec = 'FLAC'; codec.indexOf('(') + 1,
codec.indexOf(')')
);
}
text = info.get_language() || 'Unknown'; text = info.get_language() || 'Unknown';
text += ', ' + codec + ', ' text += ', ' + codec + ', '
+ info.get_channels() + ' Channels'; + info.get_channels() + ' Channels';