mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1075640: Don't return 0-length frames for decoding; add comments about loss handling r=ehugg
Fixes OpenH264 crashes, especially under extreme packet loss
This commit is contained in:
parent
830662648f
commit
2037a7867d
@ -590,6 +590,11 @@ VCMEncodedFrame* VCMJitterBuffer::ExtractAndSetDecode(uint32_t timestamp) {
|
||||
if ((*frame).IsSessionComplete())
|
||||
UpdateAveragePacketsPerFrame(frame->NumPackets());
|
||||
|
||||
if (frame->Length() == 0) {
|
||||
// Normally only if MakeDecodable() on an incomplete frame threw it all away
|
||||
ReleaseFrame(frame);
|
||||
return NULL;
|
||||
}
|
||||
return frame;
|
||||
}
|
||||
|
||||
|
@ -548,6 +548,9 @@ int VCMSessionInfo::InsertPacket(const VCMPacket& packet,
|
||||
|
||||
int returnLength = InsertBuffer(frame_buffer, packet_list_it);
|
||||
UpdateCompleteSession();
|
||||
// We call MakeDecodable() before decoding, which removes packets after a loss
|
||||
// (and which means h.264 mode 1 frames with a loss in the first packet will be
|
||||
// totally removed)
|
||||
if (decode_error_mode == kWithErrors)
|
||||
decodable_ = true;
|
||||
else if (decode_error_mode == kSelectiveErrors)
|
||||
|
Loading…
Reference in New Issue
Block a user