[FFmpeg-devel] [PATCH] avcodec/setts_bsf: set the output packet duration to 0

James Almer jamrial at gmail.com
Wed Feb 9 17:28:58 EET 2022


It's not possible to know the resulting packet's duration after
applying the expression as it depends on the timestamp of the next
packet, which we haven't seen yet.
The old duration, if any, is no longer valid, so just remove it.

Signed-off-by: James Almer <jamrial at gmail.com>
---
 libavcodec/setts_bsf.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/libavcodec/setts_bsf.c b/libavcodec/setts_bsf.c
index d604f91f71..56307fc8cd 100644
--- a/libavcodec/setts_bsf.c
+++ b/libavcodec/setts_bsf.c
@@ -180,6 +180,7 @@ static int setts_filter(AVBSFContext *ctx, AVPacket *pkt)
 
     pkt->pts = new_pts;
     pkt->dts = new_dts;
+    pkt->duration = 0;
 
     return ret;
 }
-- 
2.35.1



More information about the ffmpeg-devel mailing list