[MPlayer-dev-eng] [PATCH] Make getting chapter property in slave mode one-based

Diego Biurrun diego at biurrun.de
Mon Jun 29 10:16:24 CEST 2009


On Sat, Jun 27, 2009 at 07:36:52PM +0200, Adrian Stutz wrote:
> 
> Setting the chapter property in slave mode is one-based, as is the
> seek_chapter command.
> Getting the property however returns a zero-based result.
> 
> This patch makes it so it returns a one-based result in line with the
> other uses of the chapter number.
> It also updates the wrong min value (0) in slave.txt to the actual min
> (1) as defined in commands.c.

Wait, didn't we just say in another thread that things should start from
0?

> --- command.c	(revision 29406)
> +++ command.c	(working copy)
> @@ -394,7 +394,7 @@
>      case M_PROPERTY_GET:
>          if (!arg)
>              return M_PROPERTY_ERROR;
> -        *(int *) arg = chapter;
> +        *(int *) arg = (chapter + 1);

I think this should have a comment explaining the '+1'.

Diego



More information about the MPlayer-dev-eng mailing list