forked from FFmpeg/FFmpeg
avcodec/encode: Fix default setting of bits_per_raw_sample
bits_per_raw_sample doesn't always match size of AV_SAMPLE_FMT_, e.g., S24. Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
This commit is contained in:
parent
b56b343e43
commit
35dc129940
1 changed files with 2 additions and 0 deletions
|
@ -736,6 +736,8 @@ static int encode_preinit_audio(AVCodecContext *avctx)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!avctx->bits_per_raw_sample)
|
||||||
|
avctx->bits_per_raw_sample = av_get_exact_bits_per_sample(avctx->codec_id);
|
||||||
if (!avctx->bits_per_raw_sample)
|
if (!avctx->bits_per_raw_sample)
|
||||||
avctx->bits_per_raw_sample = 8 * av_get_bytes_per_sample(avctx->sample_fmt);
|
avctx->bits_per_raw_sample = 8 * av_get_bytes_per_sample(avctx->sample_fmt);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue