From f806e268c6c3a76f65b1282219e16fcdfb80a9b5 Mon Sep 17 00:00:00 2001 From: wm4 Date: Thu, 22 Aug 2013 18:23:33 +0200 Subject: stream: don't require streams to set s->pos in seek callback Instead, set s->pos depending on the success of the seek callback. --- stream/stream_dvd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'stream/stream_dvd.c') diff --git a/stream/stream_dvd.c b/stream/stream_dvd.c index 0372e6c3c0..340002fb46 100644 --- a/stream/stream_dvd.c +++ b/stream/stream_dvd.c @@ -354,13 +354,13 @@ static int fill_buffer(stream_t *s, char *buf, int len) pos = dvd_read_sector(s->priv, buf); if (pos < 0) return -1; + // dvd_read_sector() sometimes internally skips disk-level blocks s->pos = 2048*(pos - 1); return 2048; // full sector } static int seek(stream_t *s, int64_t newpos) { - s->pos=newpos; // real seek - dvd_seek(s->priv,s->pos/2048); + dvd_seek(s->priv,newpos/2048); return 1; } -- cgit v1.2.3