From 49813670219c3f1f3ab47835d407d355a6698174 Mon Sep 17 00:00:00 2001 From: wm4 Date: Mon, 7 Jul 2014 19:09:37 +0200 Subject: 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). --- demux/demux_disc.c | 4 ---- 1 file changed, 4 deletions(-) (limited to 'demux/demux_disc.c') 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; -- cgit v1.2.3