From patchwork Tue Jan 9 08:15:39 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Herkt X-Patchwork-Id: 7233 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.2.78.2 with SMTP id r2csp4221696jaa; Tue, 9 Jan 2018 10:10:54 -0800 (PST) X-Google-Smtp-Source: ACJfBosIrVbgcuDvB3QJuxkQ3PjX9k6UeCsYYb0ND91BFlkdAi4FPcqWHXPLoxR84SXVUSkJJvl7 X-Received: by 10.223.165.84 with SMTP id j20mr14096902wrb.278.1515521454915; Tue, 09 Jan 2018 10:10:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1515521454; cv=none; d=google.com; s=arc-20160816; b=0UCNrLzBRLIKO5JjdyfurOfMo3vIlNuxlZWGn9DG3FrNaSUxWV2sDs/EtgwJYPP5J9 yHAxmik7N9a19TB11mhLIrWqt1Ge0oqWGOQ8fMRWaMeWAFbQRZST4fkWY++JuwPL2wa/ BLwFIZg/HA3uEKmeQxHVfGtmlnvNnmloc/v1JVeywuAjBiQGMcBmAclUqjtkKWzpJz0D b4eyGt55hHtFvwhZtoJR7U5Qpd4WUqxtJO4uK8zPll9CHKyt9ZQ3RfsUUWB+o7fou5/O dZHzn7/iV+O4pQ8s5OLZ2jy9m/2QARqlO8y3MyeCcqI4S9JWeM9meUJOb1B//7Y7lx+X T/bQ== 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=5bWjArfkxBsOhprvFYMdcc84uNqaDXTULej5uslL9S0=; b=DcLWCKU86Tg3OyJliimUnwEZJHA9E7tOce7SttLf/rO9ookZfIcgE6gdxNTPOUBV2a DtiKToU8Ob4JKzO9H77QsR1jkhKOFD+yBodC6SasJB0ZWZ6+luoRSZu80Z/T3bh12FQg ZD6jGVxM6JQPmk5/KhytcQVAn42k3hEDeUVL4WwPJ7R3rcn+0kai+VwRRmqu7ywnPXsd YEpYtNyuUZtzgLMyga6gnE/ofKdO4S9CZjiK5OhUeSVmNKzs4iZyn7YpiF95wi/JlTmm KUrUGHXB1KM1V3slKJ0H9WHVkL0ttjrWRbsA+Bd5VEfMa69+hxnIEk9QZLdB7vqhJ3ZM agGg== 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 l26si9734357wmc.162.2018.01.09.10.10.54; Tue, 09 Jan 2018 10:10:54 -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 4ADFC68993F; Tue, 9 Jan 2018 20:10:51 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from srsfckn.biz (srsfckn.biz [136.243.89.164]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id D2E12680A65 for ; Tue, 9 Jan 2018 10:16:33 +0200 (EET) Received: from localhost (localhost [127.0.0.1]) by srsfckn.biz (Postfix) with ESMTP id E5BEDA20001; Tue, 9 Jan 2018 09:16:34 +0100 (CET) X-Virus-Scanned: amavisd-new at srsfckn.biz Received: from srsfckn.biz ([127.0.0.1]) by localhost (srsfckn.biz [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id uW85AMAPgp_q; Tue, 9 Jan 2018 09:16:19 +0100 (CET) Received: from Sakuya.Gensokyo (dslb-088-068-165-188.088.068.pools.vodafone-ip.de [88.68.165.188]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by srsfckn.biz (Postfix) with ESMTPSA id 5029BA20000; Tue, 9 Jan 2018 09:16:15 +0100 (CET) From: Martin Herkt To: ffmpeg-devel@ffmpeg.org Date: Tue, 9 Jan 2018 09:15:39 +0100 Message-Id: <20180109081539.834-1-lachs0r@srsfckn.biz> X-Mailer: git-send-email 2.15.1 X-Mailman-Approved-At: Tue, 09 Jan 2018 20:10:49 +0200 Subject: [FFmpeg-devel] [PATCH] avformat/avio: fix off-by-one in retry_transfer_wrapper 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: Martin Herkt MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" This reportedly fixes hangs with segmented streams. Affects playback via Schannel on Windows in particular. Can be reproduced with any YouTube live stream. --- libavformat/avio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavformat/avio.c b/libavformat/avio.c index 63e82872f7..cd1e325a6b 100644 --- a/libavformat/avio.c +++ b/libavformat/avio.c @@ -393,7 +393,7 @@ static inline int retry_transfer_wrapper(URLContext *h, uint8_t *buf, } } else if (ret == AVERROR_EOF) return (len > 0) ? len : AVERROR_EOF; - else if (ret < 0) + else if (ret <= 0) return ret; if (ret) { fast_retries = FFMAX(fast_retries, 2);