[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-multimedia
Subject:    Re: Seeking in arts
From:       Martin Vogt <mvogt () rhrk ! uni-kl ! de>
Date:       2002-06-02 8:10:49
[Download RAW message or body]

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
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic