From c97e298b807c29658bf348f54e3bc64d10f14ad2 Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Tue, 17 Jul 2018 20:05:59 -0700 Subject: [PATCH] Use the queueFrame() helper --- app/streaming/video/ffmpeg.cpp | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/app/streaming/video/ffmpeg.cpp b/app/streaming/video/ffmpeg.cpp index 47bd3e83..7fabcaf8 100644 --- a/app/streaming/video/ffmpeg.cpp +++ b/app/streaming/video/ffmpeg.cpp @@ -217,14 +217,8 @@ int FFmpegVideoDecoder::submitDecodeUnit(PDECODE_UNIT du) err = avcodec_receive_frame(m_VideoDecoderCtx, frame); if (err == 0) { - SDL_Event event; - - event.type = SDL_USEREVENT; - event.user.code = SDL_CODE_FRAME_READY; - event.user.data1 = frame; - - // The main thread will handle freeing this - SDL_PushEvent(&event); + // Queue the frame for rendering from the main thread + queueFrame(frame); } else { av_frame_free(&frame);