mirror of
https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git
synced 2024-11-25 21:11:00 +00:00
Fix a few new clippy 1.75 warnings
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1415>
This commit is contained in:
parent
79b8610fbe
commit
1ef47cb48e
6 changed files with 7 additions and 7 deletions
|
@ -1474,7 +1474,7 @@ fn write_dops(v: &mut Vec<u8>, caps: &gst::Caps) -> Result<(), Error> {
|
||||||
.unwrap()
|
.unwrap()
|
||||||
.get::<gst::ArrayRef>("streamheader")
|
.get::<gst::ArrayRef>("streamheader")
|
||||||
.ok()
|
.ok()
|
||||||
.and_then(|a| a.get(0).and_then(|v| v.get::<gst::Buffer>().ok()))
|
.and_then(|a| a.first().and_then(|v| v.get::<gst::Buffer>().ok()))
|
||||||
{
|
{
|
||||||
(
|
(
|
||||||
rate,
|
rate,
|
||||||
|
|
|
@ -2408,7 +2408,7 @@ impl FMP4Mux {
|
||||||
if let Some(super::FragmentHeaderStream {
|
if let Some(super::FragmentHeaderStream {
|
||||||
start_time: Some(start_time),
|
start_time: Some(start_time),
|
||||||
..
|
..
|
||||||
}) = streams.get(0)
|
}) = streams.first()
|
||||||
{
|
{
|
||||||
state.fragment_offsets.push(super::FragmentOffset {
|
state.fragment_offsets.push(super::FragmentOffset {
|
||||||
time: *start_time,
|
time: *start_time,
|
||||||
|
@ -2587,7 +2587,7 @@ impl FMP4Mux {
|
||||||
if let Some(header) = s
|
if let Some(header) = s
|
||||||
.get::<gst::ArrayRef>("streamheader")
|
.get::<gst::ArrayRef>("streamheader")
|
||||||
.ok()
|
.ok()
|
||||||
.and_then(|a| a.get(0).and_then(|v| v.get::<gst::Buffer>().ok()))
|
.and_then(|a| a.first().and_then(|v| v.get::<gst::Buffer>().ok()))
|
||||||
{
|
{
|
||||||
if gst_pbutils::codec_utils_opus_parse_header(&header, None).is_err() {
|
if gst_pbutils::codec_utils_opus_parse_header(&header, None).is_err() {
|
||||||
gst::error!(CAT, obj: pad, "Received invalid Opus header");
|
gst::error!(CAT, obj: pad, "Received invalid Opus header");
|
||||||
|
|
|
@ -1291,7 +1291,7 @@ fn write_dops(v: &mut Vec<u8>, caps: &gst::Caps) -> Result<(), Error> {
|
||||||
.unwrap()
|
.unwrap()
|
||||||
.get::<gst::ArrayRef>("streamheader")
|
.get::<gst::ArrayRef>("streamheader")
|
||||||
.ok()
|
.ok()
|
||||||
.and_then(|a| a.get(0).and_then(|v| v.get::<gst::Buffer>().ok()))
|
.and_then(|a| a.first().and_then(|v| v.get::<gst::Buffer>().ok()))
|
||||||
{
|
{
|
||||||
(
|
(
|
||||||
rate,
|
rate,
|
||||||
|
|
|
@ -902,7 +902,7 @@ impl MP4Mux {
|
||||||
if let Some(header) = s
|
if let Some(header) = s
|
||||||
.get::<gst::ArrayRef>("streamheader")
|
.get::<gst::ArrayRef>("streamheader")
|
||||||
.ok()
|
.ok()
|
||||||
.and_then(|a| a.get(0).and_then(|v| v.get::<gst::Buffer>().ok()))
|
.and_then(|a| a.first().and_then(|v| v.get::<gst::Buffer>().ok()))
|
||||||
{
|
{
|
||||||
if gst_pbutils::codec_utils_opus_parse_header(&header, None).is_err() {
|
if gst_pbutils::codec_utils_opus_parse_header(&header, None).is_err() {
|
||||||
gst::error!(CAT, obj: pad, "Received invalid Opus header");
|
gst::error!(CAT, obj: pad, "Received invalid Opus header");
|
||||||
|
|
|
@ -1647,7 +1647,7 @@ impl UriPlaylistBin {
|
||||||
|
|
||||||
if let Some(state) = state_guard.as_mut() {
|
if let Some(state) = state_guard.as_mut() {
|
||||||
// first streaming item is the one actually being played
|
// first streaming item is the one actually being played
|
||||||
if let Some(current) = state.streaming.get(0) {
|
if let Some(current) = state.streaming.first() {
|
||||||
let (mut current_iteration, current_uri_index) = (
|
let (mut current_iteration, current_uri_index) = (
|
||||||
(current.index() / uris_len) as u32,
|
(current.index() / uris_len) as u32,
|
||||||
(current.index() % uris_len) as u64,
|
(current.index() % uris_len) as u64,
|
||||||
|
|
|
@ -252,7 +252,7 @@ mod test {
|
||||||
let message: VideoCompareMessage = structure.try_into().unwrap();
|
let message: VideoCompareMessage = structure.try_into().unwrap();
|
||||||
assert_eq!(message.running_time, Some(running_time));
|
assert_eq!(message.running_time, Some(running_time));
|
||||||
|
|
||||||
let pad_distance = message.pad_distances.get(0).unwrap();
|
let pad_distance = message.pad_distances.first().unwrap();
|
||||||
assert_eq!(pad_distance.pad.name().as_str(), "sink_0");
|
assert_eq!(pad_distance.pad.name().as_str(), "sink_0");
|
||||||
assert_eq!(pad_distance.distance, 42f64);
|
assert_eq!(pad_distance.distance, 42f64);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue