Skip to content

Commit

Permalink
V4L/DVB (11091): cx18, ivtv: Ensure endianess for linemasks in VBI em…
Browse files Browse the repository at this point in the history
…bedded in MPEG stream

The sliced VBI payloads that cx18 and ivtv would insert in the MPEG stream
did not have consistent endianess for the linemasks in the payload (a big
endian platform would write them out big endian).  This change ensures the
linemasks are always stored as little-endian in the MPEG stream to ensure
cross platform consistency in parsing the generated MPEG stream.

Signed-off-by: Andy Walls <awalls@radix.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
  • Loading branch information
Andy Walls authored and Mauro Carvalho Chehab committed Mar 30, 2009
1 parent baadd79 commit 6e1a637
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/media/video/cx18/cx18-vbi.c
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,8 @@ static void copy_vbi_data(struct cx18 *cx, int lines, u32 pts_stamp)
size = 4 + ((43 * line + 3) & ~3);
} else {
memcpy(dst + sd, "itv0", 4);
cpu_to_le32s(&linemask[0]);
cpu_to_le32s(&linemask[1]);
memcpy(dst + sd + 4, &linemask[0], 8);
size = 12 + ((43 * line + 3) & ~3);
}
Expand Down
2 changes: 2 additions & 0 deletions drivers/media/video/ivtv/ivtv-vbi.c
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,8 @@ static void copy_vbi_data(struct ivtv *itv, int lines, u32 pts_stamp)
size = 4 + ((43 * line + 3) & ~3);
} else {
memcpy(dst + sd, "itv0", 4);
cpu_to_le32s(&linemask[0]);
cpu_to_le32s(&linemask[1]);
memcpy(dst + sd + 4, &linemask[0], 8);
size = 12 + ((43 * line + 3) & ~3);
}
Expand Down

0 comments on commit 6e1a637

Please sign in to comment.