mirror of
https://github.com/moonlight-stream/moonlight-chrome.git
synced 2025-08-17 16:46:31 +00:00
Only show the NaCl plugin when a frame has been rendered
This commit is contained in:
parent
1f3f4bd0aa
commit
6c13c9b67d
@ -340,7 +340,6 @@ function playGameMode() {
|
||||
$(".mdl-layout__header").hide();
|
||||
$("#main-content").children().not("#listener, #loadingSpinner").hide();
|
||||
$("#main-content").addClass("fullscreen");
|
||||
$("#listener").addClass("fullscreen");
|
||||
fullscreenNaclModule();
|
||||
$("body").css('backgroundColor', 'black');
|
||||
|
||||
|
@ -32,6 +32,8 @@ function handleMessage(msg) {
|
||||
$('#loadingMessage').text(msg.data.replace('ProgressMsg: ', ''));
|
||||
} else if(msg.data.indexOf('TransientMsg: ') === 0) {
|
||||
snackbarLog(msg.data.replace('TransientMsg: ', ''));
|
||||
} else if(msg.data === 'displayVideo') {
|
||||
$("#listener").addClass("fullscreen");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -17,6 +17,7 @@ static unsigned char s_LastSps[256];
|
||||
static unsigned char s_LastPps[256];
|
||||
static unsigned int s_LastSpsLength;
|
||||
static unsigned int s_LastPpsLength;
|
||||
static bool s_FirstFrameDisplayed;
|
||||
static uint64_t s_LastPaintFinishedTime;
|
||||
|
||||
#define assertNoGLError() assert(!glGetError())
|
||||
@ -132,6 +133,7 @@ void MoonlightInstance::VidDecSetup(int videoFormat, int width, int height, int
|
||||
s_LastTextureId = 0;
|
||||
s_LastSpsLength = 0;
|
||||
s_LastPpsLength = 0;
|
||||
s_FirstFrameDisplayed = false;
|
||||
|
||||
int32_t err;
|
||||
|
||||
@ -407,6 +409,13 @@ void MoonlightInstance::PaintPicture(void) {
|
||||
|
||||
void MoonlightInstance::PaintFinished(int32_t result) {
|
||||
m_IsPainting = false;
|
||||
|
||||
if (!s_FirstFrameDisplayed) {
|
||||
// Tell the JS code to display the video stream now
|
||||
pp::Var response("displayVideo");
|
||||
g_Instance->PostMessage(response);
|
||||
s_FirstFrameDisplayed = true;
|
||||
}
|
||||
|
||||
ProfilerPrintDeltaFromNow("Paint -> Paint", s_LastPaintFinishedTime);
|
||||
s_LastPaintFinishedTime = ProfilerGetMillis();
|
||||
|
Loading…
x
Reference in New Issue
Block a user