解决视频编码可能出现空白项的问题

croire 3 years ago
parent 9df0a74fe2
commit 062bb81589

@ -165,7 +165,10 @@ namespace DownKyi.Services
if (videoQualityExist == null) if (videoQualityExist == null)
{ {
List<string> videoCodecList = new List<string>(); List<string> videoCodecList = new List<string>();
if (codecName != string.Empty)
{
ListHelper.AddUnique(videoCodecList, codecName); ListHelper.AddUnique(videoCodecList, codecName);
}
VideoQuality videoQuality = new VideoQuality() VideoQuality videoQuality = new VideoQuality()
{ {
@ -178,10 +181,13 @@ namespace DownKyi.Services
else else
{ {
if (!videoQualityList[videoQualityList.IndexOf(videoQualityExist)].VideoCodecList.Exists(t => t.Equals(codecName))) if (!videoQualityList[videoQualityList.IndexOf(videoQualityExist)].VideoCodecList.Exists(t => t.Equals(codecName)))
{
if (codecName != string.Empty)
{ {
videoQualityList[videoQualityList.IndexOf(videoQualityExist)].VideoCodecList.Add(codecName); videoQualityList[videoQualityList.IndexOf(videoQualityExist)].VideoCodecList.Add(codecName);
} }
} }
}
// 设置选中的视频编码 // 设置选中的视频编码
VideoQuality selectedVideoQuality = videoQualityList.FirstOrDefault(t => t.Quality == video.Id); VideoQuality selectedVideoQuality = videoQualityList.FirstOrDefault(t => t.Quality == video.Id);

Loading…
Cancel
Save