[MPlayer-dev-eng] [PATCH] minor tweak to title range parsing
Robert Henney
robh at rut.org
Fri Apr 7 08:23:49 CEST 2006
this adds 3 minor changes.
handling of play ranges with 3-digit title numbers is handled correctly.
eg. dvd://99-100
nope, I've yet to see a dvd with that many titles, but I've seen ones
that have gotten close.
ranges that end on the same title they begin at are handled as would be
expected and are not taken to be invalid.
eg. dvd://4-4
reliance on the uninitialized state of the last byte in the string
buffer removed, along with magic number.
-------------- next part --------------
Index: main/parser-mpcmd.c
===================================================================
RCS file: /cvsroot/mplayer/main/parser-mpcmd.c,v
retrieving revision 1.24
diff -r1.24 parser-mpcmd.c
64c64
< char entbuf[10];
---
> char entbuf[11];
224c224
< if (dvd_range(start_title) && dvd_range(end_title) && (start_title<end_title))
---
> if (dvd_range(start_title) && dvd_range(end_title) && (start_title<=end_title))
230c230,231
< snprintf(entbuf,9,"dvd://%d",j);
---
> entbuf[sizeof entbuf - 1] = '\0';
> snprintf(entbuf,sizeof entbuf - 1,"dvd://%d",j);
More information about the MPlayer-dev-eng
mailing list