diff options
author | wm4 <wm4@nowhere> | 2019-06-09 19:17:35 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2019-09-19 20:37:05 +0200 |
commit | 91abd7a4f78901df1c6e343452136d53c50d8f2b (patch) | |
tree | 18dfe2c30524dd60e673313e9398db4d5775189c /demux/demux_lavf.c | |
parent | 4e4949b4dc229a3033407100916a474b6d3fd291 (diff) | |
download | mpv-91abd7a4f78901df1c6e343452136d53c50d8f2b.tar.bz2 mpv-91abd7a4f78901df1c6e343452136d53c50d8f2b.tar.xz |
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.
Diffstat (limited to 'demux/demux_lavf.c')
-rw-r--r-- | demux/demux_lavf.c | 6 |
1 files changed, 2 insertions, 4 deletions
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; |