Link to home
Start Free TrialLog in
Avatar of p_oliver
p_oliver

asked on

Playing .avi files many times causes problems

I have an application which plays .avi files. When I get a notification that the movie has ended I want to start another movie and so on. This works well for 5-6 hours (each movie lasts approx 30 seconds) then the program locks up. The code in the OnNotify event looks something like the following

   MoviePlayer.Wait := true;
   MoviePlayer.Notify := false;

   MoviePlayer.Close;

   MoviePlayer.FileName := 'plate.avi';

   MoviePlayer.Open;

   MoviePlayer.Wait := false;
   MoviePlayer.Notify := true;

   MoviePlayer.Play;

I have displayed a bunch of stuff about the memory and heap status each time the movie ends but nothing obvious shows up (I accept this may be due to my lack of skill in interpretation).

This is the first time I've used this service so I'm unsure whether I can e-mail you my test program.

Thanks in advance.

Regards
Avatar of p_oliver
p_oliver

ASKER

Edited text of question
ASKER CERTIFIED SOLUTION
Avatar of d003303
d003303

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
My apologies for the time taken to try your suggestions. I like
your thinking but unfortunately it only produced a slight
improvement - the program locked up after approx 7 hours
rather than the 5-6 hours previously.

I am experimenting further and have removed all code from
the OnNotify handler with the exception of the PostMessage.

The message handler now does all the manipulation of the
media player. I did this because it occured to me that switching
the notify condition off and on within the OnNotify handler might
be causing some nasty or recursive effect.

I greatly appreciate your input, if you have any other ideas to
suggest I would be most grateful.