[MPlayer-users] Large -sb values

Andy Goth unununium at openverse.com
Mon Aug 26 02:26:02 CEST 2002


On Sunday, August 25, 2002 12:29, D Richard Felker III wrote:
> [Automatic answer: RTFM (read DOCS, FAQ), also read DOCS/bugreports.html]

Again? ;^)  I read so many docs and faq's and howtos and so much source code 
that I got mixed up.  Between making my dvd-rom drive even recognize dvds 
(yeah, it's broken), setting up nas (no sound on the fast computer), 
ripping on one box, and playing back on the other, things got... fun.

> Did you enable largefile support at compiletime?

Ah, thank you.  I had that option in mind but dismissed it, thinking it was 
only for vobcopy.  However, it doesn't solve my problem: mplayer doesn't 
crash anymore, but it doesn't start ripping at the right position either.  
-sb 2147483648, -sb 3221225472, and -sb 4294967296 all produce the same 
file: the value is being clipped to 2147483647.

Oh, how odd.  Duplicated code...  m_config_set_int's functionality appears 
to also be in config_read_option (where's the m_ prefix?).  Does 
m_config_set_int ever get called?

Anyway, I see the bug.  strtol clips the value to LONG_MIN and LONG_MAX.  It 
would be better to report such out-of-range values as errors, but I'm not 
sure if it's really possible without writing our own atoi-type functions.  
(Before reading strtol's man page, I had been surprised that 2147483648 < 0 
hadn't triggered, since it's actually a negative number.)

I made a patch that adds CONF_TYPE_POSITION representing off_t.  The code 
for it seems to correctly handle long longs.  It's kind of a quick hack, 
but it works for me.  I can't think of a better way to do it without 
rewriting cfgparser, and as much as I'd like to screw with it some more, 
it's not my call.

What I'd *like* is a type that can specify positions and ranges in terms of 
frames, bytes, megabytes, seconds, years, ... whatever applies.  That would 
make -ss and -sb pretty much aliases for each other, at least, as far as 
the user is concerned.  Under the hood, seeking to bytes and times would, 
of course, be handled differently.

> Also be aware
> mencoder cannot make avi's longer than 2gig, its a limitation of avi
> format (without extra hacked-in headers which are not supported yet).

Yeah, I'm sure I should probably be using mencoder for this, but... to do 
decss'ing I use -dumpstream.  The problem is -endpos isn't recognized as an 
mplayer option, so I have to be quick with the ^c.  Without delving too 
deeply into the source, I can't see why -endpos can't be made as general an 
option as -sb: the stream structure has both start_pos and end_pos fields.

-- 
Andy Goth  |  unununium at openverse.com  |  http://ioioio.net/
End communication.




More information about the MPlayer-users mailing list