From fc8c96748b9f0ebb4057f4e1b195277e2c3002b1 Mon Sep 17 00:00:00 2001
From: Merlin Manthey <merlin.manthey@raytrix.de>
Date: Tue, 1 Aug 2017 13:30:33 +0200
Subject: [PATCH 2/2] fixed v4l2_buffer flag handling with io-mode
 GST_V4L2_IO_USERPTR

---
 sys/v4l2/gstv4l2bufferpool.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/sys/v4l2/gstv4l2bufferpool.c b/sys/v4l2/gstv4l2bufferpool.c
index cf8c29e..eef2fe1 100644
--- a/sys/v4l2/gstv4l2bufferpool.c
+++ b/sys/v4l2/gstv4l2bufferpool.c
@@ -1824,10 +1824,17 @@ gst_v4l2_buffer_pool_process (GstV4l2BufferPool * pool, GstBuffer ** buf)
         {
           struct UserPtrData *data;
 
+          /* Rescue the buffer flags from the buffer */
+          int flags = GST_BUFFER_FLAGS(*buf);
+
           /* Replace our buffer with downstream allocated buffer */
           data = gst_mini_object_steal_qdata (GST_MINI_OBJECT (*buf),
               GST_V4L2_IMPORT_QUARK);
           gst_buffer_replace (buf, data->buffer);
+
+          /* Restore the original flags */
+          GST_BUFFER_FLAG_SET(*buf, flags);
+
           _unmap_userptr_frame (data);
           break;
         }
-- 
2.9.2.windows.1

