From patchwork Mon Mar 2 04:35:17 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 17989 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 34065447B68 for ; Mon, 2 Mar 2020 06:35:59 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 0BB316899BB; Mon, 2 Mar 2020 06:35:59 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wm1-f52.google.com (mail-wm1-f52.google.com [209.85.128.52]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 198F56899BB for ; Mon, 2 Mar 2020 06:35:52 +0200 (EET) Received: by mail-wm1-f52.google.com with SMTP id f15so9551438wml.3 for ; Sun, 01 Mar 2020 20:35:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=3jAZ6fOgxpU51qWiqtVMCewbNEpGFy2Y0/ma9mC0bBI=; b=pRrAnmgpftw/A9XAxa7ockOX8pqK+16KiI5+1jn8Sh+OrKt/XtXnrKxQJ0Y0NIId+G 72dwPSqQL7s5nBvtm54OgU/+2kJvPnGkonOmGRMMB7s9Dumr1UAgXZWC8ory03IENC+b VqBos6JSi6N5v35l4e9B/qTXLBPPIN+LC2ojV32GXTKBvpkij4ZCLYE1yXc6Akrr8CbT IMJqkwt5Gs0aEaj8WdBKtmN+Rdx9TPDF9OZnQFReR9JgB1fES2stsbfgEpBCuj8REIG0 mI2nZTr1Sn23jZwGcnrXgUNG/V6YCzFYsax1utkAX6KiK5RpvSiyvEGiq0tvhpPIncI9 gM6A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=3jAZ6fOgxpU51qWiqtVMCewbNEpGFy2Y0/ma9mC0bBI=; b=HcZW2iYB0oXOoA0OctpSquQX9NjXAeuSc8IK9t7rN6A+kM9MtO8uN0htvY9rRAwD0a K4sUV/0KB/AvUli0W296nRzSMzMVS6vST0x3wNV/I6B3Lw57A27O5cyVyqIgil5YTVYx wqq/D7mUpxlhUba8uBWFIn2WUzgTlLtUx3VP0XyTN+OdYAZ44Zgk2Wsl+mD2Q7kaYXEC tGsDzuQ7x78FYmiSc+aldD7lWnu7ZaG8D+uAhR1tihkpjwBwQH89amoMHQ9ITnttGJfW XfD88juIJ3M6QeWl6X7bVaUYI6Ox+FoCSIBk7+aIXv4slhSJn9TMf99Lvocu6qVoLeho J/pA== X-Gm-Message-State: APjAAAXAp1z8Qiu3Fqo8VO4y4/owRsK5+hrXdmqKg7UThkwUKNNN+03s 3B2wY0BOVd8rw7HCloQrJLnGdrox X-Google-Smtp-Source: APXvYqxeZSI9/s2KnC4gSuuhkLl4jl+nHfGv/e6jc8OA96xgL/WfDLY8TQwnKlqDRo4I3rb69A+t3w== X-Received: by 2002:a05:600c:218a:: with SMTP id e10mr17214314wme.6.1583123751182; Sun, 01 Mar 2020 20:35:51 -0800 (PST) Received: from sblaptop.fritz.box (ipbcc1ab4b.dynamic.kabel-deutschland.de. [188.193.171.75]) by smtp.gmail.com with ESMTPSA id g7sm20842429wrm.72.2020.03.01.20.35.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 01 Mar 2020 20:35:50 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Mon, 2 Mar 2020 05:35:17 +0100 Message-Id: <20200302043520.14165-1-andreas.rheinhardt@gmail.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 1/17] avformat: Use correct error in case muxer is not found 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: Andreas Rheinhardt Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Signed-off-by: Andreas Rheinhardt --- libavformat/mpegtsenc.c | 2 +- libavformat/mux.c | 4 ++-- libavformat/rtpenc_chain.c | 2 +- libavformat/rtpenc_mpegts.c | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/libavformat/mpegtsenc.c b/libavformat/mpegtsenc.c index ccb631d746..47463cbcdb 100644 --- a/libavformat/mpegtsenc.c +++ b/libavformat/mpegtsenc.c @@ -971,7 +971,7 @@ static int mpegts_init(AVFormatContext *s) av_guess_format((ts->flags & MPEGTS_FLAG_AAC_LATM) ? "latm" : "adts", NULL, NULL); if (!ts_st->amux->oformat) { - ret = AVERROR(EINVAL); + ret = AVERROR_MUXER_NOT_FOUND; goto fail; } if (!(ast = avformat_new_stream(ts_st->amux, NULL))) { diff --git a/libavformat/mux.c b/libavformat/mux.c index d88746e8c5..565a7d7c18 100644 --- a/libavformat/mux.c +++ b/libavformat/mux.c @@ -160,15 +160,15 @@ int avformat_alloc_output_context2(AVFormatContext **avctx, ff_const59 AVOutputF oformat = av_guess_format(format, NULL, NULL); if (!oformat) { av_log(s, AV_LOG_ERROR, "Requested output format '%s' is not a suitable output format\n", format); - ret = AVERROR(EINVAL); + ret = AVERROR_MUXER_NOT_FOUND; goto error; } } else { oformat = av_guess_format(NULL, filename, NULL); if (!oformat) { - ret = AVERROR(EINVAL); av_log(s, AV_LOG_ERROR, "Unable to find a suitable output format for '%s'\n", filename); + ret = AVERROR_MUXER_NOT_FOUND; goto error; } } diff --git a/libavformat/rtpenc_chain.c b/libavformat/rtpenc_chain.c index e6b603db70..a4a9fb8c3a 100644 --- a/libavformat/rtpenc_chain.c +++ b/libavformat/rtpenc_chain.c @@ -36,7 +36,7 @@ int ff_rtp_chain_mux_open(AVFormatContext **out, AVFormatContext *s, AVDictionary *opts = NULL; if (!rtp_format) { - ret = AVERROR(ENOSYS); + ret = AVERROR_MUXER_NOT_FOUND; goto fail; } diff --git a/libavformat/rtpenc_mpegts.c b/libavformat/rtpenc_mpegts.c index 7d7377db7a..1650462eef 100644 --- a/libavformat/rtpenc_mpegts.c +++ b/libavformat/rtpenc_mpegts.c @@ -54,7 +54,7 @@ static int rtp_mpegts_write_header(AVFormatContext *s) AVStream *st; if (!mpegts_format || !rtp_format) - return AVERROR(ENOSYS); + return AVERROR_MUXER_NOT_FOUND; mpegts_ctx = avformat_alloc_context(); if (!mpegts_ctx) return AVERROR(ENOMEM);