From 75bd5d3e2dde249e488f0e72284339e21aefa5c8 Mon Sep 17 00:00:00 2001 From: Jan Sebechlebsky Date: Sat, 16 Jul 2016 13:27:50 +0200 Subject: [PATCH] avformat/tee: Rescale ts using av_packet_rescale_ts This ensures that AV_NOPTS_VALUE value is handled correctly. Reviewed-by: Nicolas George Signed-off-by: Jan Sebechlebsky Signed-off-by: Marton Balint --- libavformat/tee.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/libavformat/tee.c b/libavformat/tee.c index daddba5741..b4158e18c1 100644 --- a/libavformat/tee.c +++ b/libavformat/tee.c @@ -543,9 +543,7 @@ static int tee_write_packet(AVFormatContext *avf, AVPacket *pkt) } tb = avf ->streams[s ]->time_base; tb2 = avf2->streams[s2]->time_base; - pkt2.pts = av_rescale_q(pkt->pts, tb, tb2); - pkt2.dts = av_rescale_q(pkt->dts, tb, tb2); - pkt2.duration = av_rescale_q(pkt->duration, tb, tb2); + av_packet_rescale_ts(&pkt2, tb, tb2); pkt2.stream_index = s2; if ((ret = av_apply_bitstream_filters(avf2->streams[s2]->codec, &pkt2,