[MPlayer-dev-eng] [PATCH]calculating asf seek_bytes with int64_t

Reimar Doeffinger Reimar.Doeffinger at stud.uni-karlsruhe.de
Thu Apr 26 11:04:52 CEST 2007


Hello,
On Thu, Apr 26, 2007 at 10:05:03AM +0800, qwen dux wrote:
> >off_t should be 64 bits as well, so why does this patch help?
> I test it on my i386 pc,but  the  sizeof(off_t) is  4, also on my emedded
> board;

Then you do not have largefile support, which means you can't handle
files > 4GB either way.
So the problem I guess can only be in one of the intermediate results
and should only be changed there IMO.

> -    off_t rel_seek_packs=(flags&2)?     // FIXME: int may be enough?
> +    int64_t rel_seek_packs=(flags&2)?   // FIXME: use int64_t?
>         (rel_seek_secs*(demuxer->movi_end-demuxer->movi_start)/asf->packetsize):
>         (rel_seek_secs*p_rate);

Try only replacing
(rel_seek_secs*(demuxer->movi_end-demuxer->movi_start)/asf->packetsize)
by
(rel_seek_secs*(uint64_t)(demuxer->movi_end-demuxer->movi_start)/asf->packetsize)
or, probably better,
(rel_seek_secs*((demuxer->movi_end-demuxer->movi_start)/asf->packetsize))
since IMO there is not much sense to calculate the size more precisely
than in packets, and it will also work when
demuxer->movi_end-demuxer->movi_start uses the full 64 bits (casting to
64 bits is unlikely to fix that case).

Greetings,
Reimar Doeffinger



More information about the MPlayer-dev-eng mailing list