Jump to content
  • Advertisement
Sign in to follow this  
mrmrcoleman

Direct Show.

This topic is 5217 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello. I am using Direct Show with Direct3D as in the Texture 3D9 example in the SDK. I noticed in a post on this forum a while ago that somebody had suggested inserting a Sleep(0) command in the main loop. What is this for? I am experiencing white flashes when the videos are playing and wondered if this could help. Kind regards. Mark Coleman

Share this post


Link to post
Share on other sites
Advertisement
If Windows thinks your process is dead it will paint the window white.

This will happen if you aren't processing the messages which are being sent to your window procedure or clearing the message queue. Make sure your message pump is still running and you actually act on the messages you get.


Sleep(0) gives up the remainder of the time which is allocated to the thread you call it from back to the system for use by other threads of equal or higher priority.

What the real effect of that will be depends on the context of where it's being used. In some cases it's a hack for broken graphics card device drivers...

Share this post


Link to post
Share on other sites
It's been my experience that on some systems, if you don't give up any of your time slice and you just keep executing and executing and executing, the other applications running start to act goofy... they don't get time to render their interfaces when they need to and such...


DirectShow by its nature is multi-threaded... this means you're relying on more than one thread getting execution time... hence it would seem to be a good idea to release some of your time slice

Share this post


Link to post
Share on other sites
Thank you for your replies.

S1CA, it is not the entire window that goes white, just the area of the screen where the video is being rendered to. Could this be the same problem?? I believe that I am dealing with all the messages that my program produces.

Thanks again.

Mark Coleman

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!