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:
type = 'audio';
let codec = info.get_codec();
// This one is too long to fit nicely in UI
if(codec.startsWith('Free Lossless Audio Codec'))
codec = 'FLAC';
if(codec.includes('(')) {
codec = codec.substring(
codec.indexOf('(') + 1,
codec.indexOf(')')
);
}
text = info.get_language() || 'Unknown';
text += ', ' + codec + ', '
+ info.get_channels() + ' Channels';