summaryrefslogtreecommitdiffstats
path: root/demux/demux_disc.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-07-07 19:09:37 +0200
committerwm4 <wm4@nowhere>2014-07-07 19:09:37 +0200
commit49813670219c3f1f3ab47835d407d355a6698174 (patch)
tree8e65a6b1d490934d0aad326f5013cfdcf7e74d71 /demux/demux_disc.c
parent4d829d750cc872ae4e6bf31117022f8934230972 (diff)
downloadmpv-49813670219c3f1f3ab47835d407d355a6698174.tar.bz2
mpv-49813670219c3f1f3ab47835d407d355a6698174.tar.xz
cache, dvd, bluray: simplify stream time handling
We used a complicated and approximate method to cache the stream timestamp, which is basically per-byte. (To reduce overhead, it was only cached per 8KB-block, so it was approximate.) Simplify this, and read/keep the timestamp only on discontinuities. This is when demux_disc.c actually needs the timestamp. Note that caching is currently disabled for dvdnav, but we still read the timestamp only after some data is read. libdvdread behaves well, but I don't know about libbluray, and the previous code also read the timestamp only after reading data, so try to keep it safe. Also drop the start_time offset. It wouldn't be correct anymore if used with the cache, and the idea behind it wasn't very sane either (making the player to offset the initial playback time to 0).
Diffstat (limited to 'demux/demux_disc.c')
-rw-r--r--demux/demux_disc.c4
1 files changed, 0 insertions, 4 deletions
diff --git a/demux/demux_disc.c b/demux/demux_disc.c
index 0ee9dd8841..97b756dfb3 100644
--- a/demux/demux_disc.c
+++ b/demux/demux_disc.c
@@ -285,8 +285,6 @@ static int d_open(demuxer_t *demuxer, enum demux_check check)
if (demuxer->stream->uncached_type == STREAMTYPE_CDDA)
demux = "+rawaudio";
- reset_pts(demuxer);
-
p->slave = demux_open(demuxer->stream, demux, NULL, demuxer->global);
if (!p->slave)
return -1;
@@ -294,8 +292,6 @@ static int d_open(demuxer_t *demuxer, enum demux_check check)
// So that we don't miss initial packets of delayed subtitle streams.
p->slave->stream_select_default = true;
- demuxer->start_time = p->pts[STREAM_VIDEO].base_time;
-
// Can be seekable even if the stream isn't.
demuxer->seekable = true;