From db415e6699ad420e0da395b232e0bc7788063e5f Mon Sep 17 00:00:00 2001 From: Hans Verkuil Date: Sat, 12 Jul 2014 09:28:50 +0200 Subject: [PATCH] libv4l2rds: handle V4L2_RDS_BLOCK_INVALID. This possible block value was not understood by libv4l2rds. This can happen if obsolete so-called 'E' blocks were received. This should never happen in practice, but it is still good to handle it, just in case. Signed-off-by: Hans Verkuil --- lib/libv4l2rds/libv4l2rds.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/libv4l2rds/libv4l2rds.c b/lib/libv4l2rds/libv4l2rds.c index ac7adb2..24e113e 100644 --- a/lib/libv4l2rds/libv4l2rds.c +++ b/lib/libv4l2rds/libv4l2rds.c @@ -1388,7 +1388,8 @@ uint32_t v4l2_rds_add(struct v4l2_rds *handle, struct v4l2_rds_data *rds_data) rds_stats->block_cnt++; /* check for corrected / uncorrectable errors in the data */ - if (rds_data->block & V4L2_RDS_BLOCK_ERROR) { + if ((rds_data->block & V4L2_RDS_BLOCK_ERROR) || + block_id == V4L2_RDS_BLOCK_INVALID) { block_id = -1; rds_stats->block_error_cnt++; } else if (rds_data->block & V4L2_RDS_BLOCK_CORRECTED) { -- 2.7.4