From: Stefano Sabatini <stefasab@gmail.com>
To: FFmpeg development discussions and patches <ffmpeg-devel@ffmpeg.org>
Cc: Stefano Sabatini <stefasab@gmail.com>
Subject: [FFmpeg-devel] [PATCH 2/4] lavf/gcfenc: return proper error codes in case of failure
Date: Wed, 20 Mar 2024 17:29:01 +0100
Message-ID: <20240320162901.70879-1-stefasab@gmail.com> (raw)
---
libavformat/gxfenc.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/libavformat/gxfenc.c b/libavformat/gxfenc.c
index 9ea24c2f27..0aea7bd7c2 100644
--- a/libavformat/gxfenc.c
+++ b/libavformat/gxfenc.c
@@ -692,7 +692,7 @@ static int gxf_write_header(AVFormatContext *s)
if (!(pb->seekable & AVIO_SEEKABLE_NORMAL)) {
av_log(s, AV_LOG_ERROR, "gxf muxer does not support streamed output, patch welcome\n");
- return -1;
+ return AVERROR_PATCHWELCOME;
}
gxf->flags |= 0x00080000; /* material is simple clip */
@@ -707,15 +707,15 @@ static int gxf_write_header(AVFormatContext *s)
if (st->codecpar->codec_type == AVMEDIA_TYPE_AUDIO) {
if (st->codecpar->codec_id != AV_CODEC_ID_PCM_S16LE) {
av_log(s, AV_LOG_ERROR, "only 16 BIT PCM LE allowed for now\n");
- return -1;
+ return AVERROR(EINVAL);
}
if (st->codecpar->sample_rate != 48000) {
av_log(s, AV_LOG_ERROR, "only 48000hz sampling rate is allowed\n");
- return -1;
+ return AVERROR(EINVAL);
}
if (st->codecpar->ch_layout.nb_channels != 1) {
av_log(s, AV_LOG_ERROR, "only mono tracks are allowed\n");
- return -1;
+ return AVERROR(EINVAL);
}
ret = ff_stream_add_bitstream_filter(st, "pcm_rechunk", "n="AV_STRINGIFY(GXF_SAMPLES_PER_FRAME));
if (ret < 0)
@@ -733,7 +733,7 @@ static int gxf_write_header(AVFormatContext *s)
} else if (st->codecpar->codec_type == AVMEDIA_TYPE_VIDEO) {
if (i != 0) {
av_log(s, AV_LOG_ERROR, "video stream must be the first track\n");
- return -1;
+ return AVERROR(EINVAL);
}
/* FIXME check from time_base ? */
if (st->codecpar->height == 480 || st->codecpar->height == 512) { /* NTSC or NTSC+VBI */
@@ -750,7 +750,7 @@ static int gxf_write_header(AVFormatContext *s)
} else {
av_log(s, AV_LOG_ERROR, "unsupported video resolution, "
"gxf muxer only accepts PAL or NTSC resolutions currently\n");
- return -1;
+ return AVERROR(EINVAL);
}
if (!tcr)
tcr = av_dict_get(st->metadata, "timecode", NULL, 0);
--
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".
reply other threads:[~2024-03-20 16:29 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20240320162901.70879-1-stefasab@gmail.com \
--to=stefasab@gmail.com \
--cc=ffmpeg-devel@ffmpeg.org \
/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