From 18405f576d0cf18dc46e89888512b21a0f60f3cb Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Sun, 29 Jun 2014 21:07:07 -0700 Subject: [PATCH] Fix a race between the start callback and the first frame's data --- limelight-common/VideoStream.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/limelight-common/VideoStream.c b/limelight-common/VideoStream.c index d5d2b6b..b0b7035 100644 --- a/limelight-common/VideoStream.c +++ b/limelight-common/VideoStream.c @@ -179,12 +179,14 @@ int startVideoStream(void* rendererContext, int drFlags) { return err; } + // This must be called before the decoder thread starts submitting + // decode units + callbacks.start(); + err = PltCreateThread(DecoderThreadProc, NULL, &decoderThread); if (err != 0) { return err; } - callbacks.start(); - return 0; }