diff options
author | 2013-05-03 20:30:08 +0200 | |
---|---|---|
committer | 2013-05-05 18:44:24 +0200 | |
commit | 4ed22795bbe41838616e2cc941da792502791025 (patch) | |
tree | 3eac1e600e87864cd0a5ea92f1bcce42642372bb | |
parent | 4ba4d6ef3fe49978c76ecca008478cd1f5d97125 (diff) |
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.c | 6 |
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; } |