From 91abd7a4f78901df1c6e343452136d53c50d8f2b Mon Sep 17 00:00:00 2001 From: wm4 Date: Sun, 9 Jun 2019 19:17:35 +0200 Subject: demux_lavf: use common mpv/ffmpeg timestamp conversion function Probably doesn't change anything, other than looking slightly better. In theory, the common function has some stuff that makes it more likely that timestamps round-trip through conversions properly, but I didn't confirm that. --- demux/demux_lavf.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'demux') diff --git a/demux/demux_lavf.c b/demux/demux_lavf.c index e0bf24fd50..938181e125 100644 --- a/demux/demux_lavf.c +++ b/demux/demux_lavf.c @@ -1145,10 +1145,8 @@ static bool demux_lavf_read_packet(struct demuxer *demux, if (priv->pcm_seek_hack == st && !priv->pcm_seek_hack_packet_size) priv->pcm_seek_hack_packet_size = pkt->size; - if (pkt->pts != AV_NOPTS_VALUE) - dp->pts = pkt->pts * av_q2d(st->time_base); - if (pkt->dts != AV_NOPTS_VALUE) - dp->dts = pkt->dts * av_q2d(st->time_base); + dp->pts = mp_pts_from_av(pkt->pts, &st->time_base); + dp->dts = mp_pts_from_av(pkt->dts, &st->time_base); dp->duration = pkt->duration * av_q2d(st->time_base); dp->pos = pkt->pos; dp->keyframe = pkt->flags & AV_PKT_FLAG_KEY; -- cgit v1.2.3