[vlc-devel] Sending synced text to the Qt4 interface

Laurent Aimar fenrir at via.ecp.fr
Mon Nov 3 14:28:21 CET 2008


On Mon, Nov 03, 2008, ogg.k.ogg.k at googlemail.com wrote:
> - when the Kate module is selected with no active vout (eg, by using
>   --sub-track or --sub-track-id), VLC seems to wait quite a while when
>   trying to get a new SPU buffer (a few seconds).
 That is done on purpose by src/input/decoder.c to avoid losing subtitles
at startup (as the vout can be created with delay).


> To avoid the temporary
>   freeze,
 You should not have any freeze, except the fact that the function that
creates a subpicture will wait a long time.

> I had to use vlc_object_find to know if there's a vout (I do
>   not do anything with it though, I just need to know if there is one
>   around, so I can avoid asking for a SPU buffer is there isn't one).
 You are just workarounding what is done in src/input/decoder.c

>   Is this a known problem with a known solution, and is there another
>   way to know if VLC will freeze when asking for a SPU buffer ?
 Why do you want to avoid it ?

> +    if (ev->text && ev->len > 0 && ev->text_encoding == kate_utf8)
> +    {
> +        /* if we have UTF-8 text with this event, send it as meta */
> +        input_thread_t *p_input = (input_thread_t *)p_dec->p_parent;
> +        if( p_input && p_input->i_object_type == VLC_OBJECT_INPUT )
> +        {
> +            input_item_t *p_item = input_GetItem( p_input );
> +            if (p_item)
> +            {
> +                input_item_SetMeta( p_item, vlc_meta_SyncedText, ev->text );
> +                var_SetInteger( pl_Hold( p_input ), "item-change",
> p_item->i_id );
> +                pl_Release( p_input );
> +            }
> +        }
> +    }
 That's not acceptable for a decoder. You should not need to touch
VLC_OBJECT_INPUT directly.
 That code should be moved to src/input/decoder.c to avoid it and to provide
this functionnality to all subtitle decoders (the data can be read from the
subpicture_t*).

 Now on the way the subtitle is send to the GUI I really doubt it is the
right solution.

 A better and simpler way for the moment could be a simple "intf-lyric" (string)
updated with the current lyric BUT you will have a few problems with
synchronisation. A cleaner/usable method will have to be found.

-- 
fenrir




More information about the vlc-devel mailing list