Page 1 of 1

VLC ActiveX Plugin v2 BUG stop() broken

Posted: 22 Sep 2010 18:08
by maconsoft
This is code work OK.
1. press button "Button1" - start play
2. press button "Button2" - stop play
3. press button "Button2" - destroy TVLCPlugin2

Code: Select all

procedure TForm1.Button1Click(Sender: TObject); begin vlc:=TVLCPlugin2.Create(self); vlc.Parent:=Self; vlc.Top:=0; vlc.Left:=0; vlc.Width:=300; vlc.Height:=200; vlc.Visible:=true; vlc.playlist.add('udp://@224.100.0.1:1234','udp://@224.100.0.1:1234',null); vlc.playlist.playItem(0); end; procedure TForm1.Button2Click(Sender: TObject); begin vlc.playlist.stop; vlc.playlist.clear; end; procedure TForm1.Button3Click(Sender: TObject); begin vlc.Destroy; {or FreeAndNil(vlc);} end;
This is code not working! why?

Code: Select all

procedure TForm1.Button1Click(Sender: TObject); begin vlc:=TVLCPlugin2.Create(self); vlc.Parent:=Self; vlc.Top:=0; vlc.Left:=0; vlc.Width:=300; vlc.Height:=200; vlc.Visible:=true; vlc.playlist.add('udp://@224.100.0.1:1234','udp://@224.100.0.1:1234',null); vlc.playlist.playItem(0); end; procedure TForm1.Button2Click(Sender: TObject); begin vlc.playlist.stop; vlc.playlist.clear; sleep(10000); vlc.Destroy; {or FreeAndNil(vlc);} end;
I play clips by circle.
Sequence of actions:
1. stop playing clip
2. clear playlist
3. add new clip to playlist
4. start play clip.

At a playing stop periodically VLC broken.

How correctly to stop play?
How correctly to destroy object?

Code: Select all

vlc.playlist.stop; vlc.playlist.clear; vlc.playlist.add('udp://@224.100.0.1:1234','udp://@224.100.0.1:1234',null); vlc.playlist.playItem(0);

Re: VLC ActiveX Plugin v2 BUG stop() broken

Posted: 26 Jan 2011 16:50
by maharg
Hi maconsoft,

Yes, at VLC 1.1.5. vlc.playlist.stop does appear to be badly broken.

I have got round this fairly reliably by using togglePause instead of stop :)

for example:

Code: Select all

procedure TfrmPlayermain.FormClose(Sender: TObject; var Action: TCloseAction); begin { n.b. as at VLC 1.1.5. pausing the playback is considerably more reliable when closing the form than stopping the playback, as calling playback.stop typically results in hung or zombied processes (check processes tab in Task Manager when testing !). GDL 26th January 2011 } LiveVLC.playlist.togglePause; repeat Application.ProcessMessages; // make sure the IPC gets done !!! until not LiveVLC.playlist.isPlaying; PostMessage(dmPlayer.ControlPanelHandle, dmPlayer.Msg_ChNotPlaying, dmPlayer.ChannelID, Application.Handle); LiveVLC.Free; end;
I've tested this about 30 times so far and it seems to be rock solid ! Lots more testing todo, but thought I'd share this promising avenue.

Let me know how you get on. I'm on Delphi 7 if that makes any difference...

Re: VLC ActiveX Plugin v2 BUG stop() broken

Posted: 06 Feb 2011 00:03
by oelison
Hello all.

I have the same problem with Stop() isn't working.
Pause isn't a good workaround when using streaming. It fills your memory until the programm crashes.
The same problem may apear at playitem(x). Somtimes it hung as stop().

Did't anybody know where the sourcecode is? I like to debug it.

Re: VLC ActiveX Plugin v2 BUG stop() broken

Posted: 07 Feb 2011 23:59
by Jean-Baptiste Kempf