[PATCH 7/7] media: s5p-mfc: do not fail V4L2_DEC_CMD_STOP when not streaming
From: Shigeaki Asai via B4 Relay
Date: Mon Nov 30 2026 - 08:04:04 EST
From: Shigeaki Asai <y-asai.0816@xxxxxxxxxxxx>
The stateful decoder interface says that VIDIOC_DECODER_CMD with
V4L2_DEC_CMD_STOP does not fail if a queue is not streaming; it only
does not start the drain sequence. The driver returns -EINVAL when the
OUTPUT queue is not streaming, so v4l2-compliance reports:
fail: v4l2-test-codecs.cpp(165): ret
test VIDIOC_(TRY_)DECODER_CMD: FAIL
Return 0 in that case, without starting the drain sequence.
Tested on an ODROID-XU4 (Exynos5422) with Kodi/FFmpeg and
v4l2-compliance 1.32.0 on a 7.3.4 kernel (LibreELEC).
The problem was investigated and this patch was prepared with the help
of Claude (AI).
Fixes: a34026e75bd1 ("[media] s5p-mfc: Add support for EOS command and EOS event in video decoder")
Signed-off-by: Shigeaki Asai <y-asai.0816@xxxxxxxxxxxx>
---
drivers/media/platform/samsung/s5p-mfc/s5p_mfc_dec.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_dec.c b/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_dec.c
index 6b52617254d9..211301d902c3 100644
--- a/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_dec.c
+++ b/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_dec.c
@@ -885,7 +885,7 @@ static int vidioc_decoder_cmd(struct file *file, void *priv,
return -EINVAL;
if (!vb2_is_streaming(&ctx->vq_src))
- return -EINVAL;
+ return 0;
spin_lock_irqsave(&dev->irqlock, flags);
if (list_empty(&ctx->src_queue)) {
--
2.43.0