mirror of
https://github.com/moonlight-stream/moonlight-common-c.git
synced 2026-11-28 08:44:21 +00:00
Fix potential leaks on queue shutdown
This commit is contained in:
1 parent
bf71226754
commit
348d5d1e32
2 files changed
+26
-10
No files matched your search
+13
-4
@@ -538,8 +538,14 @@ static void reassembleFrame(int frameNumber, bool frameIsLTR) {
|
||||
nalChainFragmentCount = 0;
|
||||
|
||||
if ((VideoCallbacks.capabilities & CAPABILITY_DIRECT_SUBMIT) == 0) {
|
||||
if (LbqOfferQueueItem(&decodeUnitQueue, qdu, &qdu->entry) == LBQ_BOUND_EXCEEDED) {
|
||||
Limelog("Video decode unit queue overflow\n");
|
||||
int err = LbqOfferQueueItem(&decodeUnitQueue, qdu, &qdu->entry);
|
||||
if (err != LBQ_SUCCESS) {
|
||||
if (err == LBQ_BOUND_EXCEEDED) {
|
||||
Limelog("Video decode unit queue overflow\n");
|
||||
}
|
||||
else {
|
||||
Limelog("Failed to queue video decode unit: %d\n", err);
|
||||
}
|
||||
|
||||
// RFI recovery is not supported here
|
||||
waitingForIdrFrame = true;
|
||||
@@ -555,8 +561,11 @@ static void reassembleFrame(int frameNumber, bool frameIsLTR) {
|
||||
// Free all frames in the decode unit queue
|
||||
freeDecodeUnitList(LbqFlushQueueItems(&decodeUnitQueue));
|
||||
|
||||
// Request an IDR frame to recover
|
||||
LiRequestIdrFrame();
|
||||
// Request an IDR frame to recover if we're not shutting down
|
||||
if (err != LBQ_INTERRUPTED) {
|
||||
LiRequestIdrFrame();
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user