summaryrefslogtreecommitdiffstats
path: root/demux
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2019-06-09 19:17:35 +0200
committerwm4 <wm4@nowhere>2019-09-19 20:37:05 +0200
commit91abd7a4f78901df1c6e343452136d53c50d8f2b (patch)
tree18dfe2c30524dd60e673313e9398db4d5775189c /demux
parent4e4949b4dc229a3033407100916a474b6d3fd291 (diff)
downloadmpv-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')
-rw-r--r--demux/demux_lavf.c6
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;