[FFmpeg-devel] [PATCH] avformat/matroskaenc: always reserve max aac private data

John Stebbins jstebbins at jetheaddev.com
Fri May 1 21:14:32 EEST 2020


On Fri, 2020-05-01 at 20:03 +0200, Andreas Rheinhardt wrote:
> John Stebbins:
> > On Fri, 2020-05-01 at 14:27 -0300, James Almer wrote:
> > > On 5/1/2020 2:09 PM, John Stebbins wrote:
> > > > When extra data is updated using AV_PKT_DATA_NEW_EXTRADATA, the
> > > > data is
> > > > written plus extra space is reserved for the max possible size
> > > > extradata.
> > > > But when extradata is written during mkv_write_header, no extra
> > > > space is
> > > > reserved. So the side data update overwrites whatever follows
> > > > the
> > > > extradata in the track header and results in an invalid file.
> > > 
> > > In what scenario there's extradata during init() and then new
> > > extradata
> > > propagated in a packet side data for AAC? And should the side
> > > data
> > > one
> > > take priority over the original one?
> > > 
> > 
> > This is partially a HandBrake issue.  Before ffmpeg ever had side
> > data,
> > HandBrake parsed the extradata out of the aac stream in TS files
> > ourselves before initializing the muxer.  We still do this, so
> > extradata is supplied by us when the muxer it initialized and again
> > by
> > side data generated in aac_adtstoasc bsf.
> > 
> Does this mean that HandBrake's extradata and the aac_adtstoasc bsf
> side-data extradata are actually one and the same?
> 

Yes



More information about the ffmpeg-devel mailing list