From 997fd01ed69f1505880ff9913e176e7012ab8c0a Mon Sep 17 00:00:00 2001 From: sr55 Date: Sat, 5 May 2012 21:07:17 +0000 Subject: WinGui: Fix an issue importing SRT subs. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4644 b64f7644-9d1e-0410-96f1-a4d463321fa5 --- win/CS/Controls/Subtitles.cs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'win/CS/Controls') diff --git a/win/CS/Controls/Subtitles.cs b/win/CS/Controls/Subtitles.cs index 88e97b7fb..a31c941b7 100644 --- a/win/CS/Controls/Subtitles.cs +++ b/win/CS/Controls/Subtitles.cs @@ -417,7 +417,15 @@ namespace Handbrake.Controls SrtFileName = srtFile }; - track.SubtitleType = ((Subtitle)drp_subtitleTracks.SelectedItem).SubtitleType; + Subtitle subtitle = drp_subtitleTracks.SelectedItem as Subtitle; + if (subtitle != null) + { + track.SubtitleType = ((Subtitle)drp_subtitleTracks.SelectedItem).SubtitleType; + } + else if (drp_subtitleTracks.SelectedItem != null && drp_subtitleTracks.SelectedItem.ToString().Contains(".srt")) + { + track.SubtitleType = SubtitleType.SRT; + } if (currentOutputExtension.Equals("mp4", StringComparison.InvariantCultureIgnoreCase) || currentOutputExtension.Equals("m4v", StringComparison.CurrentCultureIgnoreCase)) -- cgit v1.2.3