[MPlayer-dev-eng] [PATCH] Support CineForm DirectShow codec

Steinar H. Gunderson sgunderson at bigfoot.com
Tue Feb 9 19:26:24 CET 2010


On Tue, Feb 09, 2010 at 07:07:26PM +0100, Reimar Döffinger wrote:
> No, that's not the problem, I don't like that it means some loss of debugging
> features to switch the implementation.

Which debugging features in particular do you miss?

> While I agree with you that this kind of thing normally should be better left to
> others, I think it's reasonable to keep the code for now, I think the necessary
> change would be something like below.

I must admit I'm very skeptical to using two locks -- it very easily leads to
deadlock, especilly with recursion through foreign code. (I haven't run your
patch through Helgrind/thrcheck/tsan, but I guess it wasn't meant as a
production-ready example.)

What _can_ be done is to still have a single mutex, use it to protect the lock
count/owner only (ie., don't actually hold the mutex after
EnterCriticalSection has completed), and then if the mutex is not free, wait
for a signal to be sent. This is pretty much the same as the semaphore
implementation today, IIRC, and should work. It will almost certainly be
slower and more tricky to get right than just using a recursive mutex,
though, but I don't know if that's an issue.

/* Steinar */
-- 
Homepage: http://www.sesse.net/



More information about the MPlayer-dev-eng mailing list