From 0c34c5f8a2a368b894f3f671c582557ea45dc62d Mon Sep 17 00:00:00 2001 From: sr55 Date: Sat, 7 Jan 2017 20:24:07 +0000 Subject: [PATCH] WinGui: Workaround a bug in libhb where if the audio track name == "", the engine crashes when initially writing the mp4 file. --- win/CS/HandBrakeWPF/Services/Encode/Factories/EncodeFactory.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/win/CS/HandBrakeWPF/Services/Encode/Factories/EncodeFactory.cs b/win/CS/HandBrakeWPF/Services/Encode/Factories/EncodeFactory.cs index 31f315f7e..a53996b0f 100644 --- a/win/CS/HandBrakeWPF/Services/Encode/Factories/EncodeFactory.cs +++ b/win/CS/HandBrakeWPF/Services/Encode/Factories/EncodeFactory.cs @@ -14,6 +14,7 @@ namespace HandBrakeWPF.Services.Encode.Factories using System.Globalization; using System.Linq; using System.Runtime.InteropServices; + using System.Runtime.InteropServices.ComTypes; using HandBrake.ApplicationServices.Interop; using HandBrake.ApplicationServices.Interop.HbLib; @@ -360,7 +361,7 @@ namespace HandBrakeWPF.Services.Encode.Factories Mixdown = mixdown != null ? mixdown.Id : -1, NormalizeMixLevel = false, Samplerate = sampleRate != null ? sampleRate.Rate : 0, - Name = item.TrackName, + Name = !string.IsNullOrEmpty(item.TrackName) ? item.TrackName : null, }; if (!item.IsPassthru) -- 2.40.0