v4l2videodec: do not call streamon while pool is flushing
authorMichael Tretter <m.tretter@pengutronix.de>
Tue, 26 Jun 2018 13:04:39 +0000 (15:04 +0200)
committerNicolas Dufresne <nicolas.dufresne@collabora.com>
Wed, 27 Jun 2018 20:32:23 +0000 (16:32 -0400)
commit35ab185d752fb610aa26002c1aa03cf2fd954b7d
tree9f1959feed707f92240be1d27e80eb939b5a3770
parent32fa1e7a65711b9d2b7468e682ce9fe0bc97b66b
v4l2videodec: do not call streamon while pool is flushing

gst_v4l2_buffer_pool_flush() executes streamoff for the output, but
streamoff->streamon for the capture of the decoder.
gst_v4l2_buffer_pool_streamon() on capture assumes that is able to
resurrect the buffers from the pool, but acquiring buffers fails if the
buffer pool is still flushing.

The decoder needs to stop flushing the pools before calling
gst_v4l2_buffer_pool_flush() to restart the v4l2 device. Otherwise
starting the decoding thread might fail, because there are no buffers in
the capture pool.

This fixes a regression that was introduced in 97985a335c78
("v4l2videodec: Add dynamic resolution change support").

https://bugzilla.gnome.org/show_bug.cgi?id=796681
sys/v4l2/gstv4l2videodec.c