[FFmpeg-devel] [PATCH] avformat/mxf: Establish register of local tags
Tomas Härdin
tjoppen at acc.umu.se
Thu Jan 28 17:36:49 EET 2021
tor 2021-01-28 klockan 14:48 +0100 skrev Tomas Härdin:
> tor 2021-01-28 klockan 08:56 +0100 skrev Marton Balint:
> > On Thu, 28 Jan 2021, Tomas Härdin wrote:
> > > ons 2021-01-27 klockan 23:50 +0100 skrev Marton Balint:
> > > > On Wed, 27 Jan 2021, Tomas Härdin wrote:
> > > There's not really anything to av_assert0() on in
> > > mxf_lookup_local_tag(). Either way, I'm thinking replacing the return
> > > NULL with either
> > >
> > > av_log(NULL, AV_LOG_PANIC, "Tried to use unregistered local tag
> > > 0x%04x\n", tag);
> > > abort();
> > >
> > > or
> > >
> > > av_assert0(0 && "Tried to use unregistered local tag");
> > >
> > > or maybe
> > >
> > > av_log(NULL, AV_LOG_PANIC, "Tried to use unregistered local tag
> > > 0x%04x\n", tag);
> > > av_assert0(0);
> > >
> > > to avoid explicitly calling abort()
> >
> > I think we usually do av_assert0(0) in this case. I am not sure if the
> > error message is particularly useful, afterall who sees it should be a
> > programmer and file/line is printed by assert anyway, so a comment in the
> > source code before the assert makes more sense to me.
>
> Maybe av_assert0(0 && "you forgot to add a local tag to the registry")?
Here's a rebased patch that does this, with a little comment also
/Tomas
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-avformat-mxf-Establish-register-of-local-tags.patch
Type: text/x-patch
Size: 47331 bytes
Desc: not available
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20210128/b8fae6c8/attachment.bin>
More information about the ffmpeg-devel
mailing list