[FFmpeg-devel] [PATCH] libavformat/mxfdec.c: Recognize and Ignore MXF fill boxes

martin schitter ms+git at mur.at
Thu Sep 12 03:36:07 EEST 2024



On 11.09.24 10:15, Tomas Härdin wrote:
> This could also be done using mxf_metadata_read_table[] using a simple
> stub callback.
> 
> Alternatively we could add some logic to the parsing loop that skips
> KLVs whose key's entry in the table have read == NULL. The loop
> termination condition would need to either change to checking if the
> first byte of the UL is zero, or maybe just use FF_ARRAY_ELEMS. This
> way we could add more keys to skip in the future. This is also possible
> with the stub approach

Yes -- it could be done in many ways!

I have indeed chosen a very simple and trivial solution. experts, which 
are more familiar with this code base, may very likely see and even 
prefer more complex alternatives. But the trivial variant, which is very 
easy graspable by any developer, also has its value as long as it does 
its job.

But an elementary feature like 'fill' should be simply supported by any 
MXF demuxer in a suitable manner, otherwise it's IMHO a grave defect.

> Also IS_KLV_KEY() seems wrong. It should skip the version byte I think
> (I'd have to double-check the spec). That doesn't need to hold up this
> patch of course

IS_KLV_KEY is just used as a trivial memcmp paraphrase for static keys:

  #define IS_KLV_KEY(x, y) (!memcmp(x, y, sizeof(y)))


 > That doesn't need to hold up this patch of course

If you don't see any further objections, please just merge the patch and 
finally solve this issue by this trivial solution till someone actually 
contributes a better alternative.

Martin


More information about the ffmpeg-devel mailing list