[vlc-devel] commit: Fix cyclic dependancy between input and "sout stream" description ( Rafaël Carré )

Rafaël Carré funman at videolan.org
Tue May 13 16:34:40 CEST 2008


2008/5/13 Remi Denis-Courmont <rdenis at simphalempin.com>:
>
>  On Tue, 13 May 2008 12:14:49 +0200 (CEST), git at videolan.org (git version
>  control) wrote:
>  > vlc | branch: master | Rafaël Carré <funman at videolan.org> | Tue May 13
>  > 12:15:42 2008 +0200| [8a0dc31dcad18b36c9545910c0e09b22a4c6c020]
>  >
>  > Fix cyclic dependancy between input and "sout stream" description
>
>  Wrong. Broken. (And ugly.)

Yay, ugly.

>  A sout plugin CAN be "unparented" and change input. That's the whole point
>  of --sout-keep.

True, this is why I noticed the bug with vlm, which explicitely
specifies --no-sout-keep

>  Hence a sout plugin must yield the input (or any other foreign object) for
>  as long as it needs it. Please revert.

I will not revert, but instead I'll cook a good fix:

What happens is that when no-sout-keep is specified, description keeps
the last reference on the input object, and when releasing it ( in
Del() ) the input will be destroyed, and all his children (including
description) also.

In ASCII Art that gives:

    Del() /* description.c */
    vlc_object_release(p_sys->input) //reference count now down to 0.
/* description.c */
        .....
        input_destructor() //or whatever the correct name is /* input.c */
        Close() /* description.c */
            assert( !p_sys->p_input ) /* description.c */
    p_sys->input = NULL; /* description.c */


I don't know yet what the correct fix is, but for sure it isn't
removing the assertion.

-- 
Rafaël Carré


More information about the vlc-devel mailing list