mirror of https://github.com/mpv-player/mpv
demux_lavf: set stream_pts
demux_mpg did the same, and doing this in demux_lavf fixes DVD playback when using this demuxer. Additionally this might make bluray work better in the future (but for now, bluray playback doesn't change as it doesn't report stream PTS yet).
This commit is contained in:
parent
4ba4d6ef3f
commit
4ed22795bb
|
@ -640,6 +640,12 @@ static int demux_lavf_fill_buffer(demuxer_t *demux, demux_stream_t *dsds)
|
|||
}
|
||||
dp->pos = demux->filepos;
|
||||
dp->keyframe = pkt->flags & AV_PKT_FLAG_KEY;
|
||||
// Use only one stream for stream_pts, otherwise PTS might be jumpy.
|
||||
if (stream->type == STREAM_VIDEO) {
|
||||
double pts;
|
||||
if (stream_control(demux->stream, STREAM_CTRL_GET_CURRENT_TIME, &pts) > 0)
|
||||
dp->stream_pts = pts;
|
||||
}
|
||||
demuxer_add_packet(demux, stream, dp);
|
||||
return 1;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue