[FFmpeg-devel] [PATCH 1/2] avutil: Add av_get_time_base{_q, }() and deprecate AV_TIME_BASE{_Q, }

Michael Niedermayer michaelni at gmx.at
Tue Dec 31 19:24:14 CET 2013

On Mon, Dec 30, 2013 at 07:38:36PM +0000, Derek Buitenhuis wrote:
> On 12/30/2013 4:39 PM, Clément Bœsch wrote:
> > I don't think they are supposed to be changed, and if you change them, it
> > will likely break a lot of things. I don't think those macro hurts until
> > we need to change the value. No need to break the ABI for the sole purpose
> > of avoiding unsure ABI break in the future.
> I think it's fairly silly to have multiple things that do the same thing, but
> I am not going to have a big argument over it.
> > I'm al'right with that. But in that case, just add the two helpers for C++
> > apps and don't drop anything. It won't break anything, and it makes the
> > huge second patch unnecessary.
> Even if it is dropped, there is one part which should still be fixed:
> The abuse of AV_TIME_BASE_Q by using &AV_TIME_BASE_Q, which is pretty
> ugly IMO and relies on internal knowledge of its definition, which isn't
> so kosher.

> The other thing is: The Libav side has already run with my patch. It isn't merged
> yet, but someone other than myself is championing it. Don't know how you want to
> handle that "fun" business.

The change does no real harm, so its not a problem to handle. It just
seems to me a bit ugly to replace constants which noone currently
intends to change or sees a real need to change to function calls.

In theory theres the added overhead for the function calls and that
when the value is not known at compile time then the compiler cant
optimize based on it.
I suspect this has no user vissible/meassurable effect as most uses
pass it to other functions breaking the compilers possible knowledge
but i did not benchmark it ...

for the AVRational returning function the nummerator is 1 always,
even if the timebase would be (sanly) changed. The function should
possibly instead be a static inline function that returns a 1 in that
place to restore the compilers compile time knowledge of half the

Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

It is dangerous to be right in matters on which the established authorities
are wrong. -- Voltaire
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20131231/83c5e6b2/attachment.asc>

More information about the ffmpeg-devel mailing list