Re: encoding from a worker thread can stall if encoding status dialog is enabled
Peter Ross <[email protected]> Thu, 20 May 2010 22:31:07 +1000
| Newsgroups | gmane.comp.video.xvid.devel |
|---|---|
| Message-ID | <[email protected]> |
Hi, To ensure the staus window is disabled, you can modify the Xvid registry setting prior to initialising the dshow encoder. -- Peter (Roaming) -----Original Message----- From: Rev. Chris Korda <[email protected]> Sent: Thursday, 20 May 2010 7:56 AM To: [email protected] Subject: [XviD-devel] encoding from a worker thread can stall if encoding status dialog is enabled I have an unexpected problem using XviD to encode from a multi-threaded application in which DirectShow is run from a worker thread (a recording thread). The issue is that if the "Display encoding status" option is checked, the application can stall. The stall occurs when the main (GUI) thread tries to stop the recording thread, because the recording thread is indirectly accessing a window (the XviD status dialog) via SendMessage and therefore can block in the app's message pump. Put more simply: The message handler that's trying to stop the recorder thread gets blocked because the recorder thread blocks in SendMessage, which is modal/single-threaded and is already handling a message. It seems that the design of XviD's encoding status dialog assumes encoding will be done from the app's main thread. If so this is a needless constraint, and could be avoided if XviD accessed the dialog via PostMessage instead of SendMessage. This is a significant implementation change but wouldn't impact the user since the dialog is already a top-level window. If I uncheck the "Display encoding status" option everything works fine. Any suggestions? Is there a safe way to automatically disable the encoding status dialog from within my app? Best regards, Chris http://ffrend.sourceforge.net/ _______________________________________________ Xvid-devel mailing list [email protected] http://list.xvid.org/mailman/listinfo/xvid-devel