Bläddra i källkod

Z991239-1387 #comment other: 优化图像连续循环播放功能

陈礼鹏80274480 4 år sedan
förälder
incheckning
1d267d4614

+ 9 - 2
Other/libpictureplayer/CPicturePlayer.cpp

@@ -172,6 +172,8 @@ int CPicturePlayer::DeInit()
 		SDL_DestroyWindow(m_window);
 	}
 
+	SDL_Quit();
+
 	iRet = 0;
 
 	return iRet;
@@ -181,8 +183,11 @@ int CPicturePlayer::DeInit()
 bool CPicturePlayer::StartPicPlay()
 {
 	bool bRet = false;
+
 	m_bplaying = true;
 
+	m_pHostApi->PicDebug("set m_bplaying = true");
+
 	SDL_Surface* surface = SDL_GetWindowSurface(m_window);
 
 	int iPlayCount = 0;
@@ -223,8 +228,6 @@ bool CPicturePlayer::StartPicPlay()
 		}
 	}
 
-	m_bplaying = false;
-
 	if (iPlayCount == m_nplay_cnt) {
 		m_pHostApi->PicDebug("%d times picture playing task finished, exit.", iPlayCount);
 	}
@@ -233,6 +236,10 @@ bool CPicturePlayer::StartPicPlay()
 		m_pHostApi->PicDebug("user stop picture playing task, exit");
 	}
 
+	SDL_Quit();
+
+	m_pHostApi->PicDebug("set m_bplaying = false");
+	m_bplaying = false;
 	bRet = true;
 
 	return bRet;

+ 2 - 0
Other/libpictureplayer/libpictureplayer.cpp

@@ -249,4 +249,6 @@ void* PicturePlayingFunc(void* param)
 	is->StartPicPlay();
 
 	is->m_pHostApi->PicDebug("leave PicturePlayingFunc");
+
+	return 0;
 }