diff --git a/src/BizHawk.Client.Common/QuickBmpFile.cs b/src/BizHawk.Client.Common/QuickBmpFile.cs index 1fc6b34378..602451f3c4 100644 --- a/src/BizHawk.Client.Common/QuickBmpFile.cs +++ b/src/BizHawk.Client.Common/QuickBmpFile.cs @@ -333,5 +333,7 @@ namespace BizHawk.Client.Common s.Write(dst, 0, dst.Length); } + + public readonly bool LoadAuto(Stream s, out IVideoProvider vp) => Load(vp = new LoadedBMP(), s); } } diff --git a/src/BizHawk.Client.Common/movie/tasproj/TasBranch.cs b/src/BizHawk.Client.Common/movie/tasproj/TasBranch.cs index 0d05158424..5d3195bfb1 100644 --- a/src/BizHawk.Client.Common/movie/tasproj/TasBranch.cs +++ b/src/BizHawk.Client.Common/movie/tasproj/TasBranch.cs @@ -240,16 +240,14 @@ namespace BizHawk.Client.Common bl.GetLump(nframebuffer, true, delegate(Stream s, long length) { - var vp = new QuickBmpFile.LoadedBMP(); - QuickBmpFile.Load(vp, s); - b.OSDFrameBuffer = new BitmapBuffer(vp.BufferWidth, vp.BufferHeight, vp.VideoBuffer); + QuickBmpFile.LoadAuto(s, out var vp); + b.OSDFrameBuffer = new BitmapBuffer(vp.BufferWidth, vp.BufferHeight, vp.GetVideoBuffer()); }); bl.GetLump(ncoreframebuffer, false, delegate(Stream s, long length) { - var vp = new QuickBmpFile.LoadedBMP(); - QuickBmpFile.Load(vp, s); - b.CoreFrameBuffer = new BitmapBuffer(vp.BufferWidth, vp.BufferHeight, vp.VideoBuffer); + QuickBmpFile.LoadAuto(s, out var vp); + b.CoreFrameBuffer = new BitmapBuffer(vp.BufferWidth, vp.BufferHeight, vp.GetVideoBuffer()); }); b.Markers = new TasMovieMarkerList(movie);