From 4ed22795bbe41838616e2cc941da792502791025 Mon Sep 17 00:00:00 2001 From: wm4 Date: Fri, 3 May 2013 20:30:08 +0200 Subject: 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). --- demux/demux_lavf.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'demux/demux_lavf.c') diff --git a/demux/demux_lavf.c b/demux/demux_lavf.c index 8a8b003680..1bb811837b 100644 --- a/demux/demux_lavf.c +++ b/demux/demux_lavf.c @@ -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; } -- cgit v1.2.3