Skip to content

Commit ae75fc1

Browse files
committed
fix: fix virtual background
1 parent b539843 commit ae75fc1

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

windows/APIExample/APIExample/Advanced/RealTimeLiveBroadcasting/CAgoraRealtimeLiveBroadcastingDlg.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -785,6 +785,8 @@ void CAgoraRealtimeLiveBroadcastingDlg::SetVideoSource()
785785
{
786786
agora::rtc::VirtualBackgroundSource source;
787787
source.background_source_type = (agora::rtc::VirtualBackgroundSource::BACKGROUND_SOURCE_TYPE)m_cmbBackground.GetCurSel();
788+
CString filename;
789+
std::string s_filepath;
788790

789791
if (m_cmbBackground.GetCurSel() == 0) {
790792
m_staBackColor.ShowWindow(SW_HIDE);
@@ -810,15 +812,15 @@ void CAgoraRealtimeLiveBroadcastingDlg::SetVideoSource()
810812
m_btnImagePath.ShowWindow(SW_SHOW);
811813
m_edtImagePath.ShowWindow(SW_SHOW);
812814

813-
LPCTSTR lpszFilter = L"BMP Files|*.bmp|JPG Files|*.jpg|PNG Files|*.ong||";
815+
LPCTSTR lpszFilter = L"BMP Files|*.bmp|JPG Files|*.jpg|PNG Files|*.png||";
814816
CFileDialog dlg(TRUE, lpszFilter, NULL, OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT, lpszFilter, NULL);
815-
CString filename;
816817
CFile file;
817818
if (dlg.DoModal() == IDOK)
818819
{
819820
filename = dlg.GetPathName();
820821
m_edtImagePath.SetWindowText(filename);
821-
source.source = cs2utf8(filename).c_str();
822+
s_filepath = cs2utf8(filename);
823+
source.source = s_filepath.c_str();
822824
}
823825
}
824826

0 commit comments

Comments
 (0)