[Ffmpeg-devel] [PATCH] get rid of AVFrac

Michael Niedermayer michaelni
Fri Oct 13 21:33:18 CEST 2006


Hi

On Fri, Oct 13, 2006 at 02:48:06PM +0200, Reimar D?ffinger wrote:
[...]

> > > And would this need a version increment?
> > 
> > did anyone use the av frac stuff? if yes then yes a version increment is
> > needed
> 
> Well, that exactly is the question... I have no idea if someone might
> have used it.
> Attached patch would change the version number.
> Of course such a version change just because of this seems a bit
> "overkill" to me, but the alternative would be an ifdef mess like done on other
> occasions. I don't like that much, but if that is preferred I could come up
> with a patch for that way as well.
> I also though about only removing the uses of AVFrac but not the
> functions, but I think that would not help because it still would change the
> AVFormatContext (or wouldn't this require a version increment?).

[...]
> @@ -2193,7 +2189,6 @@
>          if (den != AV_NOPTS_VALUE) {
>              if (den <= 0)
>                  return AVERROR_INVALIDDATA;
> -            av_frac_init(&st->pts, 0, 0, den);
>          }
>      }
>      return 0;
> @@ -2221,7 +2216,7 @@
>      if((pkt->pts == 0 || pkt->pts == AV_NOPTS_VALUE) && pkt->dts == AV_NOPTS_VALUE && !delay){
>          pkt->dts=
>  //        pkt->pts= st->cur_dts;
> -        pkt->pts= st->pts.val;
> +        pkt->pts= st->pts;
>      }
>  
>      //calculate dts from pts
> @@ -2246,7 +2241,7 @@
>  
>  //    av_log(NULL, AV_LOG_DEBUG, "av_write_frame: pts2:%lld dts2:%lld\n", pkt->pts, pkt->dts);
>      st->cur_dts= pkt->dts;
> -    st->pts.val= pkt->dts;
> +    st->pts= pkt->dts;
>  
>      /* update pts */
>      switch (st->codec->codec_type) {
> @@ -2255,12 +2250,12 @@
>  
>          /* HACK/FIXME, we skip the initial 0-size packets as they are most likely equal to the encoder delay,
>             but it would be better if we had the real timestamps from the encoder */
> -        if (frame_size >= 0 && (pkt->size || st->pts.num!=st->pts.den>>1 || st->pts.val)) {
> -            av_frac_add(&st->pts, (int64_t)st->time_base.den * frame_size);
> +        if (frame_size >= 0 && (pkt->size || st->pts)) {
> +            st->pts += (int64_t)st->time_base.den * frame_size;

this doesnt look correct ...

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

In the past you could go to a library and read, borrow or copy any book
Today you'd get arrested for mere telling someone where the library is




More information about the ffmpeg-devel mailing list