summaryrefslogtreecommitdiff
path: root/libavcodec/v4l2_m2m.c
diff options
context:
space:
mode:
authorAndriy Gelman <andriy.gelman@gmail.com>2020-08-23 13:33:37 -0400
committerAndriy Gelman <andriy.gelman@gmail.com>2020-08-23 13:42:07 -0400
commit8bc7f69cefbcbb265b41717608dc8436dc864a55 (patch)
tree3d2de02c4d41984956f1aee890d12da3058c0d3a /libavcodec/v4l2_m2m.c
parent994d2567f13c11422aeb6506b6afca42a900d620 (diff)
downloadffmpeg-8bc7f69cefbcbb265b41717608dc8436dc864a55.tar.gz
avcodec/v4l2_m2m_enc: buffer frame if it cannot be enqueued
Currently if the frame buffers are full, the frame is unrefed and dropped. Instead buffer the frame so that it is enqueued in the next v4l2_receive_packet() call. The behavior was observed on DragonBoard 410c. Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com>
Diffstat (limited to 'libavcodec/v4l2_m2m.c')
-rw-r--r--libavcodec/v4l2_m2m.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/libavcodec/v4l2_m2m.c b/libavcodec/v4l2_m2m.c
index 31600617fd..cdfd579810 100644
--- a/libavcodec/v4l2_m2m.c
+++ b/libavcodec/v4l2_m2m.c
@@ -329,6 +329,7 @@ static void v4l2_m2m_destroy_context(void *opaque, uint8_t *context)
sem_destroy(&s->refsync);
close(s->fd);
+ av_frame_unref(s->frame);
av_frame_free(&s->frame);
av_packet_unref(&s->buf_pkt);