Fix(record): correct MJPEG upside-down playback

and remove 0-byte AVI residue on encoder open failure
This commit is contained in:
yuanyuanxiang
2026-05-23 12:09:14 +02:00
parent 99fc15ae41
commit 92bf9c9ccb
5 changed files with 17 additions and 7 deletions

View File

@@ -1911,6 +1911,7 @@ void CScreenSpyDlg::OnSysCommand(UINT nID, LPARAM lParam)
FCCHandler handler = nID == IDM_SAVEAVI ? ENCODER_MJPEG : ENCODER_H264;
int code;
if (code = m_aviStream.Open(m_aviFile, m_BitmapInfor_Full, rate, handler)) {
DeleteFile(m_aviFile); // 删除 AVIFileOpen 残留的 0 字节文件
MessageBoxL(CString("Create Video(*.avi) Failed:\n") + m_aviFile + "\r\n" + _TR("错误代码: ") +
CBmpToAvi::GetErrMsg(code).c_str(), "提示", MB_ICONINFORMATION);
m_aviFile = _T("");