Skip to content

Display and control your Android device

Fix v4l2 AVFrame memory leak

Romain Vimont1cde68a1fa01
diff --git a/app/src/v4l2_sink.c b/app/src/v4l2_sink.c
index b7d06bb6..9b4a9c85 100644
--- a/app/src/v4l2_sink.c
+++ b/app/src/v4l2_sink.c
@@ -125,6 +125,7 @@ run_v4l2_sink(void *data) {
video_buffer_consume(&vs->vb, vs->frame);
bool ok = encode_and_write_frame(vs, vs->frame);
+ av_frame_unref(vs->frame);
if (!ok) {
LOGE("Could not send frame to v4l2 sink");
break;