Web lists-archives.com

Re: [MPlayer-dev-eng] gui: subtitle menu is not populated when playing from mpg file




On Wed, Aug 13, 2014 at 07:00:09PM +0200, Ingo Brückl wrote:
> Index: mplayer.c
> ===================================================================
> --- mplayer.c	(revision 37251)
> +++ mplayer.c	(working copy)
> @@ -360,14 +360,13 @@
>      return &mpctx->mixer;
>  }
>  
> -int mpctx_get_global_sub_size(MPContext *mpctx)
> +void mpctx_get_global_sub_info(MPContext *mpctx, int *size, int *pos)
>  {
> -    return mpctx->global_sub_size;
> -}
> +    mp_property_do("sub", M_PROPERTY_GET, pos, mpctx);
>  
> -int mpctx_get_global_sub_pos(MPContext *mpctx)
> -{
> -    return mpctx->global_sub_pos;
> +    if (size) *size = mpctx->global_sub_size;
> +
> +    return;

Not completely convinced it's better, but I'm happy to let you decide.
However that pointless return should go.
Or better yet, return on of these via the return value.
My first instinct would have been the pos, but size would make
the code smaller.
I also think mp_property_do can fail (?), if yes it would be nice
to ensure something reasonable and detectable happens in that case.
_______________________________________________
MPlayer-dev-eng mailing list
MPlayer-dev-eng@xxxxxxxxxxxx
https://lists.mplayerhq.hu/mailman/listinfo/mplayer-dev-eng