From 92118c2129ec8175665e65dcd78c1400fbe60c80 Mon Sep 17 00:00:00 2001 From: nyanmisaka Date: Sun, 29 Nov 2020 22:46:26 +0800 Subject: [PATCH] allow to extract music bitrate info from formatInfo --- MediaBrowser.MediaEncoding/Probing/ProbeResultNormalizer.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/MediaBrowser.MediaEncoding/Probing/ProbeResultNormalizer.cs b/MediaBrowser.MediaEncoding/Probing/ProbeResultNormalizer.cs index 97d61441cf..27bd693e33 100644 --- a/MediaBrowser.MediaEncoding/Probing/ProbeResultNormalizer.cs +++ b/MediaBrowser.MediaEncoding/Probing/ProbeResultNormalizer.cs @@ -778,7 +778,11 @@ namespace MediaBrowser.MediaEncoding.Probing } } - if (bitrate == 0 && formatInfo != null && !string.IsNullOrEmpty(formatInfo.BitRate) && stream.Type == MediaStreamType.Video) + // The bitrate info of FLAC musics and some videos is included in formatInfo. + if (bitrate == 0 + && formatInfo != null + && !string.IsNullOrEmpty(formatInfo.BitRate) + && (stream.Type == MediaStreamType.Video || stream.Type == MediaStreamType.Audio)) { // If the stream info doesn't have a bitrate get the value from the media format info if (int.TryParse(formatInfo.BitRate, NumberStyles.Any, _usCulture, out var value))