[FFmpeg-devel] [PATCH] libavu: add pkt_timebase to AVFrame.

Michael Niedermayer michaelni at gmx.at
Sun Jul 20 16:10:13 CEST 2014


On Fri, Jul 18, 2014 at 01:12:39PM +0200, Michael Niedermayer wrote:
> On Fri, Jul 18, 2014 at 12:47:06PM +0200, Hendrik Leppkes wrote:
> > Am 18.07.2014 12:04 schrieb "Benoit Fouet" <benoit.fouet at free.fr>:
> > >
> > > In order to easily correlate pkt_duration to its real duration, add the
> > > packet time base information to the frame structure.
> > >
> > > Fixes issue #3052
> > 
> > The code in avcodec doesn't know the timebase, unless the user tells it.
> 
> or the user uses libavformat with libavcodec
> 
> 
> > 
> > And if the user wants to tell it, there already is an avctx field for it
> > (pkt_timebase), no need to store it in the frame since its not going to
> > change in every frame.
> > 
> > As such, I'm not sure what this new field would solve.
> 
> It would allow interpreting the AVFrame.pkt_duration without the need
> to have access to a AVCodecContext.
> AVFrames are part of libavutil, AVCodecContext is part of libavcodec
> 
> 
> also we have a similar issue with AVPackets which dont store the
> timebase used by its time related fields.
> Which leads to the issue you describe above
> "The code in avcodec doesn't know the timebase, unless the user tells it."
> Where a timebase in AVPacket the user wouldnt manually have to deal
> with it. libavformats AVPacket would simply contain the timebase
> Fixing that with AVPackets is due to API/ABI rather hard though

Are there any objections / further comments about pkt_timebase ?

if there are no objections/comments/suggestions then ill apply the
hunks that add pkt_timebase in 1-2 days


[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Its not that you shouldnt use gotos but rather that you should write
readable code and code with gotos often but not always is less readable
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20140720/47587e34/attachment.asc>


More information about the ffmpeg-devel mailing list