mirror of
https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git
synced 2024-11-26 13:31:00 +00:00
rtpgccbwe: Don't process empty lists
The structure parsing could result in an empty vector. Don't do any processing since the loss code assumes it's non-empty for average estimates which would result in weird/invalid results. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1181>
This commit is contained in:
parent
dbdb9bc164
commit
721d17e181
1 changed files with 14 additions and 11 deletions
|
@ -1184,19 +1184,22 @@ impl ObjectSubclass for BandwidthEstimator {
|
||||||
})
|
})
|
||||||
.collect::<Vec<Packet>>();
|
.collect::<Vec<Packet>>();
|
||||||
|
|
||||||
let bitrate_changed = {
|
// The list of packets could be empty once parsed
|
||||||
let mut state = this.state.lock().unwrap();
|
if !packets.is_empty() {
|
||||||
|
let bitrate_changed = {
|
||||||
|
let mut state = this.state.lock().unwrap();
|
||||||
|
|
||||||
state.detector.update(&mut packets);
|
state.detector.update(&mut packets);
|
||||||
if !state.delay_control(&bwe) {
|
if !state.delay_control(&bwe) {
|
||||||
state.loss_control(&bwe)
|
state.loss_control(&bwe)
|
||||||
} else {
|
} else {
|
||||||
true
|
true
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
if bitrate_changed {
|
||||||
|
bwe.notify("estimated-bitrate")
|
||||||
}
|
}
|
||||||
};
|
|
||||||
|
|
||||||
if bitrate_changed {
|
|
||||||
bwe.notify("estimated-bitrate")
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue