summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2013-05-03 20:30:08 +0200
committerwm4 <wm4@nowhere>2013-05-05 18:44:24 +0200
commit4ed22795bbe41838616e2cc941da792502791025 (patch)
tree3eac1e600e87864cd0a5ea92f1bcce42642372bb
parent4ba4d6ef3fe49978c76ecca008478cd1f5d97125 (diff)
downloadmpv-4ed22795bbe41838616e2cc941da792502791025.tar.bz2
mpv-4ed22795bbe41838616e2cc941da792502791025.tar.xz
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).
-rw-r--r--demux/demux_lavf.c6
1 files changed, 6 insertions, 0 deletions
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;
}