From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.ffmpeg.org (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTPS id B79094FDF0 for ; Wed, 2 Jul 2025 17:00:40 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.ffmpeg.org (Postfix) with ESMTP id 5BAA468D4C1; Wed, 2 Jul 2025 19:57:36 +0300 (EEST) Received: from btbn.de (btbn.de [144.76.60.213]) by ffbox0-bg.ffmpeg.org (Postfix) with ESMTPS id C70BE68D2DC for ; Wed, 2 Jul 2025 19:57:10 +0300 (EEST) Received: from [authenticated] by btbn.de (Postfix) with ESMTPSA id 7593C27FFCCAC; Wed, 02 Jul 2025 18:57:07 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rothenpieler.org; s=mail; t=1751475427; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=/I2/V+y8xymWMffYr6Rqph6ZmisXQ7sLL5Hp8wCEWJE=; b=gMK3WeZTNfQRQcecJ+ns8zmNP4FjspXXFw+BeNRPxXi+BU6mX3VKtrqI7Tbi62CBR3HpZK XOoVAFVixLiFesaNcINyoC4nxPkiI+RHKaQY2JqBotmHQqzih+Wl9UDMIXVV0o+HODB2MZ 9yEj1PcreM7P6ySplC1AThh4lmlCZGX07TEvlX6/pvJ1KvnwTmDyysdidaailrd2RmV6Od gccQcVCqm7Z9pl9FhmLS8Nw923pAEOFIk2sl2dFD4U0VVODDNjXx4p9LwvhESubrxSdxkl PZZQjWDaykQUAnXjPrMfywD5L9/udLl2Q4vzdAAXmMvfaDC8gJa0HucPSsV9AQ== From: Timo Rothenpieler To: ffmpeg-devel@ffmpeg.org Date: Wed, 2 Jul 2025 18:56:38 +0200 Message-ID: <20250702165655.1325-11-timo@rothenpieler.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250702165655.1325-1-timo@rothenpieler.org> References: <20250702165655.1325-1-timo@rothenpieler.org> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 10/18] avformat/tls: fix udp init X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 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: Timo Rothenpieler Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: --- libavformat/tls.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/libavformat/tls.c b/libavformat/tls.c index f888970969..bd9c05e6dc 100644 --- a/libavformat/tls.c +++ b/libavformat/tls.c @@ -81,7 +81,7 @@ int ff_tls_open_underlying(TLSShared *c, URLContext *parent, const char *uri, AV if (ret < 0) return ret; - if (c->listen) + if (c->listen && !c->is_dtls) snprintf(opts, sizeof(opts), "?listen=1"); av_url_split(NULL, 0, NULL, 0, c->underlying_host, sizeof(c->underlying_host), &port, NULL, 0, uri); @@ -95,7 +95,7 @@ int ff_tls_open_underlying(TLSShared *c, URLContext *parent, const char *uri, AV c->listen = 1; } - ff_url_join(buf, sizeof(buf), c->is_dtls ? "udp" : "tcp", NULL, c->underlying_host, port, "%s", p); + ff_url_join(buf, sizeof(buf), c->is_dtls ? "udp" : "tcp", NULL, (c->is_dtls && c->listen) ? "" : c->underlying_host, port, "%s", p); hints.ai_flags = AI_NUMERICHOST; if (!getaddrinfo(c->underlying_host, NULL, &hints, &ai)) { @@ -127,7 +127,13 @@ int ff_tls_open_underlying(TLSShared *c, URLContext *parent, const char *uri, AV freeenv_utf8(env_http_proxy); if (c->is_dtls) { - av_dict_set_int(options, "connect", 1, 0); + if (c->listen) { + av_dict_set_int(options, "localport", port, 0); + av_dict_set(options, "localaddr", c->underlying_host, 0); + } else { + av_dict_set_int(options, "localport", 0, 0); + av_dict_set_int(options, "connect", 1, 0); + } av_dict_set_int(options, "fifo_size", 0, 0); /* Set the max packet size to the buffer size. */ av_dict_set_int(options, "pkt_size", c->mtu, 0); -- 2.49.0 _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".