From 2db81d6597525fdca6141725edca049cd56198c3 Mon Sep 17 00:00:00 2001 From: Nicolas Dufresne Date: Wed, 22 Nov 2017 22:27:04 -0500 Subject: [PATCH] waylandsink: Rollback video info changes when copying We change the video info base on the received buffer. We need to rollback these changes whenever we want to copy into our internal pool of buffers. https://bugzilla.gnome.org/show_bug.cgi?id=790057 --- ext/wayland/gstwaylandsink.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ext/wayland/gstwaylandsink.c b/ext/wayland/gstwaylandsink.c index e02b0cce7e..dd40bd1b2f 100644 --- a/ext/wayland/gstwaylandsink.c +++ b/ext/wayland/gstwaylandsink.c @@ -631,6 +631,7 @@ gst_wayland_sink_show_frame (GstVideoSink * vsink, GstBuffer * buffer) GstWlBuffer *wlbuffer; GstVideoMeta *vmeta; GstVideoFormat format; + GstVideoInfo old_vinfo; GstMemory *mem; struct wl_buffer *wbuf = NULL; @@ -676,6 +677,7 @@ gst_wayland_sink_show_frame (GstVideoSink * vsink, GstBuffer * buffer) /* update video info from video meta */ mem = gst_buffer_peek_memory (buffer, 0); + old_vinfo = sink->video_info; vmeta = gst_buffer_get_video_meta (buffer); if (vmeta) { gint i; @@ -713,6 +715,9 @@ gst_wayland_sink_show_frame (GstVideoSink * vsink, GstBuffer * buffer) GstVideoFrame src, dst; GstVideoInfo src_info = sink->video_info; + /* rollback video info changes */ + sink->video_info = old_vinfo; + /* we don't know how to create a wl_buffer directly from the provided * memory, so we have to copy the data to shm memory that we know how * to handle... */