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: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1392>
This commit is contained in:
François Laignel 2023-11-13 19:26:17 +01:00
parent 636c76b03b
commit 9250c592a7

View file

@ -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);
}
};