From 24f1878e95020b8cb62a6f17301b1ec2209fa109 Mon Sep 17 00:00:00 2001 From: wm4 Date: Wed, 9 Apr 2014 23:11:57 +0200 Subject: stream_dvd, cache: hack seeking with --cache + dvd:// back into working This was broken at some unknown point (even before the recent cache changes). There are several problems: - stream_dvd returning a random stream position, confusing the cache layer (cached data and stream data lost their 1:1 corrospondence by position) - this also confused the mechanism added with commit a9671524, which basically triggered random seeking (although this was not the only problem) - demux_lavf requesting seeks in the stream layer, which resulted in seeks in the cache or the real stream Fix this by completely removing byte-based seeking from stream_dvd. This already works fine for stream_dvdnav and stream_bluray. Now all these streams do time-based seeks, and pretend to be infinite streams of data, and the rest of the player simply doesn't care about the stream byte positions. --- demux/demux_lavf.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'demux') diff --git a/demux/demux_lavf.c b/demux/demux_lavf.c index 00dc2aee2b..ceff978afb 100644 --- a/demux/demux_lavf.c +++ b/demux/demux_lavf.c @@ -130,6 +130,8 @@ static int64_t mp_seek(void *opaque, int64_t pos, int whence) struct demuxer *demuxer = opaque; struct stream *stream = demuxer->stream; int64_t current_pos; + if (stream_manages_timeline(stream)) + return -1; MP_DBG(demuxer, "mp_seek(%p, %"PRId64", %d)\n", stream, pos, whence); if (whence == SEEK_CUR) -- cgit v1.2.3