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
354 int (*parse)(MOVContext*, AVIOContext*, unsigned, const char*) = NULL;354 int (*parse)(MOVContext*, AVIOContext*, unsigned, const char*) = NULL;
355 int raw = 0;355 int raw = 0;
356 int num = 0;356 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;
357 363
358 switch (atom.type) {364 switch (atom.type) {
359 case MKTAG( '@','P','R','M'): key = "premiere_version"; raw = 1; break;365 case MKTAG( '@','P','R','M'): key = "premiere_version"; raw = 1; break;
@@ -572,10 +578,10 @@ retry: · 212 unmodified lines
572 str[str_size] = 0;578 str[str_size] = 0;
573 }579 }
574 c->fc->event_flags |= AVFMT_EVENT_FLAG_METADATA_UPDATED;580 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);
576 if (*language && strcmp(language, "und")) {582 if (*language && strcmp(language, "und")) {
577 snprintf(key2, sizeof(key2), "%s-%s", key, language);583 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);
579 }585 }
580 if (!strcmp(key, "encoder")) {586 if (!strcmp(key, "encoder")) {
581 int major, minor, micro;587 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