utils: streamproducer: Add #[must_use] attribute to add_consumer()

Simply discarding the result will immediately disconnect it again, which
was likely not intended and can easily lead to bugs.

Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/issues/432

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1189>
This commit is contained in:
Sebastian Dröge 2023-01-14 19:04:08 +02:00
parent 8aa3e4417c
commit f8d17555c5

View file

@ -40,6 +40,7 @@ impl Eq for StreamProducer {}
/// Link between a `StreamProducer` and a consumer, disconnecting the link on `Drop`.
/// The producer and consumer will stay alive while the link is.
#[derive(Debug)]
#[must_use]
pub struct ConsumptionLink {
consumer: gst_app::AppSrc,
producer: Option<StreamProducer>,