|
@@ -71,10 +71,12 @@ void PlayerController::startToPlay(const QString& file)
|
|
|
|
|
|
|
|
// 正在播放中,检查是否需要切换文件
|
|
// 正在播放中,检查是否需要切换文件
|
|
|
if (currentState == PlayerState::Playing) {
|
|
if (currentState == PlayerState::Playing) {
|
|
|
- if (currentFile == file) {
|
|
|
|
|
- qCDebug(playerControllerLog) << "Already playing the same file. Ignoring request.";
|
|
|
|
|
- return;
|
|
|
|
|
- } else {
|
|
|
|
|
|
|
+ // if (currentFile == file) {
|
|
|
|
|
+ // qCDebug(playerControllerLog) << "Already playing the same file. Ignoring request.";
|
|
|
|
|
+ // return;
|
|
|
|
|
+ // } else
|
|
|
|
|
+
|
|
|
|
|
+ {
|
|
|
qCDebug(playerControllerLog)
|
|
qCDebug(playerControllerLog)
|
|
|
<< "Player is busy with another file, stopping and switching to:" << file;
|
|
<< "Player is busy with another file, stopping and switching to:" << file;
|
|
|
// 在锁外调用stopPlay,避免死锁
|
|
// 在锁外调用stopPlay,避免死锁
|
|
@@ -129,15 +131,16 @@ void PlayerController::asyncInit(const QString& file)
|
|
|
success = false;
|
|
success = false;
|
|
|
} else {
|
|
} else {
|
|
|
// 检查文件是否存在和可访问
|
|
// 检查文件是否存在和可访问
|
|
|
- QFileInfo fileInfo(file);
|
|
|
|
|
- if (!fileInfo.exists() || !fileInfo.isReadable()) {
|
|
|
|
|
- qCWarning(playerControllerLog)
|
|
|
|
|
- << "File does not exist or is not readable:" << toNativePath(file);
|
|
|
|
|
- success = false;
|
|
|
|
|
- } else {
|
|
|
|
|
- qCInfo(playerControllerLog) << "File check passed:" << toNativePath(file);
|
|
|
|
|
- success = true;
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ // QFileInfo fileInfo(file);
|
|
|
|
|
+ // if (!fileInfo.exists() || !fileInfo.isReadable()) {
|
|
|
|
|
+ // qCWarning(playerControllerLog)
|
|
|
|
|
+ // << "File does not exist or is not readable:" << toNativePath(file);
|
|
|
|
|
+ // success = false;
|
|
|
|
|
+ // } else {
|
|
|
|
|
+ // qCInfo(playerControllerLog) << "File check passed:" << toNativePath(file);
|
|
|
|
|
+ // success = true;
|
|
|
|
|
+ // }
|
|
|
|
|
+ success = true;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
m_initSuccess = success;
|
|
m_initSuccess = success;
|