From 9a442b5871a92c2aeb6ef8b4bfcf8444f450fcd5 Mon Sep 17 00:00:00 2001 From: Bramart Date: Fri, 26 Jan 2024 15:52:43 +0100 Subject: [PATCH] clone frame when filtering to avoid losing frame properties --- src/filter_graph.rs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/filter_graph.rs b/src/filter_graph.rs index 90accd1..6135e44 100644 --- a/src/filter_graph.rs +++ b/src/filter_graph.rs @@ -250,7 +250,10 @@ impl FilterGraph { for input in &self.audio_inputs { if let Some(label) = &frame.name { if input.get_label() == *label { - check_result!(av_buffersrc_add_frame(input.context, frame.frame)); + check_result!(av_buffersrc_add_frame( + input.context, + av_frame_clone(frame.frame) + )); } } } @@ -259,7 +262,10 @@ impl FilterGraph { for input in &self.video_inputs { if let Some(label) = &frame.name { if input.get_label() == *label { - check_result!(av_buffersrc_add_frame(input.context, frame.frame)); + check_result!(av_buffersrc_add_frame( + input.context, + av_frame_clone(frame.frame) + )); } } }