<div id="p213366" class="post bg2">
                <div class="inner"><span class="corners-top"><span></span></span>

                <div class="postbody">Hi all, this is my first post to the mailing list.  <br><br>I recently posted this on the forums and was told by Rémi Denis-Courmont to post it here for discussion.  I've included my original post and his response below.  As I state below, I have solved the initial problem fairly simply by reusing the existing playlist functionality, but I'm still looking for the best way to proceed within the existing code framework before trying to submit a patch.  At this point, I don't believe Rémi's point about there only being the one playlist per instance will be much of an issue for the browser plugins.<br>
<br>Thanx,<br>Nib<br>-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------<br>
Original Post:<br><br><div class="content">I've
been working to resolve an issue with the Mozilla plugin related to
playback of the playlist not continuing on to the next playlist item
and some audio distortion issues related to manually changing the
current playlist item. I've looked into the code for the plugin to find
that, in fact, the playback no longer supports any automatic
transitioning to the next playlist item upon reaching the end of the
current item. I've also noticed this same issue exists for the ActiveX
plugin.<br><br>I decided to tackle this issue myself and after looking
into the code base I came across a MediaListPlayer that I figured would
solve this issue nicely. Unfortunately, after converting the code to
use the MediaListPlayer, I encountered a threading deadlock whenever
the MediaListPlayer tried to transition to the next media item. I
traced this down to the fact that whenever the MediaPlayer finishes
playing an item it triggered the "libvlc_MediaPlayerEndReached" event
which in turn triggered the callback function registered to the
MediaListPlayer to trigger the transition to the next playlist item.
Unfortunately, this transition to the next playlist item causes the
deletion of the previous item and its callback functions (one of which
was currently in the process of executing). Therefore, the deletion
process ends up waiting for the callback to finish which never happens
because its waiting for the deletion to finish. I could get into more
details if need be, but that is the gist of it. <br><br>After thinking
about the issue for a while, I decided to look at the main playlist for
VLC to see how this issue was dealt with there. This, as it turns out,
is a much more robust playlist system than the media list. After
looking through the code, it seemed that fixing the MediaListPlayer
would be a rather involved process so I set out to make the plugin work
with the existing VLC playlist. This worked like a charm, it resolved
all the issues I had been having. However, the way I managed to get it
to work seems very hacky and involved using a deprecated function
"libvlc_playlist_get_media_player" as well as including two "private"
internal files (libvlc.h and control/libvlc_internal.h) from the /src
directory in order to get access to the actual playlist.<br><br>At this point I'm willing to put in some time to patch the plugins, but I have a few questions about how to proceed:<br>Is there any reason the browser plugin playlists should be using media lists instead of the VLC playlist?<br>
Is their someone actively working on the Media List Player?<br>Since it's deprecated, what is the proper way to achieve what "libvlc_playlist_get_media_player" offers?<br>Is there a way to obtain the VLC playlist_t* from the VLC instance without accessing the internal files from the /src folder?<br>
Is there anyone I should specifically be looking to direct these questions to? or speak with before submitting any changes?<br><br>I'm
basically looking for the proper way to proceed since the changes I
made will resolve the current issues, but seem to be at odds with the
overall design.</div>

                        
                </div></div></div>--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------<br><h3><a href="http://forum.videolan.org/viewtopic.php?f=32&t=63856#p213372"></a></h3>

                        <p class="author"><a href="http://forum.videolan.org/viewtopic.php?p=213372#p213372"><img src="http://forum.videolan.org/styles/videolan/imageset/icon_post_target.gif" alt="Post" title="Post" height="9" width="11"></a>by <strong><a href="http://forum.videolan.org/memberlist.php?mode=viewprofile&u=1687" style="color: rgb(255, 153, 0);" class="username-coloured">Rémi Denis-Courmont</a></strong> on Mon Aug 17, 2009 1:45 pm </p>


                        
                        <div class="content">Don't
use media list player. As you noted it can deadlock. I'm planning to
remove it anyway, but this is best discussed on the vlc-devel mailing
list.<br><br>It's probably a lot simpler to implement your own list and change the item whenever you get the end of item event.<br><br>Using the playlist is problematic as well, as there is only one per instance <img src="http://forum.videolan.org/images/smilies/icon_confused.gif" alt=":?" title="Confused"> .</div>


                        Rémi Denis-Courmont<br>--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------<br>