Play Movie - don't crash on headers with duplicate keys, don't throw an exception when movie files to parse

This commit is contained in:
adelikat 2014-04-13 23:18:45 +00:00
parent bca069325b
commit a6944c47d8
2 changed files with 5 additions and 2 deletions

View File

@ -174,7 +174,7 @@ namespace BizHawk.Client.Common
BoardProperties.Add(boardSplit[0], boardSplit[1]);
}
}
else if (HeaderKeys.Contains(splitLine[0]))
else if (HeaderKeys.Contains(splitLine[0]) && !this.ContainsKey(splitLine[0]))
{
Add(splitLine[0], splitLine[1]);
}

View File

@ -136,9 +136,11 @@ namespace BizHawk.Client.EmuHawk
private void PreLoadMovieFile(HawkFile hf, bool force)
{
var movie = new Movie(hf.CanonicalFullPath);
movie.PreLoadText(hf);
try
{
movie.PreLoadText(hf);
// Don't do this from browse
if (movie.Header[HeaderKeys.GAMENAME] == Global.Game.Name ||
Global.Config.PlayMovie_MatchGameName == false || force)
@ -148,6 +150,7 @@ namespace BizHawk.Client.EmuHawk
}
catch (Exception ex)
{
// TODO: inform the user that a movie failed to parse in some way
Console.WriteLine(ex.Message);
}
}