From patchwork Fri Dec 1 21:09:15 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tristan Matthews X-Patchwork-Id: 6498 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.2.161.94 with SMTP id m30csp1645190jah; Fri, 1 Dec 2017 13:17:52 -0800 (PST) X-Google-Smtp-Source: AGs4zMZb08n5OAok4vCiLOksk9RlAzN+9bNjsJwAhWLjkM0xjORqhYiZsMdoDzM+Hkycf3gC7FLt X-Received: by 10.223.146.167 with SMTP id 36mr6082265wrn.102.1512163072518; Fri, 01 Dec 2017 13:17:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1512163072; cv=none; d=google.com; s=arc-20160816; b=WGIpot74+WYEM6KP0cdacGiaVQl4BTOxLRVqdJzUCuAZueL3/dt8IRN/y7B484sgNu qqkiYrHSxU6Ajga0XyL63YxKzs2Tm+IaUV/EWUVx85r7ZpYV1LDPXD3s32JIzNNYy10i 7p6PAXIAUQIf2aASXopj/Cj/sCdwj/Utkb5VmNlF/evgLXQPaGRLC6/MSTi5I1i9nqTV mmfrrQDPstIqNFfnKcCUrBGqic3fRFNisi29DTcwA50oo3BPE/6Bw5prsPMsXyUZQ8xb 8Ca3a6fgK8yuDaJ/05g6i/FM0UxECiYKLIMTCCtGiMGTt+JE9/tX/gs5wxB4So1Jg0/f pN8Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:cc:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:message-id:date:to:from:delivered-to :arc-authentication-results; bh=TcsjGiwZX+Y6SFGHJiNfQne+MnBtyYGYywj5J6kaTpo=; b=srWPVyM0moqV54/mpEqy5Vic0SenFwL9usQ4WN9xzvdr9peccVdTDJA5AJUmex0xV8 HfPJZWR9349FT38Hd8Wi/Wi8a0DGE/YoX0zyeUnfrF3ePOgOGewXF3Pu9nVuJreccV3l ZWG9KH9R6BwRMNnjwdPdY3Qkiu0r3+ev+07WqSrxjB45PvLrgLvAAmvQMFqD1HHEQzw+ 9Wa6uWxMQlKGyioWEKBh9uPNwFrz945ky45McF82kYTExJEnWzYDV3EqfJ6AwUO4Y9Nc F8TK4KlHzniGUm2rQw1SEYET3Cs2MeWyy8nLW6fLON50S2rzYYZ4Ci/IuCU9YHTgjgcV SeLA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id 2si1292653wmf.44.2017.12.01.13.17.51; Fri, 01 Dec 2017 13:17:52 -0800 (PST) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 4310D68A4E4; Fri, 1 Dec 2017 23:17:47 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-qk0-f182.google.com (mail-qk0-f182.google.com [209.85.220.182]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id DB4A968A4A9 for ; Fri, 1 Dec 2017 23:17:40 +0200 (EET) Received: by mail-qk0-f182.google.com with SMTP id d141so14868952qkc.12 for ; Fri, 01 Dec 2017 13:17:44 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=QK4VAXNUQIi7FXpHD3gLdQ6Ybu8rlzm3owZo5frpvOc=; b=AJccWX9YdR8o62uem1+YWM8nv5IeAieKiFsLDJ1t2Bokry+75Uj8jLAScfoxtYJG62 RcRHg8crju4m8jHTHMS6+/bXpE9dmLh0ZBT2FuhhHu0vhivNqwb3pcLEzicTRDxE9zQT sBoqZ6hRIL4P6sLJ1tKni4FbqjV/bpDAENv59+BfzqEk5gAINFl+LtUuBgaLNsoi/lg4 p6c0ijLQQGECOM9FTq9y/XfwVmyIl7hiJrzR8rmfLuJpPmfYPP2+ELW6yK2/gv+mvDKw VEv0a93wZt0NNlY7S69Jxl/hpFB8ZoLY331jk03RyvK38iGzrajqt3L5Vdwz4ViOLO1w /WJQ== X-Gm-Message-State: AKGB3mK6ig+3zrdCFROPGPLFOsdHeiphXe1A8FbPSJPyJcGu4jCCSM6n jVFaZ4WmACqQANRg2FU2nObDLw== X-Received: by 10.55.72.6 with SMTP id v6mr10076404qka.333.1512162579769; Fri, 01 Dec 2017 13:09:39 -0800 (PST) Received: from little-ed.pompomgali.com (cable-192.222.231.18.electronicbox.net. [192.222.231.18]) by smtp.gmail.com with ESMTPSA id s4sm5089715qkd.66.2017.12.01.13.09.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 01 Dec 2017 13:09:39 -0800 (PST) From: Tristan Matthews To: ffmpeg-devel@ffmpeg.org Date: Fri, 1 Dec 2017 16:09:15 -0500 Message-Id: <20171201210915.18571-1-tmatth@videolan.org> X-Mailer: git-send-email 2.14.1 Subject: [FFmpeg-devel] [PATCH] rtsp: only break on parse_rtsp_message on error X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Cc: Tristan Matthews MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Fix suggested by Luca Barbato. This was causing spurious EOFs when using -rtsp_transport udp, as reported in https://bugzilla.libav.org/show_bug.cgi?id=1103 --- libavformat/rtsp.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libavformat/rtsp.c b/libavformat/rtsp.c index b6da61b95e..cf7cdb2f2b 100644 --- a/libavformat/rtsp.c +++ b/libavformat/rtsp.c @@ -2009,7 +2009,9 @@ static int udp_read_packet(AVFormatContext *s, RTSPStream **prtsp_st, } #if CONFIG_RTSP_DEMUXER if (rt->rtsp_hd && p[0].revents & POLLIN) { - return parse_rtsp_message(s); + if ((ret = parse_rtsp_message(s)) < 0) { + return ret; + } } #endif } else if (n == 0 && ++timeout_cnt >= MAX_TIMEOUTS) {