avformat/tee: Rescale ts using av_packet_rescale_ts
authorJan Sebechlebsky <sebechlebskyjan@gmail.com>
Sat, 16 Jul 2016 11:27:50 +0000 (13:27 +0200)
committerMarton Balint <cus@passwd.hu>
Sat, 23 Jul 2016 18:02:05 +0000 (20:02 +0200)
This ensures that AV_NOPTS_VALUE value is handled
correctly.

Reviewed-by: Nicolas George <george@nsup.org>
Signed-off-by: Jan Sebechlebsky <sebechlebskyjan@gmail.com>
Signed-off-by: Marton Balint <cus@passwd.hu>
libavformat/tee.c

index daddba5..b4158e1 100644 (file)
@@ -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,