[FFmpeg-devel] [PATCH] Encrypted SMPTE DC MXF - additional UL needed to unpack EKLV packet

Pierre-Anthony Lemieux pal at sandflow.com
Tue Oct 4 18:09:09 EEST 2022


On Tue, Oct 4, 2022 at 7:59 AM Tomas Härdin <git at haerdin.se> wrote:
>
> tis 2022-10-04 klockan 07:50 -0700 skrev Pierre-Anthony Lemieux:
> > On Tue, Oct 4, 2022 at 7:29 AM Tomas Härdin <git at haerdin.se> wrote:
> > >
> > > mån 2022-10-03 klockan 11:47 +0000 skrev Richard Ayres:
> > > > Thanks, Pierre-Anthony. I've updated the patch to remove the
> > > > unnecessary UL and it's now using mxf_match_uid() to detect the
> > > > EKLV
> > > > packet.
> > > >
> > > > Signed-off-by: Richard Ayres <richard.ayres at bydeluxe.com>
> > > > ---
> > > >  libavformat/mxfdec.c | 4 ++--
> > > >  1 file changed, 2 insertions(+), 2 deletions(-)
> > > >
> > > > diff --git a/libavformat/mxfdec.c b/libavformat/mxfdec.c
> > > > index badd2be224..b1ab90f25f 100644
> > > > --- a/libavformat/mxfdec.c
> > > > +++ b/libavformat/mxfdec.c
> > > > @@ -3737,7 +3737,7 @@ static int mxf_read_header(AVFormatContext
> > > > *s)
> > > >
> > > >          PRINT_KEY(s, "read header", klv.key);
> > > >          av_log(s, AV_LOG_TRACE, "size %"PRIu64" offset
> > > > %#"PRIx64"\n", klv.length, klv.offset);
> > > > -        if (IS_KLV_KEY(klv.key, mxf_encrypted_triplet_key) ||
> > > > +        if (mxf_match_uid(klv.key, mxf_encrypted_triplet_key,
> > >
> > > Why do we have IS_KLV_KEY at all? I feel it is only appropriate in
> > > cases where we have to deal with less-than-standard files, or if we
> > > explicitly have to differentiate between different versions of
> > > relevant
> > > specs.
> >
> > SMPTE ULs should always be compared ignoring the version byte -- but
> > for exceptional cases.
> >
> > mxf_match_uid() should probably be renamed mxf_match_ul() since a UID
> > can also be a UUID and.
>
> Oh yeah, UUIDs *must* be just memcpy()'d IIRC. Perhaps we should have
> three functions to be extra explicit: mxf_match_ul(), mxf_match_uid()
> and mxf_match_uuid()..

av_uuid_equal() already exists.

>
> /Tomas
>
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request at ffmpeg.org with subject "unsubscribe".


More information about the ffmpeg-devel mailing list