[vlc-devel] [PATCH] Reshuffle after playthrough

Alex Warhawk ax.warhawk at gmail.com
Mon Sep 30 23:39:02 CEST 2013


there is no simple way to check whether all elements have been played, it
would require me keep track of everything as well as managing adding /
removing elements from the playlist.

my patch does the following: when the NextItem function is invoked as
result of automatically advancing. it checks if the last element has been
played and if so: shuffles the playlist and restarts with element 0.

when using the next button the NextItem function works different. instead
of simply increment i_current_index it uses the p_sys->request mechanism to
figure out which element to play next. firstly i am afraid of breaking
stuff when i alter the code to much (i'm not very familiar with the source
code). secondly when i add shuffle the same way i did on the other part,
there won't be a guarantee every element is played once before shuffling
again.

reason: NextItem gets told which element to play next. if i reshuffle the
playlist this next element which should be played might not be the first
element of the new order, hence some elements are not played before the
last one is reached.
if i override the element request in any way i might break the whole
request mechanism.


On Mon, Sep 30, 2013 at 11:22 PM, Jean-Baptiste Kempf <jb at videolan.org>wrote:

> On 30 Sep, Alex Warhawk wrote :
> > i agree with you, but i only found a way to integrate this for
> > automatically advancing to the next element.
> > the code which gets executed when hitting the next button is totally
> > different hence i was unable to find the right spot to put my code in
> > without breaking something or achieving the task fully.
> >
> > example, letting vlc play for ever
> > A -> C -> B -(reshuffle)-> B -> C -> A -(reshuffle)-> C -> B -> A etc
> >
> > example, hitting next over and over gain
> > A -> C -> B -> A -> C -> B -> A -> C -> B -> etc.
>
> Why no reshuffle when all of the elements have been played once?
>
> --
> Jean-Baptiste Kempf
> http://www.jbkempf.com/ - +33 672 704 734
> Sent from my Electronic Device
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20130930/d40c5f74/attachment.html>


More information about the vlc-devel mailing list