From patchwork Mon Jan 29 12:50:07 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mauro Carvalho Chehab X-Patchwork-Id: 10189661 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 6247960375 for ; Mon, 29 Jan 2018 12:50:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 56C13288D7 for ; Mon, 29 Jan 2018 12:50:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 422A328902; Mon, 29 Jan 2018 12:50:18 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D354328901 for ; Mon, 29 Jan 2018 12:50:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751591AbeA2MuQ (ORCPT ); Mon, 29 Jan 2018 07:50:16 -0500 Received: from osg.samsung.com ([64.30.133.232]:51081 "EHLO osg.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751480AbeA2MuO (ORCPT ); Mon, 29 Jan 2018 07:50:14 -0500 Received: from localhost (localhost [127.0.0.1]) by osg.samsung.com (Postfix) with ESMTP id 3A0521F8C1; Mon, 29 Jan 2018 04:50:14 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at dev.s-opensource.com Received: from osg.samsung.com ([127.0.0.1]) by localhost (localhost [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id nUZv4Pqm63Wz; Mon, 29 Jan 2018 04:50:11 -0800 (PST) Received: from smtp.s-opensource.com (unknown [179.95.21.202]) by osg.samsung.com (Postfix) with ESMTPSA id 98F231F8A6; Mon, 29 Jan 2018 04:50:11 -0800 (PST) Received: from mchehab by smtp.s-opensource.com with local (Exim 4.89) (envelope-from ) id 1eg8sz-0000qn-2E; Mon, 29 Jan 2018 07:50:09 -0500 From: Mauro Carvalho Chehab Cc: Mauro Carvalho Chehab , Linux Media Mailing List , Mauro Carvalho Chehab , Ingo Molnar , Mauro Carvalho Chehab Subject: [PATCH 1/2] media: dvb_demux: Better handle discontinuity errors Date: Mon, 29 Jan 2018 07:50:07 -0500 Message-Id: X-Mailer: git-send-email 2.14.3 To: unlisted-recipients:; (no To-header on input) Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Mauro Carvalho Chehab When a packet discontinuity happens, it is not just the payload that was lost. The headers are lost too. So, the max size is not 184 but, instead 188. Also, while printing warnings, make a distinction between MPEG-TS indicated discontinuity and detected one. Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Mauro Carvalho Chehab --- drivers/media/dvb-core/dvb_demux.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/media/dvb-core/dvb_demux.c b/drivers/media/dvb-core/dvb_demux.c index 5047a1f87050..1a6e2e61952a 100644 --- a/drivers/media/dvb-core/dvb_demux.c +++ b/drivers/media/dvb-core/dvb_demux.c @@ -310,8 +310,9 @@ static int dvb_dmx_swfilter_section_packet(struct dvb_demux_feed *feed, if (!ccok || dc_i) { #ifdef CONFIG_DVB_DEMUX_SECTION_LOSS_LOG - dprintk("dvb_demux.c discontinuity detected %d bytes lost\n", - count); + dprintk("discontinuity %s: %d bytes lost\n", + !ccok ? "detected" : "indicated", + count + 4); /* * those bytes under sume circumstances will again be reported * in the following dvb_dmx_swfilter_section_new @@ -320,6 +321,9 @@ static int dvb_dmx_swfilter_section_packet(struct dvb_demux_feed *feed, /* * Discontinuity detected. Reset pusi_seen to * stop feeding of suspicious data until next PUSI=1 arrives + * + * FIXME: does it make sense if the MPEG-TS is the one + * reporting discontinuity? */ feed->pusi_seen = false; dvb_dmx_swfilter_section_new(feed);