From patchwork Thu Apr 30 18:35:03 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: vectronic X-Patchwork-Id: 19405 Return-Path: X-Original-To: patchwork@ffaux-bg.ffmpeg.org Delivered-To: patchwork@ffaux-bg.ffmpeg.org Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by ffaux.localdomain (Postfix) with ESMTP id 0C4E844B7C8 for ; Thu, 30 Apr 2020 21:42:11 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id D9C7968C79F; Thu, 30 Apr 2020 21:42:10 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ej1-f65.google.com (mail-ej1-f65.google.com [209.85.218.65]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id BA91468C4AA for ; Thu, 30 Apr 2020 21:42:04 +0300 (EEST) Received: by mail-ej1-f65.google.com with SMTP id q8so5538056eja.2 for ; Thu, 30 Apr 2020 11:42:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=2FYSnRiGyUB2aLzJli8Y3FUAywivfazO9AAwnvjs5Do=; b=A1vO2wZadjn0AmbEGHETcugRfUAlrInyCA2htYjV0z8XNxQucfoEdp/SNOaf6bJTFi vz7N+W7Vqhu8iqifafBp4YJm6p0HjtLY6wKsAfLohiLZeWWLdo6EUUu46P0UH2obQk9G thuKhJAuh5J0CZ38GhVMA/1U2p4qYq/JTq1eh4JsjfXPb8zmvVbToaFjJrnuxJFSDbWM bP6AKRRwdJG1ooR8IjpBYk0FvwSSlcuH578VRFlZbEaMyQH8FYwxoRCcIBRXcDmpLkZg YmZookjhVRJJR4uMz1f7xxnRbOy+c1DJe5RuYlUne2TGWcGrnsf8aJg6brUiss7xcQcZ vf7A== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=2FYSnRiGyUB2aLzJli8Y3FUAywivfazO9AAwnvjs5Do=; b=VRD4rNriVHxmvSlqGgwOZVth9e7oNSB5yzhsr8YSK+yrS1jOKzl/ghlD0lZvPRdWHK 08j/Atw4bPah7SWhLW9jBTKLwHbSeUSqQRj6KgLHe6MPoWw6HHbn6kaaG9/Bcs5XnpLw ObOiid2SEr91fe+vquSDtzvtlqH98L7Lwe1+x4kZE7h9pGEyit88l97fWbMO2RykXFOK +QVI0ldKe0JkYHrWMJbmg3qPlmMt2pn/HFO0RhVHhXePs0GXCjCHKS3AA1QPrWp38JHw yHpndyOGRHekusQ/Qo4j2wPeCukqRvPlNdgtBCLYqYVLgUjEi/7cNeqy/SGfYQUquNo+ tMBQ== X-Gm-Message-State: AGi0PubAqZjbkGqiY4hBzzlmPUtuhtPOMdnO7o0a1qFbl3U6QCj7nCtn jAACQpMY1IST5Rj7z0NtyJW3/duPmb0= X-Google-Smtp-Source: APiQypJ2O6hUGKR12wBDd2b/SwM8a8ABKhIMRoWcxiaES2GmOR3MqFwxV1n66Lsl1CZAUZkBrW8+pQ== X-Received: by 2002:a05:6000:10c2:: with SMTP id b2mr5999868wrx.118.1588271722900; Thu, 30 Apr 2020 11:35:22 -0700 (PDT) Received: from localhost.localdomain (cpc76904-dals22-2-0-cust471.20-2.cable.virginm.net. [81.106.45.216]) by smtp.gmail.com with ESMTPSA id w83sm604818wmb.37.2020.04.30.11.35.21 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 30 Apr 2020 11:35:22 -0700 (PDT) From: vectronic To: ffmpeg-devel@ffmpeg.org Date: Thu, 30 Apr 2020 19:35:03 +0100 Message-Id: <20200430183503.83363-2-hello.vectronic@gmail.com> X-Mailer: git-send-email 2.24.2 (Apple Git-127) In-Reply-To: <20200430183503.83363-1-hello.vectronic@gmail.com> References: <20200430183503.83363-1-hello.vectronic@gmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 1/1] avformat hls restore options dict when retrying with a new connection 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: vectronic Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" as per avio_open2 semantics after open_url_keepalive has failed, the options dictionary will have been modified and needs restoring before attempting a new connection Signed-off-by: vectronic --- libavformat/hls.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libavformat/hls.c b/libavformat/hls.c index fc45719d1c..9800c9bb8d 100644 --- a/libavformat/hls.c +++ b/libavformat/hls.c @@ -679,6 +679,10 @@ static int open_url(AVFormatContext *s, AVIOContext **pb, const char *url, av_log(s, AV_LOG_WARNING, "keepalive request failed for '%s' with error: '%s' when opening url, retrying with new connection\n", url, av_err2str(ret)); + + av_dict_copy(&tmp, opts, 0); + av_dict_copy(&tmp, opts2, 0); + ret = s->io_open(s, pb, url, AVIO_FLAG_READ, &tmp); } } else {