[FFmpeg-devel] [PATCH] frame: add a time_base field

Nicolas George george at nsup.org
Thu Sep 9 16:53:49 EEST 2021


Lynne (12021-09-09):
> Because all of our codecs pass their frames through a wrapper function before
> they get to the user. So, we just set the field there, add a FATE test, and now
> they're guaranteed to be correctly kept updated.

This is wrong and not enough. Codecs are not the only origin for frames.
To ensure this field is always up-to-date, you need to find all the
places where it can go out-of-sync, and make sure there is some kind of
wrapper.

> So why are timestamps part of frames at all then?

Seriously? Because the timestamps, unlike the time base, change from
frame to frame.

> They're not isolated, they're part of the frame. And to make any sense
> of them, you need a timebase.

No, one frame does not need a timestamp. Timestamps become necessary
when there are several frames.

> It's a single optional field! The way the comment is worded now,
> we don't even have any obligation to update it.

It is a single optional field, but keeping it up to date requires a lot
of code.

It is a single REDUNDANT field, and not having redundant information
should be one of the first things an experienced developer has learned.

Regards,

-- 
  Nicolas George
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20210909/a327b5cf/attachment.sig>


More information about the ffmpeg-devel mailing list