[FFmpeg-devel] [PATCH 2/2] libavformat/mov: fix udta reading in trak box

Jan Ekström jeebjp at gmail.com
Fri Feb 4 13:10:42 EET 2022


On Fri, Feb 4, 2022 at 5:24 AM Wang Chuan <ouchuanm at outlook.com> wrote:
>
> Ping?
> On Jan 28, 2022, 11:24 AM +0800, Wang Chuan <ouchuanm at outlook.com>, wrote:
> > if we are reading udta in trak box, the data should go to metadata
> > of current stream.
> >
> > Signed-off-by: Wang Chuan <ouchuanm at outlook.com>
> > ---
> > libavformat/mov.c | 5 ++++-
> > 1 file changed, 4 insertions(+), 1 deletion(-)
> >
> > diff --git a/libavformat/mov.c b/libavformat/mov.c
> > index 1437d160f8..cb983defb3 100644
> > --- a/libavformat/mov.c
> > +++ b/libavformat/mov.c
> > @@ -522,7 +522,10 @@ retry:
> > str[str_size] = 0;
> > }
> > c->fc->event_flags |= AVFMT_EVENT_FLAG_METADATA_UPDATED;
> > - av_dict_set(&c->fc->metadata, key, str, 0);
> > + if (c->trak_index != -1)
> > + av_dict_set(&c->fc->streams[c->trak_index]->metadata, key,
> > str, 0);
> > + else
> > + av_dict_set(&c->fc->metadata, key, str, 0);
> > if (*language && strcmp(language, "und")) {
> > snprintf(key2, sizeof(key2), "%s-%s", key, language);
> > av_dict_set(&c->fc->metadata, key2, str, 0);
> > --
> > 2.29.2

I recall having some patches on my github regarding something related,
will attempt to check this during the week-end.

Jan


More information about the ffmpeg-devel mailing list