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?
LVL 16
HooKooDooKuAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

DanRollinsCommented:
One easy-to-program option would be to copy the file to the user's temp directory, then play it from there.  First, it could be read quickly from there and secondly, much of it would be in the filesystem cache for even more-rapid access.  
Of course, you would need to delete the file later...
Also, you would need to verify that the copy operation did not take so much time that it would make this scenario impractical.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
HooKooDooKuAuthor Commented:
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:
http://www.experts-exchange.com/Programming/Multimedia_Programming/Q-23903066-Use-MCIWnd-to-'play'-and-AVI-file-from-memory.html
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
System Programming

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.