[XviD-devel] encoding from a worker thread can stall if encoding status dialog is enabled

Peter Ross pross at xvid.org
Thu May 20 14:31:07 CEST 2010


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 <victimofleisure at gmail.com>
Sent: Thursday, 20 May 2010 7:56 AM
To: xvid-devel at xvid.org
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
Xvid-devel at xvid.org
http://list.xvid.org/mailman/listinfo/xvid-devel



More information about the Xvid-devel mailing list