Skip to content

Commit

Permalink
get frames for buffersink after filtering while there's still some
Browse files Browse the repository at this point in the history
  • Loading branch information
Bramart committed Feb 9, 2024
1 parent d795c0f commit 4b4a13a
Showing 1 changed file with 28 additions and 22 deletions.
50 changes: 28 additions & 22 deletions src/filter_graph.rs
Original file line number Diff line number Diff line change
Expand Up @@ -262,33 +262,39 @@ impl FilterGraph {
}

for (index, output_filter) in self.audio_outputs.iter().enumerate() {
let output_frame = av_frame_alloc();
let result = av_buffersink_get_frame(output_filter.context, output_frame);
if result == AVERROR(EAGAIN) || result == AVERROR_EOF {
break;
} else {
check_result!(result);
let mut result = 0;
while result >= 0 {
let output_frame = av_frame_alloc();
result = av_buffersink_get_frame(output_filter.context, output_frame);
if result == AVERROR(EAGAIN) || result == AVERROR_EOF {
break;
} else {
check_result!(result);
}
output_audio_frames.push(Frame {
name: Some(output_filter.get_label()),
frame: output_frame,
index,
});
}
output_audio_frames.push(Frame {
name: Some(output_filter.get_label()),
frame: output_frame,
index,
});
}

for (index, output_filter) in self.video_outputs.iter().enumerate() {
let output_frame = av_frame_alloc();
let result = av_buffersink_get_frame(output_filter.context, output_frame);
if result == AVERROR(EAGAIN) || result == AVERROR_EOF {
break;
} else {
check_result!(result);
let mut result = 0;
while result >= 0 {
let output_frame = av_frame_alloc();
result = av_buffersink_get_frame(output_filter.context, output_frame);
if result == AVERROR(EAGAIN) || result == AVERROR_EOF {
break;
} else {
check_result!(result);
}
output_video_frames.push(Frame {
name: Some(output_filter.get_label()),
frame: output_frame,
index,
});
}
output_video_frames.push(Frame {
name: Some(output_filter.get_label()),
frame: output_frame,
index,
});
}
}

Expand Down

0 comments on commit 4b4a13a

Please sign in to comment.