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 F37034E7A3 for ; Sat, 31 Jan 2026 11:34:09 +0000 (UTC) Authentication-Results: ffbox; dkim=fail (body hash mismatch (got b'CNiYJI3/CdPAGu1NJb1g7FR8hQ6zF09CPXqZJcfXGHc=', expected b'8wKn1IBm8C8V5eFfFkneHWVBG8ytBUsnqTvOARKpAH0=')) header.d=ffmpeg.org header.i=@ffmpeg.org header.a=rsa-sha256 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ffmpeg.org; i=@ffmpeg.org; q=dns/txt; s=mail; t=1769859224; h=mime-version : to : date : message-id : reply-to : subject : list-id : list-archive : list-archive : list-help : list-owner : list-post : list-subscribe : list-unsubscribe : from : cc : content-type : content-transfer-encoding : from; bh=CNiYJI3/CdPAGu1NJb1g7FR8hQ6zF09CPXqZJcfXGHc=; b=nbdkwDAgV92yGe5Yg6PKd4LdTGKz4BnHyT2KzoZ9FVv8DLVanNHpykuOtO3PtH4tj4HOC qeVBob0MyvhTNB/olcQ3QC/OTRTj3vYGF9m6HppIqoXzOsaUFLlytccSaLRAM+87VzHA7yI DzmVEiGCALyZz6FKkC/h7qEe6tRzVkqEF/IjYR2+A/gR/swOUmzQS7/pWa31uMceMHZ4kwj AyfdqpbzN9zxWS+8qTqoRfffidSDwkZ0O+8eMMdXKSEk+UgPXqh6U0Zt0quIA19H4RSQ53r OgIL4hieghLjPMpnelhao+HLcgJcoSGdWwa3nG8gDIlkIWg3N1xmhxzwIZ5Q== Received: from [172.20.0.4] (unknown [172.20.0.4]) by ffbox0-bg.ffmpeg.org (Postfix) with ESMTP id EB7AE690F96; Sat, 31 Jan 2026 13:33:44 +0200 (EET) ARC-Seal: i=1; cv=none; a=rsa-sha256; d=ffmpeg.org; s=arc; t=1769859208; b=XHXwtZx1SN6WtpcVPL5IwvQFetj1ijveRM3csf9yeImPVL0AzgQYRxKM7To5UnZY4vK1F gLyMp7gMcoNbktQJ1pCN1UJoNpY0SsenEk7bmL60eA3Xgp6Z11kmi5l4yBE4ZEeCkGV+JQw GQsnJubIYFIZc1LN8voE2Kdgv/1mtEEc9Sa6fIF9AfOt4PwVJGO7TLDGwC3LTUrzkPzZcfZ yLsGs90rTMmeoPcb4Yy6XlGK0w8IJNu0PIm7jPzTr2SSCCbLBAqaLXhDxDeZOPOeJqI6zSR m6nQW0LowQw2nOmPa35L73ZnMU13ICtX5LumtJzydRzctKM6wnpJCreWzThQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=ffmpeg.org; s=arc; t=1769859208; h=from : sender : reply-to : subject : date : message-id : to : cc : mime-version : content-type : 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=kFgGl+ER/ICZ8tXYNiq3vwVc6Nt1hgcRuD/zKzw+KyQ=; b=MmQrltvPn2y/W0BbzPFskGWYp2wgBv+uMluK3i66bWlUx/3bxDfxT9XzBlex/6ItCGc81 U5Nns7U7v/WVGj1i42g1Gf/WOR2UKc2mqxryLMC5fZ3AsEKorLHg/ap7db/QHskMNQgvvph lE0ORSqDxjK3AUlPZJ/7SSSnBTDrpJE9LYfnZ9OzwwyP9gDfQ7EhXPj0jIHl6rkYk/i24zg Gp/BFRJ37EibvLFf3KKurxbs5yQnjv96mglxHl2Fx3yqaaZdT9MhrXW+oBXr0OUjevsa6Ok sZ/Ph/YTh0dVueJ8vNylVOrsB6AOW6ih6yHymA5XmDkBT/K/5gq5sqPRCukA== ARC-Authentication-Results: i=1; ffmpeg.org; dkim=pass header.d=ffmpeg.org header.i=@ffmpeg.org; arc=none; dmarc=pass header.from=ffmpeg.org policy.dmarc=quarantine Authentication-Results: ffmpeg.org; dkim=pass header.d=ffmpeg.org header.i=@ffmpeg.org; arc=none (Message is not ARC signed); dmarc=pass (Used From Domain Record) header.from=ffmpeg.org policy.dmarc=quarantine DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ffmpeg.org; i=@ffmpeg.org; q=dns/txt; s=mail; t=1769859200; h=content-type : mime-version : content-transfer-encoding : from : to : reply-to : subject : date : from; bh=8wKn1IBm8C8V5eFfFkneHWVBG8ytBUsnqTvOARKpAH0=; b=1szaLHDTzIDvfQ8nEOIYNox1LGmqUGAmmWQC5LeIvClCkBfus0OFF4dEE4HONloay4o75 GMMzWfUKJ9C5YFhnKud+5QRY+IJsxD2RtoL5G6UB0DSOIzY+uatv7elqJ/JBnGuusFHneUD 5Yj4FwnZlXHNNAJ6ln17wjanjOkum2ytbnsZQ2YFUWuBI+UBrG944IRBqq2WMsXieSF5Ifr 4B8PWU4Ch9Assncxu+s8hCTH44IO6KL5hqEt4FfLlh+OqElX7hUFTY7kddNn68SB2sslyfA Vont7K8OgVLMXqdZljUG0OLCJTULrI/WzglUfWePjCHlhG9G63KWtltkj8yw== Received: from c8d966988b92 (code.ffmpeg.org [188.245.149.3]) by ffbox0-bg.ffmpeg.org (Postfix) with ESMTPS id 5688A690F04 for ; Sat, 31 Jan 2026 13:33:20 +0200 (EET) MIME-Version: 1.0 To: ffmpeg-devel@ffmpeg.org Date: Sat, 31 Jan 2026 11:33:19 -0000 Message-ID: <176985920049.25.12518964313708840615@4457048688e7> Message-ID-Hash: 6DYDSQD43BKZCPDEWU7OI5IH2YTPVDUA X-Message-ID-Hash: 6DYDSQD43BKZCPDEWU7OI5IH2YTPVDUA X-MailFrom: code@ffmpeg.org X-Mailman-Rule-Hits: nonmember-moderation X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; header-match-ffmpeg-devel.ffmpeg.org-0; header-match-ffmpeg-devel.ffmpeg.org-1; header-match-ffmpeg-devel.ffmpeg.org-2; header-match-ffmpeg-devel.ffmpeg.org-3; emergency; member-moderation X-Mailman-Version: 3.3.10 Precedence: list Reply-To: FFmpeg development discussions and patches Subject: [FFmpeg-devel] [PR] Add a friendly name to AVFormatContext (PR #21617) List-Id: FFmpeg development discussions and patches Archived-At: Archived-At: List-Archive: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Niklas Haas via ffmpeg-devel Cc: Niklas Haas Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Archived-At: List-Archive: List-Post: PR #21617 opened by Niklas Haas (haasn) URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/21617 Patch URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/21617.patch This mirrors the design used to disambiguate log entries for AVFilterContext, by having `fftools/ffmpeg_demux.c` forward the demuxer instance name to the AVFormatContext. This includes the input format name (once known), mirroring the default log name; but with the extra input ID prefix. >>From ca456ed13765cab4a4f083f8416875678f138e8d Mon Sep 17 00:00:00 2001 From: Niklas Haas Date: Sat, 31 Jan 2026 11:50:34 +0100 Subject: [PATCH 1/2] avformat: add AVFormatContext.name Analog to AVFilterContext. May be used to set a custom logging name to disambiguate multiple AVFormatContext instances in the logs. --- doc/APIchanges | 3 +++ libavformat/avformat.c | 1 + libavformat/avformat.h | 5 +++++ libavformat/options.c | 3 ++- libavformat/version.h | 4 ++-- 5 files changed, 13 insertions(+), 3 deletions(-) diff --git a/doc/APIchanges b/doc/APIchanges index ee3167bb14..59655434a7 100644 --- a/doc/APIchanges +++ b/doc/APIchanges @@ -2,6 +2,9 @@ The last version increases of all libraries were on 2025-03-28 API changes, most recent first: +2026-02-xx - xxxxxxxxxx - lavf 62.9.100 - avformat.h + Add AVFormatContext.name. + 2026-01-xx - xxxxxxxxxx - lavu 60.24.100 - hwcontext_d3d11va.h Add BindFlags and MiscFlags to AVD3D11VADeviceContext diff --git a/libavformat/avformat.c b/libavformat/avformat.c index ee3f7ee1b2..806f8dcab2 100644 --- a/libavformat/avformat.c +++ b/libavformat/avformat.c @@ -190,6 +190,7 @@ void avformat_free_context(AVFormatContext *s) if (s->iformat) ff_flush_packet_queue(s); av_freep(&s->url); + av_freep(&s->name); av_free(s); } diff --git a/libavformat/avformat.h b/libavformat/avformat.h index bd34132e00..479f1f51c1 100644 --- a/libavformat/avformat.h +++ b/libavformat/avformat.h @@ -1884,6 +1884,11 @@ typedef struct AVFormatContext { * @see skip_estimate_duration_from_pts */ int64_t duration_probesize; + + /** + * Name of this format context, only used for logging purposes. + */ + char *name; } AVFormatContext; /** diff --git a/libavformat/options.c b/libavformat/options.c index 28aa2da942..d08013bfd4 100644 --- a/libavformat/options.c +++ b/libavformat/options.c @@ -45,7 +45,8 @@ FF_ENABLE_DEPRECATION_WARNINGS static const char* format_to_name(void* ptr) { AVFormatContext* fc = (AVFormatContext*) ptr; - if(fc->iformat) return fc->iformat->name; + if (fc->name) return fc->name; + else if(fc->iformat) return fc->iformat->name; else if(fc->oformat) return fc->oformat->name; else return fc->av_class->class_name; } diff --git a/libavformat/version.h b/libavformat/version.h index 1d3a53875a..1b079ebce8 100644 --- a/libavformat/version.h +++ b/libavformat/version.h @@ -31,8 +31,8 @@ #include "version_major.h" -#define LIBAVFORMAT_VERSION_MINOR 8 -#define LIBAVFORMAT_VERSION_MICRO 102 +#define LIBAVFORMAT_VERSION_MINOR 9 +#define LIBAVFORMAT_VERSION_MICRO 100 #define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \ LIBAVFORMAT_VERSION_MINOR, \ -- 2.52.0 >>From 565ebade18c4b132e117e86d85f51f6881432c83 Mon Sep 17 00:00:00 2001 From: Niklas Haas Date: Sat, 31 Jan 2026 12:00:36 +0100 Subject: [PATCH 2/2] fftools/ffmpeg_demux: mirror DemuxStream name to AVFormatContext Results in basically the same name, except less ambiguous because it includes the input index. --- fftools/ffmpeg_demux.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/fftools/ffmpeg_demux.c b/fftools/ffmpeg_demux.c index 701f9ddc34..c8d8a7e044 100644 --- a/fftools/ffmpeg_demux.c +++ b/fftools/ffmpeg_demux.c @@ -1879,6 +1879,7 @@ int ifile_open(const OptionsContext *o, const char *filename, Scheduler *sch) ic = avformat_alloc_context(); if (!ic) return AVERROR(ENOMEM); + ic->name = av_strdup(d->log_name); if (o->audio_sample_rate.nb_opt) { av_dict_set_int(&o->g->format_opts, "sample_rate", o->audio_sample_rate.opt[o->audio_sample_rate.nb_opt - 1].u.i, 0); } @@ -1967,6 +1968,8 @@ int ifile_open(const OptionsContext *o, const char *filename, Scheduler *sch) av_strlcat(d->log_name, "/", sizeof(d->log_name)); av_strlcat(d->log_name, ic->iformat->name, sizeof(d->log_name)); + av_freep(&ic->name); + ic->name = av_strdup(d->log_name); if (scan_all_pmts_set) av_dict_set(&o->g->format_opts, "scan_all_pmts", NULL, AV_DICT_MATCH_CASE); -- 2.52.0 _______________________________________________ ffmpeg-devel mailing list -- ffmpeg-devel@ffmpeg.org To unsubscribe send an email to ffmpeg-devel-leave@ffmpeg.org