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 4370440914 for ; Sun, 3 Apr 2022 16:34:50 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id CB97468B253; Sun, 3 Apr 2022 19:34:47 +0300 (EEST) Received: from mail-ej1-f45.google.com (mail-ej1-f45.google.com [209.85.218.45]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 10F5A68A5B3 for ; Sun, 3 Apr 2022 19:34:41 +0300 (EEST) Received: by mail-ej1-f45.google.com with SMTP id r13so15380474ejd.5 for ; Sun, 03 Apr 2022 09:34:40 -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=Hd5r1GUhcg/KDuNRKrLXse7+HcqXcwwK26ErY6Po5CY=; b=n/HJ1j4rRQnygT9BvZumB7aXuO17fZ8yF75CdXEgu2HmbYwhMOiSTRNZ9b/lAAL1QX vOvhh8Ex4aHK9E+fEVfVVoEwvb1xyqP2hl71PQdhnd3wSRrrDuxPt/J18kTIz6Rkz11C P44vibwit5WUMzImwDICZYzbx2qTnz3Ym/xkxcRUkAsyovzC0uev9lRghRr3Z55hqDdO W7ee4lkkZB28/e//ivV9KQuDGlyO82utCS/Zep8kt8jA1xkIgsZ/AbrpRbXoXTNupspN mngK/CEVB2rp5wPQMKDWBDVRvTJtYkdP6/kAP6+RefQxjLCFHpXKqKCmZXOkEASqYwe0 Cxaw== 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=Hd5r1GUhcg/KDuNRKrLXse7+HcqXcwwK26ErY6Po5CY=; b=kxyDS3zWPz9VRwxd+vEMlIFnjMpdRFO10v7jnTihSVpheLjc1KT9XAYPh96eAh3o76 Q3dly9R4K4wf0m8H2U0wOqwRGc2ROH16Jcd4b5x5pI3C78LCIlcM4v1tt80/aAC2gYHs d4kepxCP+DJUedr7OogbkHbwVFlAZ1F8SRsi/Yu/uuhHMsD0peI7FNO6AMKGC6Y/Ei0e /KOMqEDXsUQ8TxnKpg4aXKgdZ8pP6mLNWfBDFOPHAL41oUMWRb2AyWmS4G5Aav0xtLZQ 40k4+OHAzI08Xp8OrZhoej2W0lma7BR/tullu9jhIRfWQTtP3YHHAgcZqcFcDeeAgped pSGg== X-Gm-Message-State: AOAM533yhD+lP/vRS3Gyq+ULOhqrbzAZVbN6u539gVHLTWaZvHUvjZ8A pFozTDJRi453x8VHtzWqM9/UBC/qCFj0wQ== X-Google-Smtp-Source: ABdhPJxd2xKB0uHI5ZC8jcBqXbm4SxiLQUuyxlQQYpEzZe0roYONf0kKoudzy90Fqq39ayIusVcjbQ== X-Received: by 2002:a17:907:7e94:b0:6e4:9d72:a784 with SMTP id qb20-20020a1709077e9400b006e49d72a784mr7549598ejc.346.1649003680161; Sun, 03 Apr 2022 09:34:40 -0700 (PDT) Received: from mariano (dynamic-adsl-78-14-80-42.clienti.tiscali.it. [78.14.80.42]) by smtp.gmail.com with ESMTPSA id d1-20020a50fe81000000b004197f2ecdc2sm4010233edt.89.2022.04.03.09.34.39 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 03 Apr 2022 09:34:39 -0700 (PDT) Received: by mariano (Postfix, from userid 1000) id 9DCB6BFA5A; Sun, 3 Apr 2022 16:03:36 +0200 (CEST) Date: Sun, 3 Apr 2022 16:03:36 +0200 From: Stefano Sabatini To: FFmpeg development discussions and patches Message-ID: <20220403140336.GA264464@mariano> Mail-Followup-To: FFmpeg development discussions and patches References: <20210418213058.24475-1-stefasab@gmail.com> <20210421215335.GC12140@mariano> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="9amGYk9869ThD9tj" Content-Disposition: inline In-Reply-To: <20210421215335.GC12140@mariano> 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: --9amGYk9869ThD9tj Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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. --9amGYk9869ThD9tj Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="0001-lavf-avio-add-avio_vprintf.patch" >From c4ac476c90b422ee876ee7e53ed942d693943bea Mon Sep 17 00:00:00 2001 From: Stefano Sabatini Date: Sun, 18 Apr 2021 22:49:25 +0200 Subject: [PATCH 1/3] 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 | 3 +++ libavformat/avio.h | 6 ++++++ libavformat/aviobuf.c | 17 +++++++++++++---- libavformat/version.h | 2 +- 4 files changed, 23 insertions(+), 5 deletions(-) diff --git a/doc/APIchanges b/doc/APIchanges index 1a9f0a303e..c2612efb93 100644 --- a/doc/APIchanges +++ b/doc/APIchanges @@ -13,6 +13,9 @@ libavutil: 2021-04-27 API changes, most recent first: +2022-04-03 - xxxxxxxxxx - lavf 59.21.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-03-16 - xxxxxxxxxx - all libraries - version_major.h Add lib/version_major.h as new installed headers, which only 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 29d4bd7510..64184978c2 100644 --- a/libavformat/aviobuf.c +++ b/libavformat/aviobuf.c @@ -1289,15 +1289,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); @@ -1308,6 +1305,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 f4a26c2870..2f54f57c02 100644 --- a/libavformat/version.h +++ b/libavformat/version.h @@ -31,7 +31,7 @@ #include "version_major.h" -#define LIBAVFORMAT_VERSION_MINOR 20 +#define LIBAVFORMAT_VERSION_MINOR 21 #define LIBAVFORMAT_VERSION_MICRO 101 #define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \ -- 2.25.1 --9amGYk9869ThD9tj 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". --9amGYk9869ThD9tj--