From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id C5F1942AC6 for ; Sun, 12 Jun 2022 15:32:23 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 7A65068B42F; Sun, 12 Jun 2022 18:32:20 +0300 (EEST) Received: from mail-wm1-f42.google.com (mail-wm1-f42.google.com [209.85.128.42]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 4C01468B3DB for ; Sun, 12 Jun 2022 18:32:14 +0300 (EEST) Received: by mail-wm1-f42.google.com with SMTP id m32-20020a05600c3b2000b0039756bb41f2so1856932wms.3 for ; Sun, 12 Jun 2022 08:32:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=date:from:to:subject:message-id:mail-followup-to:references :mime-version:content-disposition:in-reply-to:user-agent; bh=PAKltMh0Ipp0RC7yIIJLIMLwRekFKaMEVrki2BnUqCc=; b=D8v1m9wTOJ1TUXu7s3wdUkUIqKI928EMQN0TWnicQ3MIzaP41IcRotXMlWIG6dmGIk jix5QEdEvvptAEKaYXyNA5YwCqEsIbR6TR1oPZDo0uVtZ1Ib3jyUifwPnm4DuBp1w9iR hwoyahwmhFsAn+3aLEN6XzjW24x83izR3bQO4Vu6JmD50jFRKLimoN9K3lt1Ls4cwqXD P9cpb+jI3VXvWzhBzXHoyHnVy3sh1hVyxVNCaCCbofQJU7tYpri2zVWxqPVDYrYqStxY KOpbke7xOtVmPDhdjSirlrv6NdiiTUABZuxvHvN31YUOItsUs0I+/D7mQfseWKfKThNd LXPQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:subject:message-id:mail-followup-to :references:mime-version:content-disposition:in-reply-to:user-agent; bh=PAKltMh0Ipp0RC7yIIJLIMLwRekFKaMEVrki2BnUqCc=; b=QBpL0tWB74I5Iyfl+7vxYCfgrd2Rr/WPQnKDw6d5VPs86B+ZKpuwKJvl1oFrg7UEIg ol9ALqoORqOkhslg0YKdGIYhs9D0o3xIZA3elcqitpooPVLaw2efBHogTlGJB/VPtkHE UNQJhsDILhAmXJudkCydCyK4xdEKEDSLbYXFru8oIr1UEGlMavBTnQEF5F5QC42KCSnu hMpaWvmWH6w8zFXfAvpmf9NDduW0wC69YWBJzG6n+fYV/Qkfs3nvU4VRIJxDr1/U4+jK PwmXBcIXj8iR/jTw1cElmH5jGmB8eRFCZ5BP8JBVWvHQvg3UcuZRg0lzXwj+L8TJzkpf Jsbg== X-Gm-Message-State: AOAM532QD5/7cQJ049RyJT3aVSuomeC3rCX92WckM7gpSW26EQdX9tDL y74QxXhu3nxOZgkCeeOY7X1a6Pvnkfk= X-Google-Smtp-Source: ABdhPJzoSWxIJ5uUADJgroFzRhkbM3KME28h+fgb1RAfvdptYyM3fBeLsaAUXoBQ6wxwgmTuZgTvmg== X-Received: by 2002:a05:600c:a42:b0:39c:9086:8a34 with SMTP id c2-20020a05600c0a4200b0039c90868a34mr2709224wmq.169.1655047932839; Sun, 12 Jun 2022 08:32:12 -0700 (PDT) Received: from mariano (dynamic-adsl-78-14-101-54.clienti.tiscali.it. [78.14.101.54]) by smtp.gmail.com with ESMTPSA id b14-20020a05600c4e0e00b0039747cf8354sm5933206wmq.39.2022.06.12.08.32.11 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 12 Jun 2022 08:32:11 -0700 (PDT) Received: by mariano (Postfix, from userid 1000) id 30C35BFA36; Sun, 12 Jun 2022 17:32:10 +0200 (CEST) Date: Sun, 12 Jun 2022 17:32:10 +0200 From: Stefano Sabatini To: FFmpeg development discussions and patches Message-ID: <20220612153210.GB11679@mariano> Mail-Followup-To: FFmpeg development discussions and patches References: <20210418213058.24475-1-stefasab@gmail.com> <20210421215335.GC12140@mariano> <20220403140336.GA264464@mariano> <9ee5c7d1-fe54-f415-ba48-c0a095326d85@passwd.hu> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="SUOF0GtieIMvvwua" Content-Disposition: inline In-Reply-To: <9ee5c7d1-fe54-f415-ba48-c0a095326d85@passwd.hu> User-Agent: Mutt/1.13.2 (2019-12-18) Subject: Re: [FFmpeg-devel] [PATCH 1/2] lavf/avio: add avio_vprintf() 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: --SUOF0GtieIMvvwua Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On date Thursday 2022-06-09 21:03:02 +0200, Marton Balint wrote: > > > On Sun, 3 Apr 2022, Stefano Sabatini wrote: > > > On date Wednesday 2021-04-21 23:53:35 +0200, Stefano Sabatini wrote: > > > On date Sunday 2021-04-18 23:30:57 +0200, Stefano Sabatini wrote: > > > > This new function makes it possible to use avio_printf() functionality from > > > > a function taking a variable list of arguments. > > > > --- > > > > doc/APIchanges | 3 +++ > > > > libavformat/avio.h | 6 ++++++ > > > > libavformat/aviobuf.c | 17 +++++++++++++---- > > > > libavformat/version.h | 2 +- > > > > 4 files changed, 23 insertions(+), 5 deletions(-) > > > > > > Updated against master. > > > > Updated. > > > > Will rebase and apply soon. Updated. --SUOF0GtieIMvvwua Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="0001-lavf-avio-add-avio_vprintf.patch" >From fd1fd40b5f7bc66de6428a8b46be43aad30b6c2d Mon Sep 17 00:00:00 2001 From: Stefano Sabatini Date: Sun, 12 Jun 2022 13:15:26 +0200 Subject: [PATCH 1/2] lavf/avio: add avio_vprintf() This new function makes it possible to use avio_printf() functionality from a function taking a variable list of arguments. --- doc/APIchanges | 4 ++++ libavformat/avio.h | 6 ++++++ libavformat/aviobuf.c | 17 +++++++++++++---- libavformat/version.h | 2 +- 4 files changed, 24 insertions(+), 5 deletions(-) diff --git a/doc/APIchanges b/doc/APIchanges index 337f1466d8..4f7a19d176 100644 --- a/doc/APIchanges +++ b/doc/APIchanges @@ -14,6 +14,10 @@ libavutil: 2021-04-27 API changes, most recent first: +2022-06-12 - xxxxxxxxxx - lavf 59.25.100 - avio.h + Add avio_vprintf(), similar to avio_printf() but allow to use it + from within a function taking a variable argument list as input. + 2022-05-23 - xxxxxxxxx - lavu 57.25.100 - avutil.h Deprecate av_fopen_utf8() without replacement. diff --git a/libavformat/avio.h b/libavformat/avio.h index 3ed9175a9b..36c3d7b430 100644 --- a/libavformat/avio.h +++ b/libavformat/avio.h @@ -519,6 +519,12 @@ int64_t avio_size(AVIOContext *s); */ int avio_feof(AVIOContext *s); +/** + * Writes a formatted string to the context taking a va_list. + * @return number of bytes written, < 0 on error. + */ +int avio_vprintf(AVIOContext *s, const char *fmt, va_list ap); + /** * Writes a formatted string to the context. * @return number of bytes written, < 0 on error. diff --git a/libavformat/aviobuf.c b/libavformat/aviobuf.c index 33bc3c2e20..b20b1a611a 100644 --- a/libavformat/aviobuf.c +++ b/libavformat/aviobuf.c @@ -1292,15 +1292,12 @@ int avio_closep(AVIOContext **s) return ret; } -int avio_printf(AVIOContext *s, const char *fmt, ...) +int avio_vprintf(AVIOContext *s, const char *fmt, va_list ap) { - va_list ap; AVBPrint bp; av_bprint_init(&bp, 0, INT_MAX); - va_start(ap, fmt); av_vbprintf(&bp, fmt, ap); - va_end(ap); if (!av_bprint_is_complete(&bp)) { av_bprint_finalize(&bp, NULL); s->error = AVERROR(ENOMEM); @@ -1311,6 +1308,18 @@ int avio_printf(AVIOContext *s, const char *fmt, ...) return bp.len; } +int avio_printf(AVIOContext *s, const char *fmt, ...) +{ + va_list ap; + int ret; + + va_start(ap, fmt); + ret = avio_vprintf(s, fmt, ap); + va_end(ap); + + return ret; +} + void avio_print_string_array(AVIOContext *s, const char *strings[]) { for(; *strings; strings++) diff --git a/libavformat/version.h b/libavformat/version.h index 6c2776460b..966ebb7ed3 100644 --- a/libavformat/version.h +++ b/libavformat/version.h @@ -31,7 +31,7 @@ #include "version_major.h" -#define LIBAVFORMAT_VERSION_MINOR 24 +#define LIBAVFORMAT_VERSION_MINOR 25 #define LIBAVFORMAT_VERSION_MICRO 100 #define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \ -- 2.25.1 --SUOF0GtieIMvvwua Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ 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". --SUOF0GtieIMvvwua--