[MPlayer-dev-eng] octal and hex surprise and perplex

Kalev Soikonen ksop at hot.ee
Fri Jun 9 16:52:45 CEST 2006


On Fri, Jun 09, 2006 at 03:44:13AM -0400, Alan Curry wrote:
...
> Rather than remove the highly useful ability to specify DVD tracks by octal
> number (which would inevitably lead to a huge debate over which _other_
> integers should be decimal-only on the command line and/or in a config file)
> I suggest only the addition of a possibly helpful message which would appear
> in the middle of the insanity, like this:
> 
>   Playing dvd://08.
>   The hostname option must be an integer: 08
>   Don't start a number with zero unless you intend it to be octal
>   Struct dvd, field hostname parsing error: 08

Btw, grep in parse-mpcmd.c for example, the code there uses strtol(,, 10)
to parse dvd:// arguments. So, calling

	mplayer dvd://08-11

already does what a regular ten-fingered person expects.

(But it would be sensible to manage SPAN arguments; this dvd range handling
appears to be a hack?)

What about arguments like "015", which pass ok but interpret differently
to what one might expect?

Maybe it would be wise to deprecate all octals in favor of explicit hex,
which is unambiguous? Maybe wrap strtol and have -hardcore-C-style-strtol
and/or -decimal-numbers-only-please kind of flags?

Ahem, methinks you can't shrug off this problem so easily.




More information about the MPlayer-dev-eng mailing list