[FFmpeg-devel] AVFrac deprecated

Thorsten Jordan tjordan
Fri Dec 14 09:10:34 CET 2007


M?ns Rullg?rd schrieb:
> Michael Niedermayer <michaelni at gmx.at> writes:
> 
>> On Thu, Dec 13, 2007 at 04:56:03PM +0100, Thorsten Jordan wrote:
>>> Hello,
>>>
>>> AVFrac is listed as deprecated in avformat.h with the additional comment
[...]
> I have a patch to remove AVFrac, see
> http://git.mansr.com/?p=ffmpeg.mru;a=shortlog;h=avfrac
> 
> Unfortunately, it breaks regression tests in a few places...
yes i thought about such a solution too, but you have one tiny
difference to current implementation:

in ffmpeg.c you replace

pts = (double)ost->st->pts.val ...

by

pts = (double)(ost->st->pts.num / ost->st->pts.den) ...

which is not the same, as pts.val is only the *integer* part of the
number represented by AVFrac.
it should rather be

pts = (double) (int64_t)(ost->st->pts.num / ost->st->pts.den) ...

but i haven't fully understood yet why AVFrac is used with that
additional fraction that is initially 1/2. When writing AVIs or MP4s the
pts.val increases by 1 and the fraction keeps constant, as far as i saw
it. Why is it there then? hmm...

-- 
Regards, Thorsten




More information about the ffmpeg-devel mailing list