From 81bf9d524b1a2ca43a0986272baa6382158876ed Mon Sep 17 00:00:00 2001 From: akarin Date: Thu, 31 Mar 2022 15:14:10 +0900 Subject: [PATCH] OKEGui/OKEGui/Task/AddTaskService.cs: check for incorrectly specified OutputCodec the field name is case sensitive (for the yaml deserializer). Updates AmusementClub/OKEGui#10. Signed-off-by: akarin --- OKEGui/OKEGui/Task/AddTaskService.cs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/OKEGui/OKEGui/Task/AddTaskService.cs b/OKEGui/OKEGui/Task/AddTaskService.cs index 13a1e5de..909808e5 100644 --- a/OKEGui/OKEGui/Task/AddTaskService.cs +++ b/OKEGui/OKEGui/Task/AddTaskService.cs @@ -168,6 +168,14 @@ public static TaskProfile ProcessJsonProfile(TaskProfile json, DirectoryInfo pro if (json.AudioTracks != null && json.AudioTracks.Count > 0) { + foreach (AudioInfo ai in json.AudioTracks) + { + if (string.IsNullOrWhiteSpace(ai.OutputCodec)) + { + MessageBox.Show("音轨未设置 OutputCodec,请检查大小写", "音轨编码错误", MessageBoxButton.OK, MessageBoxImage.Error); + return null; + } + } // 主音轨 json.AudioFormat = json.AudioTracks[0].OutputCodec; if (string.IsNullOrEmpty(json.AudioFormat))