Skip to content

Commit

Permalink
Merge pull request #61 from nomalab/fix_deepprobe_ram_leak
Browse files Browse the repository at this point in the history
Fix deepprobe ram leak
  • Loading branch information
Bramart authored Oct 30, 2024
2 parents 734efe1 + 52cb146 commit 5df167b
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/filter_graph.rs
Original file line number Diff line number Diff line change
Expand Up @@ -250,9 +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(
check_result!(av_buffersrc_add_frame_flags(
input.context,
av_frame_clone(frame.frame)
av_frame_clone(frame.frame),
4
));
}
}
Expand All @@ -262,9 +263,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(
check_result!(av_buffersrc_add_frame_flags(
input.context,
av_frame_clone(frame.frame)
av_frame_clone(frame.frame),
4
));
}
}
Expand All @@ -275,7 +277,7 @@ impl FilterGraph {
let mut result = 0;
while result >= 0 {
let output_frame = av_frame_alloc();
result = av_buffersink_get_frame(output_filter.context, output_frame);
result = av_buffersink_get_frame_flags(output_filter.context, output_frame, 2);
if result == AVERROR(EAGAIN) || result == AVERROR_EOF {
break;
} else {
Expand All @@ -293,7 +295,7 @@ impl FilterGraph {
let mut result = 0;
while result >= 0 {
let output_frame = av_frame_alloc();
result = av_buffersink_get_frame(output_filter.context, output_frame);
result = av_buffersink_get_frame_flags(output_filter.context, output_frame, 2);
if result == AVERROR(EAGAIN) || result == AVERROR_EOF {
break;
} else {
Expand Down

0 comments on commit 5df167b

Please sign in to comment.