From kde-multimedia Sun Jun 02 08:10:49 2002 From: Martin Vogt Date: Sun, 02 Jun 2002 08:10:49 +0000 To: kde-multimedia Subject: Re: Seeking in arts X-MARC-Message: https://marc.info/?l=kde-multimedia&m=102300553204248 On Sat, Jun 01, 2002 at 09:00:03PM +0200, Ralf Schmelter wrote: > Hello! > > player->play(); > player->seek(Arts::poTime(10, 0, 0, "")); This is too fast. The play call succeeds before the lenght is known. A seek is only possible, after you have the length. Reason: decoding runs in a seperate thread. (We really need a unthreaded mp3 decoder,any volunteers?) I think if you use the SplayPlayBject you wont have this problem. Possible solution for you: // poll until length is known while(player->status() != eof()){ if (player->length() > 0) break; sleep(1); } // seek here > player->pause(); > player->seek(Arts::poTime(10, 0, 0, "")); > } > > After that a can start playing by calling play() and suspend by calling > pause(), which seems correct to me. The only problem is, that the seek > function fails many times (the error message is: > COMMAND:ignore command seek in _STREAM_STATE_FIRST_INIT > If I call capability(), it returns 2 (which means no seeking, just pausing), > but as you can see, if you try often enough it will work. > > So my question is, what I'm I doing wrong? Do I have to wait some time, before > I can call see()? The documentation unfortunately wasn't of much help to me. > > _______________________________________________ kde-multimedia mailing list kde-multimedia@mail.kde.org http://mail.kde.org/mailman/listinfo/kde-multimedia