From 94c5eab776d70dfd26d842e40824115da17a2433 Mon Sep 17 00:00:00 2001 From: "Avi Halachmi (:avih)" Date: Sun, 20 Sep 2015 19:20:56 +0300 Subject: [PATCH] GSdx: capture dialog - actually remember the last used codec Previously it was saving the display name to the config but trying to restore according to the friendly name. Now store and restore according to the "displayName" which is more unique than "friendlyName" since it includes GUID[s], and handle it consistently as _bstr_t. --- plugins/GSdx/GSCaptureDlg.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/plugins/GSdx/GSCaptureDlg.cpp b/plugins/GSdx/GSCaptureDlg.cpp index c7b1415448..7c34743f6f 100644 --- a/plugins/GSdx/GSCaptureDlg.cpp +++ b/plugins/GSdx/GSCaptureDlg.cpp @@ -64,7 +64,7 @@ void GSCaptureDlg::OnInit() m_codecs.clear(); - string selected = theApp.GetConfig("CaptureVideoCodecDisplayName", ""); + _bstr_t selected = theApp.GetConfig("CaptureVideoCodecDisplayName", "").c_str(); ComboBoxAppend(IDC_CODECS, "Uncompressed", 0, true); @@ -110,7 +110,7 @@ void GSCaptureDlg::OnInit() string s(c.FriendlyName.begin(), c.FriendlyName.end()); - ComboBoxAppend(IDC_CODECS, s.c_str(), (LPARAM)&m_codecs.back(), s == selected); + ComboBoxAppend(IDC_CODECS, s.c_str(), (LPARAM)&m_codecs.back(), c.DisplayName == selected); } EndEnumSysDev } @@ -199,9 +199,7 @@ bool GSCaptureDlg::OnCommand(HWND hWnd, UINT id, UINT code) if (ris != 2) { - wstring s = wstring(c.DisplayName); - - theApp.SetConfig("CaptureVideoCodecDisplayName", string(s.begin(), s.end()).c_str()); + theApp.SetConfig("CaptureVideoCodecDisplayName", c.DisplayName); } else {