mirror of
https://github.com/mpv-player/mpv
synced 2024-12-27 01:22:30 +00:00
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.
This commit is contained in:
parent
4e4949b4dc
commit
91abd7a4f7
@ -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)
|
if (priv->pcm_seek_hack == st && !priv->pcm_seek_hack_packet_size)
|
||||||
priv->pcm_seek_hack_packet_size = pkt->size;
|
priv->pcm_seek_hack_packet_size = pkt->size;
|
||||||
|
|
||||||
if (pkt->pts != AV_NOPTS_VALUE)
|
dp->pts = mp_pts_from_av(pkt->pts, &st->time_base);
|
||||||
dp->pts = pkt->pts * av_q2d(st->time_base);
|
dp->dts = mp_pts_from_av(pkt->dts, &st->time_base);
|
||||||
if (pkt->dts != AV_NOPTS_VALUE)
|
|
||||||
dp->dts = pkt->dts * av_q2d(st->time_base);
|
|
||||||
dp->duration = pkt->duration * av_q2d(st->time_base);
|
dp->duration = pkt->duration * av_q2d(st->time_base);
|
||||||
dp->pos = pkt->pos;
|
dp->pos = pkt->pos;
|
||||||
dp->keyframe = pkt->flags & AV_PKT_FLAG_KEY;
|
dp->keyframe = pkt->flags & AV_PKT_FLAG_KEY;
|
||||||
|
Loading…
Reference in New Issue
Block a user