media: vicodec: reset last_src/dst_buf based on the IS_OUTPUT
authorHans Verkuil <hverkuil@xs4all.nl>
Wed, 13 Mar 2019 14:47:13 +0000 (10:47 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 31 May 2019 13:43:51 +0000 (06:43 -0700)
commit37e27e4fd8f493981977776a9bc4052ce4322b1b
tree3638b7856ead97ba16170f8741823fac422f79c1
parent7a669c40424152c064a430fce2e9c1ecd838d6a2
media: vicodec: reset last_src/dst_buf based on the IS_OUTPUT

[ Upstream commit 76eb24fc233b8c94b2156ead5811e08d2046ad58 ]

When start_streaming was called both last_src_buf and last_dst_buf
pointers were set to NULL, but this depends on whether the capture
or output queue starts streaming.

When decoding with resolution changes in between the capture queue
has to restart streaming whenever a resolution change occurs. And
that would reset last_src_buf as well, which causes a problem if
the decoder was stopped by the application. Since last_src_buf
is now NULL, the LAST flag is never set for the last capture
buffer.

Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/media/platform/vicodec/vicodec-core.c