mirror of
https://github.com/Genymobile/scrcpy
synced 2025-08-31 22:35:37 +00:00
Fix v4l2 AVFrame memory leak
Unref frame immediately once encoded. Fixes #2279 <https://github.com/Genymobile/scrcpy/pull/2279>
This commit is contained in:
@@ -125,6 +125,7 @@ run_v4l2_sink(void *data) {
|
|||||||
|
|
||||||
video_buffer_consume(&vs->vb, vs->frame);
|
video_buffer_consume(&vs->vb, vs->frame);
|
||||||
bool ok = encode_and_write_frame(vs, vs->frame);
|
bool ok = encode_and_write_frame(vs, vs->frame);
|
||||||
|
av_frame_unref(vs->frame);
|
||||||
if (!ok) {
|
if (!ok) {
|
||||||
LOGE("Could not send frame to v4l2 sink");
|
LOGE("Could not send frame to v4l2 sink");
|
||||||
break;
|
break;
|
||||||
|
Reference in New Issue
Block a user