mirror of
https://github.com/obsproject/obs-studio.git
synced 2024-07-15 07:44:10 +00:00
obs-ffmpeg: Fix iteration over sample formats
This commit is contained in:
parent
ba38a7d9f4
commit
cf6adf84ab
|
@ -289,10 +289,10 @@ static void *enc_create(obs_data_t *settings, obs_encoder_t *encoder,
|
||||||
/* Check if the requested format is actually available for the specified
|
/* Check if the requested format is actually available for the specified
|
||||||
* encoder. This may not always be the case due to FFmpeg changes or a
|
* encoder. This may not always be the case due to FFmpeg changes or a
|
||||||
* fallback being used (for example, when libopus is unavailable). */
|
* fallback being used (for example, when libopus is unavailable). */
|
||||||
enum AVSampleFormat fmt = enc->codec->sample_fmts[0];
|
const enum AVSampleFormat *fmt = enc->codec->sample_fmts;
|
||||||
while (fmt != AV_SAMPLE_FMT_NONE) {
|
while (*fmt != AV_SAMPLE_FMT_NONE) {
|
||||||
if (fmt == sample_format) {
|
if (*fmt == sample_format) {
|
||||||
enc->context->sample_fmt = fmt;
|
enc->context->sample_fmt = *fmt;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
fmt++;
|
fmt++;
|
||||||
|
|
Loading…
Reference in a new issue