mirror of
https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git
synced 2025-02-15 12:25:20 +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/1190>
This commit is contained in:
parent
5462ed0e95
commit
f4a565d4ea
1 changed files with 14 additions and 11 deletions
|
@ -1194,6 +1194,8 @@ impl ObjectSubclass for BandwidthEstimator {
|
||||||
})
|
})
|
||||||
.collect::<Vec<Packet>>();
|
.collect::<Vec<Packet>>();
|
||||||
|
|
||||||
|
// The list of packets could be empty once parsed
|
||||||
|
if !packets.is_empty() {
|
||||||
let bitrate_changed = {
|
let bitrate_changed = {
|
||||||
let mut state = this.state.lock().unwrap();
|
let mut state = this.state.lock().unwrap();
|
||||||
|
|
||||||
|
@ -1210,6 +1212,7 @@ impl ObjectSubclass for BandwidthEstimator {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
gst::Pad::event_default(pad, parent, event)
|
gst::Pad::event_default(pad, parent, event)
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in a new issue