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 797B844AE1 for ; Wed, 11 Feb 2026 08:26:51 +0000 (UTC) Authentication-Results: ffbox; dkim=fail (body hash mismatch (got b'c/9oK1O4Sk6IrjbbwTZ/gafFgv6xKFUR2D3wSohkIgw=', expected b'vI99afPYtzxjKPC2BlgUfIStUH2m2PEk9511716oe1M=')) 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=1770798398; 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=c/9oK1O4Sk6IrjbbwTZ/gafFgv6xKFUR2D3wSohkIgw=; b=dcFHc1sYaOLXfkurd5NWzyjedgAzP5bOO34sr49pUpmuPGd54GdUBa6E6QTzyj6oNRvgO c4ah1LVms9ZuxmfejdGl+bH75b2NMq3k4oaSN4RrBLs2jCQt1cp7qS7soH7Sthd72L5dgZk Mky8KHa6f1lHWdalj+P2kzj6V9cCheGACRkMIJwzYrN3mN/LlFzblMKHgzD8yshs8K/AcZ/ KpkdsX4oNKTnby+bFidI0cflbkzUB/Gi7lSCy5ykMG9fCdxT/Osd3y2ldbhJ4BaWc3IVr89 jFLB1s6ksNzylfWQ2KqD0MtBIGSxKoUBq9b2B8OE3hr9xnhEaiq9kcyUUs7Q== Received: from [172.20.0.3] (unknown [172.20.0.3]) by ffbox0-bg.ffmpeg.org (Postfix) with ESMTP id 3C593691916; Wed, 11 Feb 2026 10:26:38 +0200 (EET) ARC-Seal: i=1; cv=none; a=rsa-sha256; d=ffmpeg.org; s=arc; t=1770798389; b=YHiPjYen0wYn0acu6c6CNmT68IYghjTOodbz5igdRv/PIBKw/G7Wzw8Z8Hs8gJCqqoEFo p6w8lBDKTDqmxJVZ04Kk6y+FadLVoBH5rHlQKowAfVsb2kHe3hzAu86q8u4xPm9yEnrXnS0 8sCKllSc8gCObTO7Ok1ohlwhax4wR7gEq8XgSocaEqB6PJP5mplpQFXeGEfukwIqGXqxXqQ 9hQ1d0rzNgg+dqf73ZlgWaJAcoFHQnQXBDUz6CSHxBiJQ8gij7NfrIqATDSifwgkShYqN2U rOPKP2KRf6MmA4WtLLH9O8ylE5+BmtCMb5R+vP+temgMI1qdqHdd38XFuO5A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=ffmpeg.org; s=arc; t=1770798389; 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=pCiTevSRWKArnEHHYOgFF52+noTyWSCXVHzAZdxwqhI=; b=rC3DyVQZMGORp8aXnUHAvMjKQNfbY9Y/Bl9Nu8UQhQaxsxTXZFHjWt9OM6xNvP/axbkOF gXzR78BS/R6I4a99bf5AZj/woq1fehFK7nnPT/pFNsPxWKpRGkYT0kp8ui57iGNaFLRrQUK NLJD6ikEk/jIvY/VNKQbU9fz83UI0oMe//XsqVZTngfZ9FZ/PvN6CqgDDOr49G5v9mLQI2h K46AxmMiUSzJDn48k1m59UTZNO86+/1OypMGy2uLFuo9nj6kF28OJ0+JcfsUF5JoT/QRYqW hUtmS6VhUhCMvWhADBpXXJRFL6eaWgb33K6ShdmuWJHjd/CYIMTBJAkl8lMQ== 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=1770798380; h=content-type : mime-version : content-transfer-encoding : from : to : reply-to : subject : date : from; bh=vI99afPYtzxjKPC2BlgUfIStUH2m2PEk9511716oe1M=; b=KRrGAzALHQwIpY8dDZm4fVP74SsB49XyW6ZfQ0CN2oXzeBsnxgizgrT0M+mEkYsR73xMZ G3IA9rVzH3g6HXgh0MYC2M8fTbBaYMN1fjMSoPgz7b7xuNlrfZIxlYfPbC9xbhBLlFuq85+ pwoMdnZfRpEvtoVu/zvmyfNmCMOCRyUyHR2Ef+gsZUameYIqitJaM4L8vKhJQqN0iz3rhA6 Q0uIG+pLSwys2ziHDPSVHH2qQYE7JCOGplFLlnqa0B+v4iZ088ogSjSrOzZM9w/1zYd8XAA t3mKrRQ93/U7jYxzw0aLzaC31zkrRhLgF2/XVBcHOUGr+Px5H5+G287U53pw== Received: from c8d966988b92 (code.ffmpeg.org [188.245.149.3]) by ffbox0-bg.ffmpeg.org (Postfix) with ESMTPS id 9B3556918B2 for ; Wed, 11 Feb 2026 10:26:20 +0200 (EET) MIME-Version: 1.0 To: ffmpeg-devel@ffmpeg.org Date: Wed, 11 Feb 2026 08:26:20 -0000 Message-ID: <177079838081.25.11090169392050968477@009cbcb3d8cd> Message-ID-Hash: YFX4YARS53D3XTSTDEZDKKLNN6XDKLDM X-Message-ID-Hash: YFX4YARS53D3XTSTDEZDKKLNN6XDKLDM 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] avformat: use av_unreachable() to replace unreachable error handling (PR #21731) 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: Jack Lau via ffmpeg-devel Cc: Jack Lau Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Archived-At: List-Archive: List-Post: PR #21731 opened by Jack Lau (JackLau) URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/21731 Patch URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/21731.patch These muxers already set hard dependencies in configure so they cannot be enabled unless the dependencies are enabled So these error handling is unreachable >>From 8092a864c855ed4c7199d85f478f438781a21e1e Mon Sep 17 00:00:00 2001 From: Devraj Ajmera Date: Thu, 5 Feb 2026 21:52:51 +0800 Subject: [PATCH 1/2] avformat/whip: use av_unreachable() to replace the unreachable error handling whip_muxer_select enforce the rtp muxer dependency in configure, so this error should be unreachable. Signed-off-by: Jack Lau --- libavformat/whip.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/libavformat/whip.c b/libavformat/whip.c index 8aed0c31e5..83df6b5e41 100644 --- a/libavformat/whip.c +++ b/libavformat/whip.c @@ -1542,11 +1542,8 @@ static int create_rtp_muxer(AVFormatContext *s) whip->udp->flags |= AVIO_FLAG_NONBLOCK; const AVOutputFormat *rtp_format = av_guess_format("rtp", NULL, NULL); - if (!rtp_format) { - av_log(whip, AV_LOG_ERROR, "Failed to guess rtp muxer\n"); - ret = AVERROR(ENOSYS); - goto end; - } + if (!rtp_format) + av_unreachable("rtp muxer should be enabled"); /* The UDP buffer size, may greater than MTU. */ buffer_size = MAX_UDP_BUFFER_SIZE; -- 2.52.0 >>From 24ef8fcc1167433abd98138ec206f9652843086c Mon Sep 17 00:00:00 2001 From: Jack Lau Date: Thu, 5 Feb 2026 22:01:55 +0800 Subject: [PATCH 2/2] avformat: use av_unreachable() to replace unreachable error handling These muxers already set hard dependencies in configure so they cannot be enabled unless the dependencies are enabled So these error handling is unreachable Signed-off-by: Jack Lau --- libavformat/hdsenc.c | 2 +- libavformat/hlsenc.c | 4 ++-- libavformat/rtpenc_mpegts.c | 2 +- libavformat/smoothstreamingenc.c | 2 +- libavformat/webm_chunk.c | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/libavformat/hdsenc.c b/libavformat/hdsenc.c index 01efa1f8da..7fdfb5f9d4 100644 --- a/libavformat/hdsenc.c +++ b/libavformat/hdsenc.c @@ -321,7 +321,7 @@ static int hds_write_header(AVFormatContext *s) oformat = av_guess_format("flv", NULL, NULL); if (!oformat) { - return AVERROR_MUXER_NOT_FOUND; + av_unreachable("flv muxer should be enabled"); } c->streams = av_calloc(s->nb_streams, sizeof(*c->streams)); diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c index ee64a5a275..2b086ce90a 100644 --- a/libavformat/hlsenc.c +++ b/libavformat/hlsenc.c @@ -2977,7 +2977,7 @@ static int hls_init(AVFormatContext *s) vs->oformat = av_guess_format("mpegts", NULL, NULL); } if (!vs->oformat) - return AVERROR_MUXER_NOT_FOUND; + av_unreachable("mp4 and mpegts muxer should be enabled"); if (hls->segment_filename) { ret = format_name(hls->segment_filename, &vs->basename, i, vs->varname); @@ -3056,7 +3056,7 @@ static int hls_init(AVFormatContext *s) if (vs->has_subtitle) { vs->vtt_oformat = av_guess_format("webvtt", NULL, NULL); if (!vs->vtt_oformat) - return AVERROR_MUXER_NOT_FOUND; + av_unreachable("webvtt muxer should be enabled"); p = strrchr(vs->m3u8_name, '.'); if (p) diff --git a/libavformat/rtpenc_mpegts.c b/libavformat/rtpenc_mpegts.c index f9ff7e99cd..cbd124e2ba 100644 --- a/libavformat/rtpenc_mpegts.c +++ b/libavformat/rtpenc_mpegts.c @@ -66,7 +66,7 @@ static int rtp_mpegts_write_header(AVFormatContext *s) AVDictionary *rtp_muxer_options = NULL; if (!mpegts_format || !rtp_format) - return AVERROR(ENOSYS); + av_unreachable("mpegts and rtp muxers should be enabled"); mpegts_ctx = avformat_alloc_context(); if (!mpegts_ctx) return AVERROR(ENOMEM); diff --git a/libavformat/smoothstreamingenc.c b/libavformat/smoothstreamingenc.c index adf3008003..7f45fe70a6 100644 --- a/libavformat/smoothstreamingenc.c +++ b/libavformat/smoothstreamingenc.c @@ -292,7 +292,7 @@ static int ism_write_header(AVFormatContext *s) oformat = av_guess_format("ismv", NULL, NULL); if (!oformat) { - return AVERROR_MUXER_NOT_FOUND; + av_unreachable("ismv muxer should be enabled"); } c->streams = av_calloc(s->nb_streams, sizeof(*c->streams)); diff --git a/libavformat/webm_chunk.c b/libavformat/webm_chunk.c index 57329f1788..96cb0fa4cf 100644 --- a/libavformat/webm_chunk.c +++ b/libavformat/webm_chunk.c @@ -70,7 +70,7 @@ static int webm_chunk_init(AVFormatContext *s) oformat = av_guess_format("webm", s->url, "video/webm"); if (!oformat) - return AVERROR_MUXER_NOT_FOUND; + av_unreachable("webm muxer should be enabled"); ret = avformat_alloc_output_context2(&wc->avf, oformat, NULL, NULL); if (ret < 0) -- 2.52.0 _______________________________________________ ffmpeg-devel mailing list -- ffmpeg-devel@ffmpeg.org To unsubscribe send an email to ffmpeg-devel-leave@ffmpeg.org