mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2026-07-25 06:54:43 +00:00
Fix memory leak in media streaming.
This commit is contained in:
@@ -309,6 +309,7 @@ void File::Context::readNextPacket() {
|
||||
if (i->second.size() == kMaxQueuedPackets) {
|
||||
processQueuedPackets(SleepPolicy::Allowed);
|
||||
}
|
||||
Assert(i->second.size() < kMaxQueuedPackets);
|
||||
} else {
|
||||
// Still trying to read by drain.
|
||||
Assert(result.is<FFmpeg::AvErrorWrap>());
|
||||
|
||||
@@ -396,6 +396,8 @@ bool Player::fileProcessPackets(
|
||||
videoReceivedTill(till);
|
||||
});
|
||||
_video->process(base::take(list));
|
||||
} else {
|
||||
list.clear(); // Free non-needed packets.
|
||||
}
|
||||
}
|
||||
return fileReadMore();
|
||||
|
||||
Reference in New Issue
Block a user