From: Anton Khirnov <anton@khirnov.net>
To: ffmpeg-devel@ffmpeg.org
Subject: [FFmpeg-devel] [PATCH 3/3] lavc/encode: pick a sane default for bits_per_raw_sample if it's not set
Date: Thu, 20 Jan 2022 17:05:06 +0100
Message-ID: <20220120160506.32698-3-anton@khirnov.net> (raw)
In-Reply-To: <20220120160506.32698-1-anton@khirnov.net>
Fixes #9563.
---
libavcodec/encode.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/libavcodec/encode.c b/libavcodec/encode.c
index b6f81d1458..44ab81af3f 100644
--- a/libavcodec/encode.c
+++ b/libavcodec/encode.c
@@ -535,6 +535,9 @@ static int encode_preinit_audio(AVCodecContext *avctx)
return AVERROR(EINVAL);
}
+ if (!avctx->bits_per_raw_sample)
+ avctx->bits_per_raw_sample = 8 * av_get_bytes_per_sample(avctx->sample_fmt);
+
return 0;
}
--
2.33.0
_______________________________________________
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:[~2022-01-20 16:05 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-20 16:05 [FFmpeg-devel] [PATCH 1/3] lavc/encode: factor audio/video-specific parts out of ff_encode_preinit() Anton Khirnov
2022-01-20 16:05 ` [FFmpeg-devel] [PATCH 2/3] lavc/encode: reindent Anton Khirnov
2022-01-20 16:05 ` Anton Khirnov [this message]
2022-01-20 18:58 ` [FFmpeg-devel] [PATCH 3/3] lavc/encode: pick a sane default for bits_per_raw_sample if it's not set Martijn van Beurden
2022-01-20 21:18 ` Anton Khirnov
2022-01-23 13:15 ` Martijn van Beurden
2022-01-23 20:01 ` Anton Khirnov
2022-01-20 21:18 ` Martijn van Beurden
2022-02-20 14:19 ` Anton Khirnov
2022-02-20 17:05 ` Paul B Mahol
2022-04-06 11:24 ` Paul B Mahol
2022-04-13 10:57 ` Anton Khirnov
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=20220120160506.32698-3-anton@khirnov.net \
--to=anton@khirnov.net \
--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