Re: JavaScript concurrency issues & initialization delay

Forest Bond <[email protected]>
Newsgroups gmane.comp.mozilla.mplayerplug-in
Message-ID <[email protected]>
Hi,

On Fri, Sep 28, 2007 at 09:52:02AM -0600, Kevin DeKorte wrote:
> Forest Bond wrote:
> > I think it might just be a bug.  I've attached the logfile.
> > 
> > It's definitely not releated to setTimeout, because I hit the same issue with or
> > without that call.  What's interesting is that I can make the problem go away by
> > placing an alert(...) call after calling Stop().  I don't know why that would
> > be.
> > 
> > My code is doing something like this:
> > 
> > --------------------------------------------------------------------------------
> > if(mplayer.isplaying()) {
> >   mplayer.Stop();
> >   while(mplayer.playState != 1) {
> >     ;
> >   }
> > }
> > //alert('after Stop: ' + mplayer.playState);
> > 
> > mplayer.Open(new_url);
> > 
> > mplayer.Play();
> > while(mplayer.playState != 3) {
> >   ;
> > }
> > --------------------------------------------------------------------------------
> > 
> > As I mentioned above, uncommenting that alert(...) call makes the problem go
> > away.  Very strange.
> > 
> > What do you think?
> > 
> > -Forest
> 
> I agree that it is really odd.. have you tried putting a "sleep" inside
> the while loop? I'm not sure if javascript has that or not, but if so
> then maybe there and then maybe one more after the loop is done. I think
> 100usec should be enough.

No, JS doesn't have a sleep function...  I've thought about using a funky event
producer/consumer model, but I'd really rather not ...  Does the logfile give
you any info?

-Forest
-- 
Forest Bond
http://www.alittletooquiet.net

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/

_______________________________________________
Mplayerplug-in-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mplayerplug-in-devel
signature.asc (application/pgp-signature, 189 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFG/SYuRO4fQQdv5AwRAgBnAKCqpSz7fUBCVgniwvswDHaj+GKf9gCcDOc1
firAibeGF6FUO5sEgzGSQj8=
=YSuV
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.