Show
Ignore:
Timestamp:
08/09/10 19:02:31 (4 years ago)
Author:
robert
Message:

From David Fries, merge from a series of related submission emails:

"enable thread locking in libavcodec

This is required for a multithreaded application using ffmpeg from
another thread."

"Prevent the audio from videos from hanging on exit if they are paused.
The video decoder already has similar logic."

"Add a way to retrieve the creation time for MPEG-4 files."

"fmpeg, improve wait for close logic

Both audio and video destructors have been succesfully using the logic,
if(isRunning())
{

m_exit = true;
join();

}
since it was introduced,

but the close routines are using,
m_exit = true;
if(isRunning() && waitForThreadToExit)
{

while(isRunning()) { OpenThreads::Thread::YieldCurrentThread?(); }

}
which not only is it doing an unnecessary busy wait, but it doesn't
guaranteed that the other thread has terminated, just that it has
progressed far enough that OpenThreads? has set the thread status as
not running. Like the destructor set the m_exit after checking
isRunning() to avoid the race condition of not getting to join()
because the thread was running, but isRunning() returns false.

Now that FFmpeg*close is fixed, call it from the destructor as well
to have that code in only one location."

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • OpenSceneGraph/trunk/include/osg/ImageStream

    r9910 r11706  
    7777        LoopingMode getLoopingMode() const { return _loopingMode; } 
    7878 
    79  
     79        virtual double getCreationTime() const { return HUGE_VAL; } 
    8080        virtual double getLength() const { return 0.0; } 
    8181        virtual double getFrameRate() const { return 0.0; }