History

avformat/mov: Store trak > udta metadata on each stream

Some files keep extra metadata such as 'name' fields within udta, and it is useful for Wine to access them with the "export_all" option so they can then be exposed to Windows applications.

Rémi Bernon committed 1 year ago

Commit d62fd6e1 parent 78ff3781 file · +8 −2Browse files

Unified · Split

libavformat/mov.c+8−2
@@ -354,6 +354,12 @@ static int mov_read_udta_string(MOVContext *c, AVIOContext *pb, MOVAtom atom) · 353 unmodified lines
354354 int (*parse)(MOVContext*, AVIOContext*, unsigned, const char*) = NULL;
355355 int raw = 0;
356356 int num = 0;
357+ AVDictionary **metadata;
358+
359+ if (c->trak_index >= 0 && c->trak_index < c->fc->nb_streams)
360+ metadata = &c->fc->streams[c->trak_index]->metadata;
361+ else
362+ metadata = &c->fc->metadata;
357363
358364 switch (atom.type) {
359365 case MKTAG( '@','P','R','M'): key = "premiere_version"; raw = 1; break;
@@ -572,10 +578,10 @@ retry: · 212 unmodified lines
572578 str[str_size] = 0;
573579 }
574580 c->fc->event_flags |= AVFMT_EVENT_FLAG_METADATA_UPDATED;
575− av_dict_set(&c->fc->metadata, key, str, 0);
581+ av_dict_set(metadata, key, str, 0);
576582 if (*language && strcmp(language, "und")) {
577583 snprintf(key2, sizeof(key2), "%s-%s", key, language);
578− av_dict_set(&c->fc->metadata, key2, str, 0);
584+ av_dict_set(metadata, key2, str, 0);
579585 }
580586 if (!strcmp(key, "encoder")) {
581587 int major, minor, micro;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t