summaryrefslogtreecommitdiffstats
path: root/third_party/libwebrtc/moz-patch-stack/0076.patch
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 17:32:43 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 17:32:43 +0000
commit6bf0a5cb5034a7e684dcc3500e841785237ce2dd (patch)
treea68f146d7fa01f0134297619fbe7e33db084e0aa /third_party/libwebrtc/moz-patch-stack/0076.patch
parentInitial commit. (diff)
downloadthunderbird-6bf0a5cb5034a7e684dcc3500e841785237ce2dd.tar.xz
thunderbird-6bf0a5cb5034a7e684dcc3500e841785237ce2dd.zip
Adding upstream version 1:115.7.0.upstream/1%115.7.0upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'third_party/libwebrtc/moz-patch-stack/0076.patch')
-rw-r--r--third_party/libwebrtc/moz-patch-stack/0076.patch49
1 files changed, 49 insertions, 0 deletions
diff --git a/third_party/libwebrtc/moz-patch-stack/0076.patch b/third_party/libwebrtc/moz-patch-stack/0076.patch
new file mode 100644
index 0000000000..af81c02c28
--- /dev/null
+++ b/third_party/libwebrtc/moz-patch-stack/0076.patch
@@ -0,0 +1,49 @@
+From: Andreas Pehrson <apehrson@mozilla.com>
+Date: Thu, 6 Jan 2022 00:16:00 +0000
+Subject: Bug 1748478 - Propagate calculated discarded packets to stats. r=bwc
+
+Differential Revision: https://phabricator.services.mozilla.com/D135061
+Mercurial Revision: https://hg.mozilla.org/mozilla-central/rev/56fbf0469e25fa0d589c51ca112ce534a7c0ab91
+---
+ video/receive_statistics_proxy2.cc | 9 +++++++--
+ video/rtp_video_stream_receiver2.cc | 4 +++-
+ 2 files changed, 10 insertions(+), 3 deletions(-)
+
+diff --git a/video/receive_statistics_proxy2.cc b/video/receive_statistics_proxy2.cc
+index 020e4bb0ae..f5011c46ef 100644
+--- a/video/receive_statistics_proxy2.cc
++++ b/video/receive_statistics_proxy2.cc
+@@ -960,8 +960,13 @@ void ReceiveStatisticsProxy::OnDroppedFrames(uint32_t frames_dropped) {
+ }
+
+ void ReceiveStatisticsProxy::OnDiscardedPackets(uint32_t packets_discarded) {
+- RTC_DCHECK_RUN_ON(&main_thread_);
+- stats_.packets_discarded += packets_discarded;
++ // Can be called on either the decode queue or the worker thread
++ // See FrameBuffer2 for more details.
++ worker_thread_->PostTask(
++ SafeTask(task_safety_.flag(), [packets_discarded, this]() {
++ RTC_DCHECK_RUN_ON(&main_thread_);
++ stats_.packets_discarded += packets_discarded;
++ }));
+ }
+
+ void ReceiveStatisticsProxy::OnPreDecode(VideoCodecType codec_type, int qp) {
+diff --git a/video/rtp_video_stream_receiver2.cc b/video/rtp_video_stream_receiver2.cc
+index 46998b6d7c..a5d5f637e5 100644
+--- a/video/rtp_video_stream_receiver2.cc
++++ b/video/rtp_video_stream_receiver2.cc
+@@ -1222,7 +1222,9 @@ void RtpVideoStreamReceiver2::FrameDecoded(int64_t picture_id) {
+ packet_infos_.erase(packet_infos_.begin(),
+ packet_infos_.upper_bound(unwrapped_rtp_seq_num));
+ uint32_t num_packets_cleared = packet_buffer_.ClearTo(seq_num);
+- vcm_receive_statistics_->OnDiscardedPackets(num_packets_cleared);
++ if (num_packets_cleared > 0) {
++ vcm_receive_statistics_->OnDiscardedPackets(num_packets_cleared);
++ }
+ reference_finder_->ClearTo(seq_num);
+ }
+ }
+--
+2.34.1
+