[MPlayer-cvslog] r32478 - in trunk: DOCS/tech/slave.txt command.c input/input.c input/input.h
Reimar Döffinger
Reimar.Doeffinger at gmx.de
Sun Oct 17 13:24:10 CEST 2010
On Sun, Oct 17, 2010 at 12:28:48PM +0200, Nicolas George wrote:
> Le sextidi 26 vendémiaire, an CCXIX, Reimar Döffinger a écrit :
> > If you think it is a general issue, maybe there's a need for a
> > "initialized" flag in source struct?
>
> That would look like the attached patch.
_I_ think it's nicer.
> diff --git a/eosd.c b/eosd.c
> index 3183c64..247449e 100644
> --- a/eosd.c
> +++ b/eosd.c
> @@ -87,9 +87,11 @@ void eosd_render_frame(double ts, struct mp_eosd_image_list *images)
> void eosd_uninit(void)
> {
> struct mp_eosd_source *src;
> - for (src = sources; src; src = src->priv_next)
> + for (src = sources; src; src = src->priv_next) {
> if (src->uninit)
> src->uninit(src);
> + src->initialized = 0;
> + }
> }
>
> struct mp_eosd_image *eosd_image_alloc(void)
> diff --git a/eosd.h b/eosd.h
> index 5aaed3b..a645f8a 100644
> --- a/eosd.h
> +++ b/eosd.h
> @@ -91,6 +91,12 @@ struct mp_eosd_source {
> */
> int z_index;
>
> + /**
> + * Initialized flag of the source.
> + * Set by the source, automatically reset by the EOSD system.
> + */
However I'd say set it to 0 both when a source is added or when it is removed
(independently of whether it is done specifically for that source or on
general uninit).
The documentation would then say
"Reset whenever a source is added or removed."
Maybe also add a
"TODO: check if src->uninit should only be called if this is set".
More information about the MPlayer-cvslog
mailing list