From patchwork Tue Apr 7 16:21:43 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: pkv X-Patchwork-Id: 18749 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 8601744AFEF for ; Tue, 7 Apr 2020 19:21:56 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 648FE68B5F2; Tue, 7 Apr 2020 19:21:56 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from kore.r1ch.net (kore.r1ch.net [142.4.216.103]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 7E85268B458 for ; Tue, 7 Apr 2020 19:21:50 +0300 (EEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=r1ch.net; s=io; h=Content-Type:MIME-Version:Date:Message-ID:Cc:Subject:From:To:Sender: Reply-To:Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date :Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Id:List-Help:List-Unsubscribe:List-Subscribe:List-Post: List-Owner:List-Archive; bh=BPS2i8TbyWOLl+ZKrbUAswysIxzyM8KZxcyi4Pg+V4w=; b=f Yia6SOA7lvUwkfz1kbRD5LVEZoqJG6hFXG53djLltaewM8ehdiV566aPbaznPgi36IwTCk65CGwja KTq2z1isfb1QmRe0wypRbdwxlmuX1Oh3skFkbGygzByJU3Beg/GVHDI6BCbpwH7BGnbAXJAgnhdI1 DwrsId05RDq9+CDc=; Received: from 176-159-7-188.abo.bbox.fr ([176.159.7.188] helo=[192.168.1.92]) by kore.r1ch.net with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jLqyv-0003AL-RF; Tue, 07 Apr 2020 16:21:45 +0000 To: ffmpeg-devel@ffmpeg.org From: pkv Organization: obsproject Message-ID: <47b48107-4679-ca98-5b8c-d6552ff5f0e0@obsproject.com> Date: Tue, 7 Apr 2020 18:21:43 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.6.0 MIME-Version: 1.0 Content-Language: fr Subject: [FFmpeg-devel] avformat/libsrt: Change latency option to milliseconds 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: Bryan Torres , Marc Cymontkowski , Ben Torell , Maxim Sharabayko Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Hi, The latency option (and related options) are currently in microseconds in FFmpeg (avformat/libsrt.c). The libsrt API documents them in milliseconds while FFmpeg doc does not specify any unit. This patch changes these options to milliseconds and updates the FFmpeg doc. The microsecond implicit unit has caused confusion for both FFmpeg and obs-studio users: - https://github.com/Haivision/srt/issues/1223 - https://obsproject.com/mantis/view.php?id=1617 Regards pkv From 02a3000b91b81aa0c68ea1c01c2f88c8a4f3c754 Mon Sep 17 00:00:00 2001 From: pkv Date: Tue, 7 Apr 2020 18:08:22 +0200 Subject: [PATCH] avformat/libsrt: Change latency option to milliseconds The latency option (and related options) are currently in microseconds. The libsrt API documents them in milliseconds while FFmpeg doc does not specify anything. This patch changes these options to milliseconds and updates the FFmpeg doc. The microsecond unit has caused confusion for both FFmpeg and obs-studio users: - https://github.com/Haivision/srt/issues/1223 - https://obsproject.com/mantis/view.php?id=1617 --- doc/protocols.texi | 2 +- libavformat/libsrt.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/doc/protocols.texi b/doc/protocols.texi index e510019f2d..b0e018b1ea 100644 --- a/doc/protocols.texi +++ b/doc/protocols.texi @@ -1287,7 +1287,7 @@ IP Type of Service. Applies to sender only. Default value is 0xB8. IP Time To Live. Applies to sender only. Default value is 64. @item latency -Timestamp-based Packet Delivery Delay. +Timestamp-based Packet Delivery Delay in msec. Used to absorb bursts of missed packet retransmissions. This flag sets both @option{rcvlatency} and @option{peerlatency} to the same value. Note that prior to version 1.3.0 diff --git a/libavformat/libsrt.c b/libavformat/libsrt.c index 2d6fc4b7e7..b4a4e94d45 100644 --- a/libavformat/libsrt.c +++ b/libavformat/libsrt.c @@ -302,9 +302,9 @@ static int libsrt_set_options_pre(URLContext *h, int fd) { SRTContext *s = h->priv_data; int yes = 1; - int latency = s->latency / 1000; - int rcvlatency = s->rcvlatency / 1000; - int peerlatency = s->peerlatency / 1000; + int64_t latency = s->latency; + int64_t rcvlatency = s->rcvlatency; + int64_t peerlatency = s->peerlatency; int connect_timeout = s->connect_timeout; if ((s->mode == SRT_MODE_RENDEZVOUS && libsrt_setsockopt(h, fd, SRTO_RENDEZVOUS, "SRTO_RENDEZVOUS", &yes, sizeof(yes)) < 0) ||