- if ( s->title[0] ) put_str16_nolen(pb, s->title);
- if ( s->author[0] ) put_str16_nolen(pb, s->author);
- if ( s->copyright[0] ) put_str16_nolen(pb, s->copyright);
- if ( s->comment[0] ) put_str16_nolen(pb, s->comment);
+ if (title ) put_str16_nolen(pb, title->value );
+ if (author ) put_str16_nolen(pb, author->value );
+ if (copyright) put_str16_nolen(pb, copyright->value);
+ if (comment ) put_str16_nolen(pb, comment->value );
+ end_header(pb, hpos);
+ }
+ if (metadata_count) {
+ AVMetadataTag *tag = NULL;
+ hpos = put_header(pb, &extended_content_header);
+ put_le16(pb, metadata_count);
+ while ((tag = av_metadata_get(s->metadata, "", tag, AV_METADATA_IGNORE_SUFFIX))) {
+ put_le16(pb, 2*(strlen(tag->key) + 3) + 1);
+ put_le16(pb, 'W');
+ put_le16(pb, 'M');
+ put_le16(pb, '/');
+ put_str16_nolen(pb, tag->key);
+ put_le16(pb, 0);
+ put_le16(pb, 2*strlen(tag->value) + 1);
+ put_str16_nolen(pb, tag->value);
+ }