Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

添加自动循环播放的功能测试循环播放HEVC 4K视频会报错的问题 #67

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 17 additions & 13 deletions player-windows/testplayer/playerDlg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,8 @@ CplayerDlg::CplayerDlg(CWnd* pParent /*=NULL*/)
m_bYoloDetect = FALSE;
m_bMouseSelFlag = FALSE;
m_nCurMouseBtns = 0;

memset(m_strUrl, '\0', MAX_PATH);
Copy link
Owner

@rockcarry rockcarry Oct 28, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

建议修改为 strcpy(m_strUrl, ""); 设置为空字符串,这样含义更加明确。
缩进也不对,请使用四个空格进行缩进

}

void CplayerDlg::DoDataExchange(CDataExchange* pDX)
Expand All @@ -152,19 +154,20 @@ void CplayerDlg::PlayerOpenFile(TCHAR *file)
// kill player progress timer
KillTimer(TIMER_ID_PROGRESS);

// open file dialog
if (!file) {
if (dlg.DoModal() == IDOK) {
_tcscpy(str, dlg.GetPathName());
} else {
OnOK();
return;
}
} else {
_tcscpy(str, file);
}
WideCharToMultiByte(CP_UTF8, 0, str, -1, m_strUrl, MAX_PATH, NULL, NULL);

if( strlen(m_strUrl) <= 0 ){
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

你这代码只是修改了对 m_strURL 为空字符串的判断,并没有实现自动播放?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

第一次打开需要选择打开的文件,等文件播放完成后,会自动跳过再次选择文件的过程,直接播放上一次打开的文件

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

麻烦修改为命令行传参数,否则这个改动会对 testplayer 现有功能和使用逻辑造成影响

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

麻烦修改为命令行传参数,否则这个改动会对 testplayer 现有功能和使用逻辑造成影响

你能不能先帮忙debug一下代码,复现一下问题,后期我再修改一个版本吧

// open file dialog
if (!file) {
if (dlg.DoModal() == IDOK) {
_tcscpy(str, dlg.GetPathName());
} else {
OnOK();
return;
}
} else {
_tcscpy(str, file);
}
WideCharToMultiByte(CP_UTF8, 0, str, -1, m_strUrl, MAX_PATH, NULL, NULL);
}
// set window title
SetWindowText(TEXT("testplayer - loading"));

Expand Down Expand Up @@ -508,6 +511,7 @@ BOOL CplayerDlg::PreTranslateMessage(MSG *pMsg)

void CplayerDlg::OnOpenFile()
{
memset(m_strUrl, '\0', MAX_PATH);
Copy link
Owner

@rockcarry rockcarry Oct 28, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

建议修改为 strcpy(m_strUrl, ""); 设置为空字符串,这样含义更加明确。
缩进也不对,请使用四个空格进行缩进

PlayerOpenFile(NULL);
}

Expand Down