From: Paul B Mahol <onemda@gmail.com>
To: FFmpeg development discussions and patches <ffmpeg-devel@ffmpeg.org>
Cc: Stefano Sabatini <stefasab@gmail.com>
Subject: Re: [FFmpeg-devel] [PATCH 4/6] doc/examples/transcode: improve reporting when the encoder is not found
Date: Sun, 3 Sep 2023 09:40:27 +0200
Message-ID: <CAPYw7P7E-yM65kcAs=PDJP+2xSkE93zguwEUQXzyusdUB7_0jQ@mail.gmail.com> (raw)
In-Reply-To: <20230901231447.1486347-4-stefasab@gmail.com>
On Sat, Sep 2, 2023 at 1:15 AM Stefano Sabatini <stefasab@gmail.com> wrote:
> Also return EINVAL in place of INVALIDDATA.
>
Better return also name, id number is meaningless to user.
> ---
> doc/examples/transcode.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/doc/examples/transcode.c b/doc/examples/transcode.c
> index 1ec4a3c230..aa6594f4ec 100644
> --- a/doc/examples/transcode.c
> +++ b/doc/examples/transcode.c
> @@ -161,8 +161,8 @@ static int open_output_file(const char *filename)
> /* in this example, we choose transcoding to same codec */
> encoder = avcodec_find_encoder(dec_ctx->codec_id);
> if (!encoder) {
> - av_log(NULL, AV_LOG_FATAL, "Necessary encoder not
> found\n");
> - return AVERROR_INVALIDDATA;
> + av_log(NULL, AV_LOG_FATAL, "Necessary encoder with ID %d
> not found\n", dec_ctx->codec_id);
> + return AVERROR(EINVAL);
> }
> enc_ctx = avcodec_alloc_context3(encoder);
> if (!enc_ctx) {
> --
> 2.34.1
>
> _______________________________________________
> 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".
>
_______________________________________________
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".
next prev parent reply other threads:[~2023-09-03 7:33 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-01 23:14 [FFmpeg-devel] [PATCH 1/6] libavcodec/avcodec.h: fix typos in AVCodecContext.pkt_timebase description Stefano Sabatini
2023-09-01 23:14 ` [FFmpeg-devel] [PATCH 2/6] doc/examples/transcode: apply style fixes Stefano Sabatini
2023-09-01 23:14 ` [FFmpeg-devel] [PATCH 3/6] doc/examples/transcode: factorize codec_type definition Stefano Sabatini
2023-09-01 23:14 ` [FFmpeg-devel] [PATCH 4/6] doc/examples/transcode: improve reporting when the encoder is not found Stefano Sabatini
2023-09-03 7:40 ` Paul B Mahol [this message]
2023-09-01 23:14 ` [FFmpeg-devel] [PATCH 5/6] doc/examples/transcode: use av_buffersrc_add_frame() Stefano Sabatini
2023-09-03 7:43 ` Paul B Mahol
2023-09-01 23:14 ` [FFmpeg-devel] [PATCH 6/6] doc/examples/transcode: introduce timestamp logging Stefano Sabatini
2023-09-02 15:22 ` [FFmpeg-devel] [PATCH 1/6] libavcodec/avcodec.h: fix typos in AVCodecContext.pkt_timebase description Stefano Sabatini
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAPYw7P7E-yM65kcAs=PDJP+2xSkE93zguwEUQXzyusdUB7_0jQ@mail.gmail.com' \
--to=onemda@gmail.com \
--cc=ffmpeg-devel@ffmpeg.org \
--cc=stefasab@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
This inbox may be cloned and mirrored by anyone:
git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git
# If you have public-inbox 1.1+ installed, you may
# initialize and index your mirror using the following commands:
public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
ffmpegdev@gitmailbox.com
public-inbox-index ffmpegdev
Example config snippet for mirrors.
AGPL code for this site: git clone https://public-inbox.org/public-inbox.git