diff mbox series

[FFmpeg-devel] avcodec: Fix time reporting for DFPWM streams

Message ID d5969fde-6567-780b-8da9-d322cb479353@gmail.com
State Accepted
Commit 75638fe9402f70645bdde4d95672fa640a327300
Headers show
Series [FFmpeg-devel] avcodec: Fix time reporting for DFPWM streams | expand

Checks

Context Check Description
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished
andriy/make_armv7_RPi4 success Make finished
andriy/make_fate_armv7_RPi4 success Make fate finished

Commit Message

Jack Bruienne June 10, 2022, 9:30 p.m. UTC
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>
---
  libavcodec/utils.c | 2 ++
  1 file changed, 2 insertions(+)

Comments

Paul B Mahol June 11, 2022, 8:41 a.m. UTC | #1
lgtm
diff mbox series

Patch

diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index eb7e505a..940f25fe 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -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)
 {
     switch (codec_id) {
+    case AV_CODEC_ID_DFPWM:
+        return 1;
     case AV_CODEC_ID_8SVX_EXP:
     case AV_CODEC_ID_8SVX_FIB:
     case AV_CODEC_ID_ADPCM_ARGO: