I have a DirectShow filter written Delphi 6 using the DSPACK component library. Currently I lock the filter state using the sync obj created for that purpose at the top of the FillBuffer() call and release it at the end (inside the finally section of a try/finally construct). Since the FillBuffer() call can block while waiting for new data to send out, via a WaitForSingleObject() call that is released by the thread that fulfills the data generation task, is this a bad idea? I am concerned that if the FillBuffer() call blocks for a (relatively) long time, this could affect negatively my filter or the entire filter graph.

有帮助吗?

解决方案

You should be waiting with an unlocked critical section. Otherwise it will eventaully be a problem, with waiting worker thread blocking controlling thread, e.g. with a request to change filter graph state.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top