From patchwork Fri Dec 9 20:17:47 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Juergen Lock X-Patchwork-Id: 12913 Received: from mail.tu-berlin.de ([130.149.7.33]) by www.linuxtv.org with esmtp (Exim 4.72) (envelope-from ) id 1RZ6ve-00078w-AY for vdr@linuxtv.org; Fri, 09 Dec 2011 21:20:22 +0100 X-tubIT-Incoming-IP: 78.46.108.116 Received: from gelbbaer.kn-bremen.de ([78.46.108.116] helo=smtp.kn-bremen.de) by mail.tu-berlin.de (exim-4.75/mailfrontend-2) with esmtp for id 1RZ6ve-00072U-GY; Fri, 09 Dec 2011 21:20:22 +0100 Received: by smtp.kn-bremen.de (Postfix, from userid 10) id E14751E00233; Fri, 9 Dec 2011 21:20:20 +0100 (CET) Received: from triton8.kn-bremen.de (noident@localhost [127.0.0.1]) by triton8.kn-bremen.de (8.14.4/8.14.4) with ESMTP id pB9KHmxW043369; Fri, 9 Dec 2011 21:17:48 +0100 (CET) (envelope-from vdr-l@triton8.kn-bremen.de) Received: (from vdr-l@localhost) by triton8.kn-bremen.de (8.14.4/8.14.3/Submit) id pB9KHlTs043368; Fri, 9 Dec 2011 21:17:47 +0100 (CET) (envelope-from vdr-l) From: Juergen Lock Date: Fri, 9 Dec 2011 21:17:47 +0100 To: Petri Hintukainen Message-ID: <20111209201747.GA43141@triton8.kn-bremen.de> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) X-PMX-Version: 5.6.1.2065439, Antispam-Engine: 2.7.2.376379, Antispam-Data: 2011.12.9.201221 X-PMX-Spam: Gauge=IIIIIIII, Probability=8%, Report=' BODYTEXTP_SIZE_3000_LESS 0, BODY_SIZE_1000_1099 0, BODY_SIZE_2000_LESS 0, BODY_SIZE_5000_LESS 0, BODY_SIZE_7000_LESS 0, __ANY_URI 0, __CD 0, __CT 0, __CT_TEXT_PLAIN 0, __HAS_MSGID 0, __MIME_TEXT_ONLY 0, __MIME_VERSION 0, __SANE_MSGID 0, __SUBJ_ALPHA_END 0, __TO_MALFORMED_2 0, __URI_NO_MAILTO 0, __URI_NO_PATH 0, __URI_NO_WWW 0, __USER_AGENT 0' X-LSpam-Score: -6.9 (------) X-LSpam-Report: No, score=-6.9 required=5.0 tests=BAYES_00=-1.9, RCVD_IN_DNSWL_HI=-5 autolearn=ham Cc: vdr@linuxtv.org Subject: [vdr] [PATCH] random vdr-sxfe xvdr+tcp:// restart failures X-BeenThere: vdr@linuxtv.org X-Mailman-Version: 2.1.13 Precedence: list Reply-To: VDR Mailing List List-Id: VDR Mailing List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Dec 2011 20:20:22 -0000 Status: O X-Status: X-Keywords: X-UID: 25457 Hi! I finally debugged this and found the read() looking for the initial "DATA\r\n" was sometimes gobbling up too much, i.e. the start of the first ts packet when the server was sending it fast enough which caused the demuxer to be out of sync and interpreting parts of the ts packet as header with a way too big data size, and that caused vdr-sxfe to bail out. This patch fixed it for me: (Tho one may want to replace the other occurences of "6" with "sizeof("DATA\r\n") - 1" there too to make clear where they come from.) HTH, :) Juergen --- a/xine_input_vdr.c +++ b/xine_input_vdr.c @@ -5639,7 +5662,7 @@ static int connect_tcp_data_stream(vdr_i LOGERR("Data stream write error (TCP)"); } else if( XIO_READY != io_select_rd(fd_data)) { LOGERR("Data stream poll failed (TCP)"); - } else if((n=read(fd_data, tmpbuf, sizeof(tmpbuf))) <= 0) { + } else if((n=read(fd_data, tmpbuf, sizeof("DATA\r\n") - 1)) <= 0) { LOGERR("Data stream read failed (TCP)"); } else if(n<6 || strncmp(tmpbuf, "DATA\r\n", 6)) { tmpbuf[n] = 0;