int WindDecoder::Start () { mOperationLock.Lock (); mVideoQueue.init (); mAudioQueue.init (); mbQuit = false; if (AvSeekFrame (0) < 0) { WARN ("seek fail!"); } ThreadExec (); mOperationLock.Unlock (); return 0; }
DWORD CExecFT::ThreadProc() { _hrInit = ThreadInit(); if(_hEvent) { Verify(SetEvent(_hEvent)); } if(_hrInit == S_OK) { ThreadExec(); } ThreadTerm(); ThreadExit(); return 0; }
int WindDecoder::Seek (double pos) { //pos is seconds based. mOperationLock.Lock (); mbQuit = true; mVideoQueue.flush (); mAudioQueue.flush (); DEBUG ("begin wait thread!"); ThreadWait (); DEBUG ("end wait thread!"); mVideoQueue.init (); mAudioQueue.init (); mbQuit = false; if (AvSeekFrame (pos) < 0) { ERROR ("seek fail!"); } else { ThreadExec (); } mOperationLock.Unlock (); return 0; }