aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHans Verkuil <hans.verkuil@cisco.com>2014-07-27 21:31:16 +0200
committerHans Verkuil <hans.verkuil@cisco.com>2014-07-27 21:31:16 +0200
commit66e6a25b682debfa328b23056ff4050683054569 (patch)
treeb3c72d760939596be98280bc8934d90de09b3eb3
parente9406cd5462abc772e081ab455bbb9b9c275abbc (diff)
libv4l2rds: DI segment order was swapped
The segment number of bit 3 of the DI code is 0, increasing to segment number 3 for bit 0. The code assumed segment S matched bit S, but it is bit (3 - S) instead. Very confusing choice in the standard, so I'm not surprised this was broken. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
-rw-r--r--lib/libv4l2rds/libv4l2rds.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/libv4l2rds/libv4l2rds.c b/lib/libv4l2rds/libv4l2rds.c
index efc8a7d9..596cd193 100644
--- a/lib/libv4l2rds/libv4l2rds.c
+++ b/lib/libv4l2rds/libv4l2rds.c
@@ -807,28 +807,28 @@ static uint32_t rds_decode_group0(struct rds_private_state *priv_state)
/* bit 2 of block B contains 1 bit of the Decoder Control Information (DI)
* the segment number defines the bit position
- * New bits are only accepted the segments arrive in the correct order */
+ * New bits are only accepted if the segments arrive in the correct order */
bool bit2 = grp->data_b_lsb & 0x04;
if (segment == 0 || segment == priv_state->next_di_segment) {
switch (segment) {
case 0:
priv_state->new_di = set_bit(priv_state->new_di,
- V4L2_RDS_FLAG_STEREO, bit2);
+ V4L2_RDS_FLAG_DYNAMIC_PTY, bit2);
priv_state->next_di_segment = 1;
break;
case 1:
priv_state->new_di = set_bit(priv_state->new_di,
- V4L2_RDS_FLAG_ARTIFICIAL_HEAD, bit2);
+ V4L2_RDS_FLAG_COMPRESSED, bit2);
priv_state->next_di_segment = 2;
break;
case 2:
priv_state->new_di = set_bit(priv_state->new_di,
- V4L2_RDS_FLAG_COMPRESSED, bit2);
+ V4L2_RDS_FLAG_ARTIFICIAL_HEAD, bit2);
priv_state->next_di_segment = 3;
break;
case 3:
priv_state->new_di = set_bit(priv_state->new_di,
- V4L2_RDS_FLAG_DYNAMIC_PTY, bit2);
+ V4L2_RDS_FLAG_STEREO, bit2);
/* check if the value of DI has changed, and store
* and signal DI update in case */
if (handle->di != priv_state->new_di) {

Privacy Policy