From 751f50f850d8c31f795f18e8a5d6723a0484574c Mon Sep 17 00:00:00 2001 From: Stefan Seyfried Date: Sun, 4 Dec 2011 14:37:32 +0100 Subject: [PATCH] zapit: fix SDT scan the SDT scan could sometimes erase half of a transponder after a read error from the demux device device (e.g. due to bad reception had occured or the channel had been changed since scan had started. Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/63af4043a7d11a538bad0d7f4c9a97671df7c6f7 Author: Stefan Seyfried Date: 2011-12-04 (Sun, 04 Dec 2011) --- src/zapit/src/sdt.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/zapit/src/sdt.cpp b/src/zapit/src/sdt.cpp index 210bcb25d..41fb0c9be 100644 --- a/src/zapit/src/sdt.cpp +++ b/src/zapit/src/sdt.cpp @@ -2,10 +2,11 @@ * $Id: sdt.cpp,v 1.44 2003/03/14 08:22:04 obi Exp $ * * (C) 2002, 2003 by Andreas Oberritter + * (C) 2011 Stefan Seyfried, all changes by me are GPLv3+ only! * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or + * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, @@ -15,8 +16,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - * + * Foundation, 51 Franklin Street, Suite 500 Boston, MA 02110-1335 USA */ #include @@ -421,9 +421,10 @@ int parse_current_sdt( const t_transport_stream_id p_transport_stream_id, const do { if ((dmx->sectionFilter(0x11, filter, mask, 8) < 0) || (dmx->Read(buffer, SDT_SIZE) < 0)) { - delete dmx; - return ret; + ret = -1; /* if we already received something, throw it away anyway */ + break; } + dmx->Stop(); section_length = ((buffer[1] & 0x0F) << 8) | buffer[2];