Link to home
Start Free TrialLog in
Avatar of HooKooDooKu
HooKooDooKu

asked on

Preload an AVI file

I have a CD with data and an application to view the data.  The application uses an MCIWnd to play an AVI file as a splash screen while data loads.  My problem is that after inserting the CD and executing the application, the video often is very jumpy.  If the application is executed a second time, the video plays smoothly.

Before the splash screen is displayed, a login screen appears.  I've already go the splash screen running in a secondary thread.  What I'd like to do to keep the video from jumping is to utilize the time the user is on the login screen to begin preloading the video.  What do I need to do to accomplish this.

So far, the two things I've tried are...
1. Hope to get the video file in the CD buffer by simply openning the AVI file and reading through it as a binary file.  Seems to work... sometimes.
2. Call the function...
    MCIWndSendString( m_hAVIWnd, "cue" );
...thinking that the "cue" command would possibly being preloading the video into MCIWnd memory.  But again, this is meeting with limited success.

Suggestions?
ASKER CERTIFIED SOLUTION
Avatar of DanRollins
DanRollins
Flag of United States of America image

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
Avatar of HooKooDooKu
HooKooDooKu

ASKER

Sorry, I've gotten side tracked from this issue and not quit ready to jump back to it.

DanRollins, I like the premis of the idea.  Bascially try to find a way to Cache the file on the hard drive and run it from the hard drive.  There are several ways that could possibly be implemented, especially since on second and subsequent times the program is run, I could store something in the registry that could possibly leave the file in the Temp folder and only replace it when the something like the date of the file on the CD is different from the cached date of the file in the TEMP folder.  Surely running things from the hard drive should be faster than from the CD.

But of course the idea does require cleanup and additional maintenence.

However, I wonder if there isn't a way I could effectively load the file into memory and run it from there?   OK, lets assign the points for this question an start that one in a new question:
https://www.experts-exchange.com/Programming/Multimedia_Programming/Q-23903066-Use-MCIWnd-to-'play'-and-AVI-file-from-memory.html