[FFmpeg-devel] Killing AVFrac

Måns Rullgård mans
Mon Jul 9 01:30:11 CEST 2007


Michael Niedermayer <michaelni at gmx.at> writes:

> Hi
>
> On Sun, Jul 08, 2007 at 09:26:03PM +0100, M?ns Rullg?rd wrote:
>> Michael Niedermayer <michaelni at gmx.at> writes:
>> 
>> > Hi
>> >
>> > On Sun, Jul 08, 2007 at 04:21:57PM +0100, M?ns Rullg?rd wrote:
>> >> Attached patch is an attempt to remove use of AVFrac.  It works, apart
>> >> >from audio timestamps occasionally being off by one.  Can anyone see
>> >> what might be causing the difference?
>> >
>> > well the code in ffmpeg.c does convert to double before the divide and:
>> 
>> But are the values computed there used for anything other than
>> comparisons?  From a quick glance it didn't seem like they were
>> assigned as actual timestamps.
>
> i dont know, i just pointed at all differences i saw after a quick review
> also i think such changes would belong into a seperate patch ...

Hmm... yes, dividing before casting is of course closer to the
original.  Doesn't change the result though.

>> >> @@ -2177,7 +2175,7 @@ static int compute_pkt_fields2(AVStream *st, AVPacket *pkt){
>> >>  
>> >>  //    av_log(NULL, AV_LOG_DEBUG, "av_write_frame: pts2:%"PRId64" dts2:%"PRId64"\n", pkt->pts, pkt->dts);
>> >>      st->cur_dts= pkt->dts;
>> >> -    st->pts.val= pkt->dts;
>> >> +    st->pts.num= pkt->dts * st->pts.den;
>> >>  
>> >>      /* update pts */
>> >>      switch (st->codec->codec_type) {
>> >
>> > is also not what it was, that said iam not saying the code makes sense as it
>> > is currently
>> 
>> Well, there is the den/2 bias thing...  What's the purpose of that
>> anyway?
>
> i was also wondering about that
> i suspect it was supposed to improve the rounding of pts.val, that is
> make it round to nearest but maybe it had some other purpose ...

I suspected as much too, but figured asking was safer than assuming.

How do you propose we proceed to finally rid ourselves of AVFrac?  I'm
growing tired of seeing those warnings all the time...

-- 
M?ns Rullg?rd
mans at mansr.com




More information about the ffmpeg-devel mailing list