diff mbox

ivtv-utils/test/ps-analyzer.cpp: error in extracting SCR?

Message ID 4B6F2455.4040001@cinnamon-sage.de (mailing list archive)
State Not Applicable
Headers show

Commit Message

Lars Hanisch Feb. 7, 2010, 8:36 p.m. UTC
None
diff mbox

Patch

Index: test/ps-analyzer.cpp
===================================================================
--- test/ps-analyzer.cpp	(Revision 4152)
+++ test/ps-analyzer.cpp	(Arbeitskopie)
@@ -194,11 +194,11 @@ 
 	scr |= (u64)(hdr[2] & 3) << 13;
 	scr |= (u64)hdr[3] << 5;
 	scr |= (u64)(hdr[4] & 0xf8) >> 3;
-	scr_ext = (hdr[4] & 0x1) << 8;
-	scr_ext |= hdr[5];
-	mux_rate = (hdr[6] & 0x7f) << 15;
-	mux_rate |= hdr[7] << 7;
-	mux_rate |= (hdr[8] & 0xfe) >> 1;
+	scr_ext = (unsigned)(hdr[4] & 0x3) << 7;
+	scr_ext |= (hdr[5] & 0xfe) >> 1;
+	mux_rate = (unsigned)(hdr[6]) << 14;
+	mux_rate |= (unsigned)(hdr[7]) << 6;
+	mux_rate |= (unsigned)(hdr[8] & 0xfc) >> 2;
 	if (g_verbose)
 		printf("%lld: pack scr=%lld scr_ext=%3u scr=%lld ns mux_rate=%u\n", pos, scr, scr_ext, scr2ns(scr, scr_ext), mux_rate);