Aubin Paul wrote:
> On Mon, Oct 27, 2003 at 04:43:21PM +0100, Dirk Meyer wrote:
>> It's only needed if you skip to the playlist too fast. 
>
> That's not when this is happening. The problem arises for basic
> playback. I play a folder full of music (it plays a track, and then
> when the first finishes, just before the second starts it raises this
> problem)
>
>> Current cvs should return and not raise an error. But we still need to
>> figure out _why_ the systems wants to stop.
>
> Presumably it's because the first song is finished; it's trying to
> stop that, but it stops the next one.

OK, first odd thing: there is no playlist in the trace. Since you play
a whole directory, playlist has to be in the trace. Second, detach is
in the trace. It should only be in the trace if you are in detach mode
(which I guess you are not). So I guess: playlist stopps the child,
than detach does the same and fails.

Let's see: childapp sends AUDIO_PLAY_END. This is passed to
mplayer.py. 

        if event == AUDIO_PLAY_END:
            event = PLAY_END

        if event in ( STOP, PLAY_END, USER_END ):
            self.playerGUI.stop()
            return self.item.eventhandler(event)

ok, at this point stop() stopps the child (playerGUI -> mplayer ->
childapp). Back to self.item.eventhandler(event). AudioItem has none,
so it's Item:

        # give the event to the next eventhandler in the list
        if self.parent:
            return self.parent.eventhandler(event, menuw)

This is a Directory, also known as Playlist:

        if event in ( em.PLAYLIST_NEXT, em.PLAY_END, em.USER_END) \
               and self.current_item and self.playlist:
            pos = self.playlist.index(self.current_item)
            pos = (pos+1) % len(self.playlist)

            if pos:
                if hasattr(self.current_item, 'stop'):
                    try:
                        self.current_item.stop()
                    except OSError:
                        _debug_('ignore playlist event', 1)
                        return True
                self.current_item = self.playlist[pos]
                self.play(menuw=menuw, arg='next')
                return True


Oops, this stopps the child again. Very bad. This may be a bug, but I
don't see how detach gets involved.

[ 10 min later ]

OK, the second stop() doesn't hurt, there is a check for that. But for
some reason the eventhandler returns None and the plugin eventshandler
get called ... and that's detach. For the record: I can reproduce the
bug. You need to detach the playing and attach it again.

[ 10 min later ]



NOOOOOOOOOOOOOOOOOOOOOOOOOOOOO!!!!!!!!!!!!!!!!!!!!

directory.py eventhandler:

        Playlist.eventhandler(self, event, menuw)

changing it to

        return Playlist.eventhandler(self, event, menuw)

and the bug is gone. 

Sorry for the long mail, but it may help you to understand the stuff
and find bugs in the future (not that there are bugs).


Please test it!


Dischi, now needing a good drink

-- 
The best things in life aren't things.


-------------------------------------------------------
This SF.net email is sponsored by: The SF.net Donation Program.
Do you like what SourceForge.net is doing for the Open
Source Community?  Make a contribution, and help us add new
features and functionality. Click here: http://sourceforge.net/donate/
_______________________________________________
Freevo-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/freevo-devel

Reply via email to