[vlc-devel] RFC: modify video_output to avoid not required recreation of the filter chain

André Weber \(atmo\) WeberAndre at gmx.de
Sat Sep 12 23:34:55 CEST 2009


Hello,

while working on the bug fixes / enhancements of the atmo filter - I saw, that my
filter was created and deleted - on each new file played - shortly after creation
as reason I found out:
- that there is a trigger (VideoFilter2Callback) on the variable "video-filter" - which
sets a variable "psz_vf2" which is checked in the main output loop - if this is set
the filter chain gets recreated - but for some reason this also happens immediately
after vout creation, and at some later points again -- with the same text - so the
same filter chain would be created at least two times - for my atmo filter that is bad.

My idea (and for me working fix) is to add a second variable "psz_current_vf2" to
the thread structure "vout_thread_sys_t" (vout_internal.h) that keeps the current filter
chain as string.

In the thread function "RunThread" (video_output.c) - in the code section below
/* Check for "video filter2" changes */
- we will copy the content of psz_vf2 to psz_current_vf2 for later use inside the
function VideoFilter2Callback - which will check if the newly set filter chain (text)
is the same like the one stored in "psz_current_vf2" - if this is the case -
the variable "psz_vf2" won't be set - and the filter chain will stay the same.
(in the other case the variable psz_vf2 would be set - so that the thread
will recreate the filter chain - like expected.)

I'am not the guru of video output - so I kindly ask you - before commiting
the change - may be there is another idea to avoid this - and somebody is
allready working on it.

waiting for your comments

with best regards

André

--
atmo

-------------- next part --------------
A non-text attachment was scrubbed...
Name: vout_internal_h.diff
Type: text/x-diff
Size: 428 bytes
Desc: not available
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20090912/3eef725b/attachment.diff>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: video_output_c.diff
Type: text/x-diff
Size: 3218 bytes
Desc: not available
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20090912/3eef725b/attachment-0001.diff>


More information about the vlc-devel mailing list