Re: pausing before playing makes popcorn won't play anything

peng tian <[email protected]>
Newsgroups gmane.comp.video.freevo.devel
Message-ID <[email protected]>
2009/9/11 Jason Tackaberry <[email protected]>:
> On Fri, 2009-09-11 at 11:42 +0800, peng tian wrote:
>> Calling player.pause() before player.play() causes the play inprogress
>> won't finish and the playback won't start,
>> and the mplayer process won't start either.
>
> Can you try this with popcorn2?  (It's in WIP/popcorn2)
>
> It's not complete yet, but the architecture should be much cleaner.
>
> In particular, in your example, the line where you have commented "this
> line causes the problem" should, with popcorn2, raise an exception
> because the player is not in the appropriate state for pause()
> (STATE_PLAYING).  Also, player.resume() should raise because the player
> is not in STATE_PAUSED.
>
> The original kaa.popcorn tried to be clever in handling these various
> scenarios (calling methods not appropriate for the given state), but, as
> you can see, was not clever enough.
>
> kaa.popcorn2 does what I think is much more sensible and raises when the
> state doesn't make sense.

Ahh, if you raise exception I agree.
if the callee requires an appropriate state let the caller know. In
original kaa.popcorn it appears safe to call those methods in a wrong
state.

> A proper UI would have the pause button disabled when the player isn't
> in the appropriate states anyway, don't you think?

In most cases it's true. but sometimes the pause operation is not
caused by pressing the 'pause' button, for example in freevo i play a
video while the music is in background. I know in this case the caller
must handle more details to avoid getting an exception raised.

> Thanks for your feedback.  If you have any more, especially about
> popcorn2, please let me know.

I didn't know popcorn2 before. I will try to use it and look into it,
and if possible make some suggestions.

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
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.