diff mbox series

[FFmpeg-devel,14/21] fftools/ffmpeg: stop using packet pts for decoded audio frame pts

Message ID 20230427142601.2613-14-anton@khirnov.net
State Accepted
Commit b6e7d6439462e187e4725b611bd996d3ba939df6
Headers show
Series [FFmpeg-devel,01/21] fftools/ffmpeg: deprecate -adrift_threshold | expand

Checks

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

Commit Message

Anton Khirnov April 27, 2023, 2:25 p.m. UTC
If input packets have timestamps, they will be propagated to output
frames by the decoder, so at best this block does not do anything.

There can also be an arbitrary amount of delay between packets sent to
the decoder and decoded frames (e.g. due to decoder's intrinsic delay or
frame threading), so deriving any timestamps from packet properties is
wrong.
---
 fftools/ffmpeg.c | 3 ---
 1 file changed, 3 deletions(-)
diff mbox series

Patch

diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c
index eae0093cce..5913a57d16 100644
--- a/fftools/ffmpeg.c
+++ b/fftools/ffmpeg.c
@@ -911,9 +911,6 @@  static int decode_audio(InputStream *ist, AVPacket *pkt, int *got_output,
 
     if (decoded_frame->pts != AV_NOPTS_VALUE) {
         decoded_frame_tb   = ist->st->time_base;
-    } else if (pkt && pkt->pts != AV_NOPTS_VALUE) {
-        decoded_frame->pts = pkt->pts;
-        decoded_frame_tb   = pkt->time_base;
     }else {
         decoded_frame->pts = ist->dts;
         decoded_frame_tb   = AV_TIME_BASE_Q;