diff mbox series

[FFmpeg-devel,21/30] lavc/adxenc: rescale packet duration according to timebase

Message ID 20221127170351.11477-21-anton@khirnov.net
State New
Headers show
Series [FFmpeg-devel,01/30] lavc/libx264: factor out setting up the input frame | expand

Checks

Context Check Description
yinshiyou/make_loongarch64 success Make finished
yinshiyou/make_fate_loongarch64 success Make fate finished
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

Anton Khirnov Nov. 27, 2022, 5:03 p.m. UTC
The timebase does not always have to be 1/samplerate.
---
 libavcodec/adxenc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/libavcodec/adxenc.c b/libavcodec/adxenc.c
index 153c91b852..e1bf344b01 100644
--- a/libavcodec/adxenc.c
+++ b/libavcodec/adxenc.c
@@ -184,7 +184,7 @@  static int adx_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
     }
 
     avpkt->pts = frame->pts;
-    avpkt->duration = frame->nb_samples;
+    avpkt->duration = ff_samples_to_time_base(avctx, frame->nb_samples);
     *got_packet_ptr = 1;
     return 0;
 }