avcodec: fix time reporting for DFPWM streams

This adds the exact bits per sample for DFPWM to
av_get_exact_bits_per_sample.
Previously, the DTS and PTS were set to 0 because the codec never
reported them, but adding this allows libavformat to automatically
set DTS and PTS from the byte position of the stream.

Signed-off-by: Jack Bruienne <jackbruienne@gmail.com>
This commit is contained in:
Jack Bruienne 2022-06-26 17:04:42 +02:00 committed by Paul B Mahol
parent 9dfec90253
commit 75638fe940
1 changed files with 2 additions and 0 deletions

View File

@ -495,6 +495,8 @@ const char *avcodec_profile_name(enum AVCodecID codec_id, int profile)
int av_get_exact_bits_per_sample(enum AVCodecID codec_id) int av_get_exact_bits_per_sample(enum AVCodecID codec_id)
{ {
switch (codec_id) { switch (codec_id) {
case AV_CODEC_ID_DFPWM:
return 1;
case AV_CODEC_ID_8SVX_EXP: case AV_CODEC_ID_8SVX_EXP:
case AV_CODEC_ID_8SVX_FIB: case AV_CODEC_ID_8SVX_FIB:
case AV_CODEC_ID_ADPCM_ARGO: case AV_CODEC_ID_ADPCM_ARGO: