]> git.sesse.net Git - ffmpeg/blobdiff - doc/examples/muxing.c
Merge commit '44127546b0a81dc9dd6190739a62d48f0044c6f3'
[ffmpeg] / doc / examples / muxing.c
index ad8e027148d34eae42905af672344f9b31568f58..19f4ba33a32980d4d665ed8f893ba3b7294a1e87 100644 (file)
@@ -63,9 +63,7 @@ static void log_packet(const AVFormatContext *fmt_ctx, const AVPacket *pkt)
 static int write_frame(AVFormatContext *fmt_ctx, const AVRational *time_base, AVStream *st, AVPacket *pkt)
 {
     /* rescale output packet timestamp values from codec to stream timebase */
-    pkt->pts = av_rescale_q_rnd(pkt->pts, *time_base, st->time_base, AV_ROUND_NEAR_INF|AV_ROUND_PASS_MINMAX);
-    pkt->dts = av_rescale_q_rnd(pkt->dts, *time_base, st->time_base, AV_ROUND_NEAR_INF|AV_ROUND_PASS_MINMAX);
-    pkt->duration = av_rescale_q(pkt->duration, *time_base, st->time_base);
+    av_packet_rescale_ts(pkt, *time_base, st->time_base);
     pkt->stream_index = st->index;
 
     /* Write the compressed frame to the media file. */