Skip to content

Commit

Permalink
clone frame when filtering to avoid losing frame properties
Browse files Browse the repository at this point in the history
  • Loading branch information
Bramart committed Feb 12, 2024
1 parent deb8765 commit 9a442b5
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/filter_graph.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
));
}
}
}
Expand All @@ -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)
));
}
}
}
Expand Down

0 comments on commit 9a442b5

Please sign in to comment.