Re: WMP doesn't play a media on a thread
- From: "Alessandro Angeli" <nobody@xxxxxxxxxxxxxxxxxx>
- Date: Wed, 14 May 2008 17:09:34 -0400
From: "sisimma"
Is there anyone who can tell the difference between a[...]
class, which maybe it runs on a process, and a thread,
which is created from the class?
You are comparing apple and oranges: a thread is a sequence
of operations executed at runtime while a class is just a
way to organize your source code for the compiler. All code
is executed on a thread, whether created by you or somebody
else, and regardless of where you put it in your source
files.
The problem here is that you seem to not be waiting for WMP
to even start playing, let alone finish playing, before
uninitializing COM and destroying the thread, without even
properly releasing WMP. You are most likely causing a
resource leak and you are lucky you are not causing a crash.
Most likely it works when you call the function from your
main thread simply because the main thread will keep running
giving WMP time to perform its task.
You must wait for WMP to finish playing, then you can
release it, uninitialize COM and let the thread exit. It
would be a good idea to also dispatch messages on this
thread while you wait for WMP to finish.
--
// Alessandro Angeli
// MVP :: DirectShow / MediaFoundation
// mvpnews at riseoftheants dot com
// http://www.riseoftheants.com/mmx/faq.htm
.
- Follow-Ups:
- Re: WMP doesn't play a media on a thread
- From: sisimma
- Re: WMP doesn't play a media on a thread
- References:
- WMP doesn't play a media on a thread
- From: sisimma
- WMP doesn't play a media on a thread
- Prev by Date: WMP doesn't play a media on a thread
- Next by Date: How to play DVD in wmp SDK version 11?
- Previous by thread: WMP doesn't play a media on a thread
- Next by thread: Re: WMP doesn't play a media on a thread
- Index(es):
Relevant Pages
|
Loading