From 9250c592a7408cd25a65ca916745d953f396af03 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Laignel?= Date: Mon, 13 Nov 2023 19:26:17 +0100 Subject: [PATCH] ndi: don't accumulate meta with audio only streams Currently, only closed caption metadata are supported. When the next video frame is received, pending meta are dequeued and parsed. If close captions are found, they are attached to the video frame. For audio only streams, it doesn't make sense to enqueue metadata. They would accumulate in `pending_metadata` and would never be dequeued. Fixes https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/issues/460 Part-of: --- net/ndi/src/ndisrcdemux/imp.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/net/ndi/src/ndisrcdemux/imp.rs b/net/ndi/src/ndisrcdemux/imp.rs index be93e4c8..c9a51956 100644 --- a/net/ndi/src/ndisrcdemux/imp.rs +++ b/net/ndi/src/ndisrcdemux/imp.rs @@ -534,7 +534,11 @@ impl NdiSrcDemux { gst::log!(CAT, imp: self, "Produced video buffer {:?}", buffer); } Buffer::Metadata { frame, .. } => { - state.pending_metadata.push(frame); + // Only closed caption meta are supported, + // once parsed, they will be attached to the next video buffer + if state.video_info.is_some() { + state.pending_metadata.push(frame); + } return Ok(gst::FlowSuccess::Ok); } };