[MPlayer-dev-eng] [PATCH] Timestamp-based mpg seeking

Moritz Bunkus moritz at bunkus.org
Fri Oct 15 14:37:06 CEST 2004


Hey,

> There are a lot of positions in the code where this happens
> (maybe only at beginnings of blocks?)

Yes, at the beginning of a block is perfectly fine. But not in the
middle. That's C99 and C++, but gcc 2.95 doesn't like that.

> Nevertheless fixed.

Not completely (see below).

> +  mpg_d->final_pts = 0.0;
> +  // 500000 is a wild guess
> +  off_t end_seq_start = demuxer->movi_end-500000;

and

>    //================= seek in MPEG ==========================
> +  //calculate the pts to seek to
> +    float newpts = flags & 1 ? 0.0 : oldpts;
> +    if(flags & 2) {
> +      if (mpg_d->final_pts > 0.0)
> +        newpts += mpg_d->final_pts * rel_seek_secs;
> +      else
> +        newpts += rel_seek_secs * (demuxer->movi_end - demuxer->movi_start) * oldpts / oldpos;
> +    } else
> +      newpts += rel_seek_secs;
> +    if (newpts < 0) newpts = 0;
> +
>      off_t newpos=(flags&1)?demuxer->movi_start:demuxer->filepos;

Mosu

-- 
If Darl McBride was in charge, he'd probably make marriage
unconstitutional too, since clearly it de-emphasizes the commercial
nature of normal human interaction, and probably is a major impediment
to the commercial growth of prostitution. - Linus Torvalds




More information about the MPlayer-dev-eng mailing list