JL
2007-12-17 18:58:55 UTC
Hi,
On a general level, what reasons could cause that using an ActiveX in
application, the application refuses to close (have to kill it with
process explorer. The app hangs so bad, it even stops WinXP from
shutting down)?
I've recently played with an ActiveX (an ActiveX implementing the VLC
Player). I believe that the code below is quite OK, but anyway running
the app completely freezes the application - after it has done all that
it was supposed to do. I've debugged to code, and everything is executed
right until the last line of code. But then the thing freezes.
Could this be so simple, that the ActiveX code it self simply has a bug?
Or do you see something wrong below?
Jyri
-------------------------------------------
procedure TForm1.FormCreate(Sender: TObject);
var Voption : array of String;
var myVLC : TVLCPlugin;
var inputfile,outputfile:string;
begin
inputfile := Paramstr(1);
outputfile := 'D:\\stream.ts';
// Create the plugin -> done run-time
myVLC:= TVLCPlugin.Create(self);
myVLC.Parent := Self;
SetLength(Voption,2);
Voption[0] := ':dshow-adev=""none"":dshow-size=""""';
Voption[1] :=
':sout=#transcode{vcodec=mp2v,vb=1024,scale=1,acodec=mp2a,ab=192,channels=2}:duplicate{dst=std{access=file,mux=ts,dst=[TARGET]}}';
Voption[1]:= StringReplace(Voption[1],'[TARGET]',outputfile,[]);
myVLC.addTarget(inputfile, Voption, VLCPlayListReplaceAndGo, -1);
{ We are converting an input file (mpeg, avi, etc. to a .TS-file)
depending on how long movie you're converting, this might exit in a
second or after 15 minutes.}
While Integer(myVLC.Playing)<>0 do
begin
sleep(1000);
if Integer(myVLC.Playing)=0 then begin // converting OK and ready
myVLC.stop;
myVLC.playlistClear;
Break;
end;
end;
// Free the VLC - plugin.
FreeAndNil(myVLC);
ShowMessage('Done'); // I can see the message
Application.Terminate;
end;
On a general level, what reasons could cause that using an ActiveX in
application, the application refuses to close (have to kill it with
process explorer. The app hangs so bad, it even stops WinXP from
shutting down)?
I've recently played with an ActiveX (an ActiveX implementing the VLC
Player). I believe that the code below is quite OK, but anyway running
the app completely freezes the application - after it has done all that
it was supposed to do. I've debugged to code, and everything is executed
right until the last line of code. But then the thing freezes.
Could this be so simple, that the ActiveX code it self simply has a bug?
Or do you see something wrong below?
Jyri
-------------------------------------------
procedure TForm1.FormCreate(Sender: TObject);
var Voption : array of String;
var myVLC : TVLCPlugin;
var inputfile,outputfile:string;
begin
inputfile := Paramstr(1);
outputfile := 'D:\\stream.ts';
// Create the plugin -> done run-time
myVLC:= TVLCPlugin.Create(self);
myVLC.Parent := Self;
SetLength(Voption,2);
Voption[0] := ':dshow-adev=""none"":dshow-size=""""';
Voption[1] :=
':sout=#transcode{vcodec=mp2v,vb=1024,scale=1,acodec=mp2a,ab=192,channels=2}:duplicate{dst=std{access=file,mux=ts,dst=[TARGET]}}';
Voption[1]:= StringReplace(Voption[1],'[TARGET]',outputfile,[]);
myVLC.addTarget(inputfile, Voption, VLCPlayListReplaceAndGo, -1);
{ We are converting an input file (mpeg, avi, etc. to a .TS-file)
depending on how long movie you're converting, this might exit in a
second or after 15 minutes.}
While Integer(myVLC.Playing)<>0 do
begin
sleep(1000);
if Integer(myVLC.Playing)=0 then begin // converting OK and ready
myVLC.stop;
myVLC.playlistClear;
Break;
end;
end;
// Free the VLC - plugin.
FreeAndNil(myVLC);
ShowMessage('Done'); // I can see the message
Application.Terminate;
end;