一般用 Active 属性判断, 如果想用事件判断播放是否结束,用 FilterGraph1GraphComplete 即可
回楼上的,我现在就用的ACTIVE来判断的,但好像不起作用。代码如下://创建线程 if htimer =0 then htimer:=CreateWaitableTimer(nil,True,nil); //waitable函数 if dtthread =0 then begin dtthread :=CreateThread(nil,0,@mythread,nil,0,id); //线程 end else begin if fg1.Active =False then //Filtergraph 没被激活,清除线程,释放内存,同时创建线程 begin CloseHandle(dtthread ); dtthread :=0; dtthread :=CreateThread(nil,0,@mythread,nil,0,ID ); end else begin dtthread :=CreateThread(nil,0,@mythread,nil,0,id); //FilterGraph 被激活时,创建线程,看是不是在下一秒有新的定时播放任务。 end; end;
现在想试下:if fg1.play=false then closehan。dle(dtthread);不知道这个有用不,等出租回去试下
现在想试下, if fg1.play =false then closehandle(dtthread); 不知道这个有用不,出差回去试下
begin
dtthread :=CreateThread(nil,0,@mythread,nil,0,id); //线程
end
else
begin
if fg1.Active =False then //Filtergraph 没被激活,清除线程,释放内存,同时创建线程
begin
CloseHandle(dtthread );
dtthread :=0;
dtthread :=CreateThread(nil,0,@mythread,nil,0,ID );
end
else
begin
dtthread :=CreateThread(nil,0,@mythread,nil,0,id); //FilterGraph 被激活时,创建线程,看是不是在下一秒有新的定时播放任务。
end;
end;
closehan。dle(dtthread);不知道这个有用不,等出租回去试下
if fg1.play =false then
closehandle(dtthread);
不知道这个有用不,出差回去试下