diff options
author | Andreas Rheinhardt <andreas.rheinhardt@gmail.com> | 2019-08-13 04:47:19 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2019-08-15 01:26:21 +0200 |
commit | 789dcfaf58dbf19d050d53ba169fd352a6460641 (patch) | |
tree | d0d06553ecc32a0570cfe87b67b1f54c87c1e599 | |
parent | 114775955241c2cb742a701cc9eb6462d090f560 (diff) | |
download | ffmpeg-streaming-789dcfaf58dbf19d050d53ba169fd352a6460641.zip ffmpeg-streaming-789dcfaf58dbf19d050d53ba169fd352a6460641.tar.gz |
avformat/mux: Use av_packet_rescale_ts
ff_write_chained essentially duplicated the functionality of
av_packet_rescale_ts. This has been changed.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r-- | libavformat/mux.c | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/libavformat/mux.c b/libavformat/mux.c index c791221..0227c0d 100644 --- a/libavformat/mux.c +++ b/libavformat/mux.c @@ -1323,18 +1323,10 @@ int ff_write_chained(AVFormatContext *dst, int dst_stream, AVPacket *pkt, local_pkt = *pkt; local_pkt.stream_index = dst_stream; - if (pkt->pts != AV_NOPTS_VALUE) - local_pkt.pts = av_rescale_q(pkt->pts, - src->streams[pkt->stream_index]->time_base, - dst->streams[dst_stream]->time_base); - if (pkt->dts != AV_NOPTS_VALUE) - local_pkt.dts = av_rescale_q(pkt->dts, - src->streams[pkt->stream_index]->time_base, - dst->streams[dst_stream]->time_base); - if (pkt->duration) - local_pkt.duration = av_rescale_q(pkt->duration, - src->streams[pkt->stream_index]->time_base, - dst->streams[dst_stream]->time_base); + + av_packet_rescale_ts(&local_pkt, + src->streams[pkt->stream_index]->time_base, + dst->streams[dst_stream]->time_base); if (interleave) ret = av_interleaved_write_frame(dst, &local_pkt); else ret = av_write_frame(dst, &local_pkt); |