[MPlayer-dev-eng] [PATCH] threaded vo_directx
Zuxy Meng
zuxy.meng at gmail.com
Wed Oct 31 07:13:41 CET 2007
Hi,
2007/10/29, Zuxy Meng <zuxy.meng at gmail.com>:
> Hi,
>
> 2007/10/28, Zuxy Meng <zuxy.meng at gmail.com>:
> > Hi,
> >
> > It has long been a problem in Windows that when you press a mouse
> > button on the caption, mplayer's playback stalls until you release it.
> > I've fixed the problem by put the window procedure into another thread
> > so that playback can continue even if you hold your mouse or move the
> > window around the desktop.
> >
> > Comments?
>
> Updated patch with a more graceful way to exit the thread.
>
> As for mp_fifo, if we're guaranteed with a single producer (vo thread)
> and a single consumer (main thread) then we needn't do any trick to
> ensure thread safety because it's implemented as a circular queue.
>
> If the main thread also put keys into the fifo we have to leverage a
> mutex but I guess this shouldn't happen once we have a vo?
Unfortunately this isn't the case: the console is writing to mp_fifo
too and if we turn on GUI on windows, there will be 3 producers in
total (while the consumer remains single), since the GUI window is
running on its own thread and may write to mp_fifo too.
As a result I put relative code into a critical section so as to avoid
potential race conditions although so far I've never noticed any
problems even without this.
--
Zuxy
Beauty is truth,
While truth is beauty.
PGP KeyID: E8555ED6
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: vo_directx.c.diff
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20071031/24f5bd55/attachment.txt>
More information about the MPlayer-dev-eng
mailing list