[FFmpeg-devel] [PATCH 3/7] avformat/tee: Handle AV_NOPTS_VALUE correctly
Hendrik Leppkes
h.leppkes at gmail.com
Mon Jul 4 18:07:19 EEST 2016
On Mon, Jul 4, 2016 at 4:45 PM, <sebechlebskyjan at gmail.com> wrote:
> From: Jan Sebechlebsky <sebechlebskyjan at gmail.com>
>
> Do not rescale pts and dts if they are set to
> AV_NOPTS_VALUE.
>
> Signed-off-by: Jan Sebechlebsky <sebechlebskyjan at gmail.com>
> ---
> libavformat/tee.c | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/libavformat/tee.c b/libavformat/tee.c
> index c276a37..a56d449 100644
> --- a/libavformat/tee.c
> +++ b/libavformat/tee.c
> @@ -533,8 +533,10 @@ 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);
> + if (pkt->pts != AV_NOPTS_VALUE)
> + pkt2.pts = av_rescale_q(pkt->pts, tb, tb2);
> + if (pkt->dts != AV_NOPTS_VALUE)
> + pkt2.dts = av_rescale_q(pkt->dts, tb, tb2);
Maybe this entire thing could use av_packet_rescale_ts?
> pkt2.duration = av_rescale_q(pkt->duration, tb, tb2);
> pkt2.stream_index = s2;
>
> --
> 1.9.1
>
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
More information about the ffmpeg-devel
mailing list