[FFmpeg-devel] [PATCH] lavf/mov: ensure only one tkhd per trak

Baptiste Coudurier baptiste.coudurier at gmail.com
Thu Dec 13 22:01:38 EET 2018


Hey guys,

> On Dec 13, 2018, at 11:40 AM, Chris Cunningham <chcunningham at chromium.org> wrote:
> 
>> I have at least 2 files which have a id of 0
>> Iam not sure where they are from so iam not sure i can share them

Does Quicktime play them ? If not they are broken files.

> This was my fear as well. Also, we currently default the ID for a new
> stream to be the number of streams now in the list. I worried that some
> files may lack a tkhd or could be structured in such a way that they're
> dependent on this defaulting and might break if I instead defaulted to
> zero.

Lacking a tkhd is a broken file, and I know that FFmpeg has a policy of trying to play broken files.
Now the good thing is that mp4 is supported everywhere and many other demuxer just refuse to play broken files :)

The main issue with this new field is that it really looks like a hack.
They are also many atoms that are not supposed to appear twice in a file and can break
the code down the flow, so should we add “has_<atom>” for all of them ?

"st->id" is not necessary for demuxing AFAIK, please correct me if Im wrong.
Would an init value to -1 for st->id work ?

Thanks!

— 
Baptiste



More information about the ffmpeg-devel mailing list