From patchwork Sun Feb 7 20:36:37 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lars Hanisch X-Patchwork-Id: 77639 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o17KafCC020747 for ; Sun, 7 Feb 2010 20:36:41 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753504Ab0BGUgk (ORCPT ); Sun, 7 Feb 2010 15:36:40 -0500 Received: from mxweblb05fl.versatel.de ([89.246.255.248]:35029 "EHLO mxweblb05fl.versatel.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750921Ab0BGUgj (ORCPT ); Sun, 7 Feb 2010 15:36:39 -0500 Received: from ens28fl.versatel.de (ens28fl.versatel.de [82.140.32.10]) by mxweblb05fl.versatel.de (8.13.1/8.13.1) with ESMTP id o17Kabqk032114 for ; Sun, 7 Feb 2010 21:36:37 +0100 Received: from cinnamon-sage.de (i577A53FE.versanet.de [87.122.83.254]) (authenticated bits=0) by ens28fl.versatel.de (8.12.11.20060308/8.12.11) with SMTP id o17KabEj023436 for ; Sun, 7 Feb 2010 21:36:37 +0100 Received: from 192.168.23.2:49634 by cinnamon-sage.de for ,, ; 07.02.2010 21:36:37 Message-ID: <4B6F2455.4040001@cinnamon-sage.de> Date: Sun, 07 Feb 2010 21:36:37 +0100 From: Lars Hanisch User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; de; rv:1.9.1.7) Gecko/20100111 Thunderbird/3.0.1 MIME-Version: 1.0 To: Hans Verkuil CC: Andy Walls , linux-media@vger.kernel.org Subject: Re: ivtv-utils/test/ps-analyzer.cpp: error in extracting SCR? References: <4B6A123F.5080500@cinnamon-sage.de> <1265253363.3122.106.camel@palomino.walls.org> <201002040825.32062.hverkuil@xs4all.nl> In-Reply-To: <201002040825.32062.hverkuil@xs4all.nl> X-Virus-Scanned: ClamAV version 0.92, clamav-milter version 0.92 on 82.140.32.218 X-Virus-Status: Clean Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Sun, 07 Feb 2010 20:36:41 +0000 (UTC) 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);