Skip to content
This repository was archived by the owner on Apr 23, 2026. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion backends/gstreamer/player.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ fn metadata_from_media_info(media_info: &gst_play::PlayMediaInfo) -> Result<Meta
pub struct GStreamerAudioChunk(gst::buffer::MappedBuffer<gst::buffer::Readable>);
impl AsRef<[f32]> for GStreamerAudioChunk {
fn as_ref(&self) -> &[f32] {
self.0.as_ref().as_slice_of::<f32>().unwrap()
self.0.as_ref().as_slice_of::<f32>().unwrap_or_default()

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure this is the right way of handling this. You're going to silently ignore bugs here (it should always be aligned correctly, etc) which are going to be very annoying to debug if you just make this an empty slice.

Also note that backends/gstreamer/audio_decoder.rs has basically the same code but still unwrap()s, so at the very least this is inconsistent.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And backends/gstreamer/audio_stream_reader.rs converts it into an Err but as above, this should never really happen and if it happens then there is a bug elsewhere that needs to be fixed.

At the very least these cases should be logged.

}
}

Expand Down
Loading