mirror of
https://github.com/moonlight-stream/moonlight-qt
synced 2025-03-04 22:57:14 +00:00
Use the queueFrame() helper
This commit is contained in:
parent
a89cadc520
commit
c97e298b80
1 changed files with 2 additions and 8 deletions
|
@ -217,14 +217,8 @@ int FFmpegVideoDecoder::submitDecodeUnit(PDECODE_UNIT du)
|
||||||
|
|
||||||
err = avcodec_receive_frame(m_VideoDecoderCtx, frame);
|
err = avcodec_receive_frame(m_VideoDecoderCtx, frame);
|
||||||
if (err == 0) {
|
if (err == 0) {
|
||||||
SDL_Event event;
|
// Queue the frame for rendering from the main thread
|
||||||
|
queueFrame(frame);
|
||||||
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);
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
av_frame_free(&frame);
|
av_frame_free(&frame);
|
||||||
|
|
Loading…
Add table
Reference in a new issue