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

Anton Khirnov anton at khirnov.net
Sun Nov 27 19:03:42 EET 2022


The timebase does not always have to be 1/samplerate.
---
 libavcodec/adxenc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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;
 }
-- 
2.35.1



More information about the ffmpeg-devel mailing list