Page 1 of 1

ActiveX playlistClear/addTarget inconsistency

Posted: 06 Oct 2006 18:33
by maharg
Hello,

I'm putting together an application in Delphi using VLC via the ActiveX control. The code (paraphrased) looks something like this:

A procedure to play an arbitrary MRL:

Code: Select all

procedure TForm1.play(mrl: String); var Parameter: array of String; begin // set parameters setLength(Parameter, 2); Parameter[0] := 'vout-filter=deinterlace'; Parameter[1] := 'deinterlace-mode=bob'; // stop and clear playlist Form1.VLCPlugin1.stop; Form1.VLCPlugin1.playlistClear; // add the new mrl Form1.VLCPlugin1.addTarget( mrl, Parameter, VLCPlayListInsertAndGo, 0); // play Form1.VLCPlugin1.play; end;
An event procedure called when button 1 is clicked, causes a file to be played:

Code: Select all

procedure TForm1.button1Click(Sender: TObject); begin // play a transport stream from a file play('d:\video\somevideo.ts'); end;
An event procedure called when button 2 is clicked, causes a multicast udp stream to be played:

Code: Select all

procedure TForm1.button2Click(Sender: TObject); begin // play a udp multicast play('udp://@227.1.0.5:1234); end;
If I click on button 1 the file somevideo.ts plays as expected.

If I click button 2 before the playback of somevideo.ts completes, then VLC switches to playing the udp multicast as expected.

If, however, I click button 2 AFTER the playback of somevideo.ts completes, then VLC plays somevideo.ts again, before playing the udp multicast. In this case it seems that the playlist is not being cleared once it has fully played out.

thanks,

Graham

Re: ActiveX playlistClear/addTarget inconsistency

Posted: 23 Oct 2006 03:24
by DaLord
I've had the same problem... but using this

Code: Select all

const VLCPlayListInsertAndGo = $0009; ... VLCPlugin.PlaylistClear; VLCPlugin.AddTarget(URL, null, VLCPlayListInsertAndGo, 0);
it does what it is supposed to!

Cheers!

Posted: 23 Oct 2006 10:41
by maharg
thanks DaLord, but that hasn't resolved the problem. If the playlist (in this case containing a single file mrl) plays through to completion, then the playlist is not cleared as it should be.

Re: ActiveX playlistClear/addTarget inconsistency

Posted: 29 Aug 2010 12:06
by Jaco
Hey, Im having the same problems with playing a new item in the playlist. Ive tried stop and clearing playlist and after "addtarget(newitem)" the prev item is played...

I tried all the code on this topic. Im also using Delphi 7 and VLC 1.0.3

Any suggestions?