]> Pileus Git - ~andy/linux/commitdiff
V4L/DVB (11091): cx18, ivtv: Ensure endianess for linemasks in VBI embedded in MPEG...
authorAndy Walls <awalls@radix.net>
Sat, 14 Mar 2009 23:03:26 +0000 (20:03 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Mon, 30 Mar 2009 15:43:28 +0000 (12:43 -0300)
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>
drivers/media/video/cx18/cx18-vbi.c
drivers/media/video/ivtv/ivtv-vbi.c

index 355737bff13efc5c6cd8c9d42b322f6a0056c6cb..99f9b2c86b0c798fe0cc13d1d323192b69882af0 100644 (file)
@@ -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);
        }
index 5c5d1c462fefe7cd752e2ffa77b7ddc36ae4a024..f420d31b937dcfccfb8ee64c76eade9197d62979 100644 (file)
@@ -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);
        }