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_cdda.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'stream/stream_cdda.c') diff --git a/stream/stream_cdda.c b/stream/stream_cdda.c index 02ba28d54b..26ad560cae 100644 --- a/stream/stream_cdda.c +++ b/stream/stream_cdda.c @@ -213,9 +213,8 @@ static int seek(stream_t *s, int64_t newpos) int seek_to_track = 0; int i; - s->pos = newpos; - sec = s->pos / CDIO_CD_FRAMESIZE_RAW; - if (s->pos < 0 || sec > p->end_sector) { + sec = newpos / CDIO_CD_FRAMESIZE_RAW; + if (newpos < 0 || sec > p->end_sector) { p->sector = p->end_sector + 1; return 0; } -- cgit v1.2.3