===================================================================
@@ -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);