MCPcopy Create free account
hub / github.com/FFmpeg/FFmpeg / ff_vorbiscomment_write

Function ff_vorbiscomment_write

libavformat/vorbiscomment.c:54–73  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

52}
53
54int ff_vorbiscomment_write(uint8_t **p, AVMetadata *m,
55 const char *vendor_string, const unsigned count)
56{
57 bytestream_put_le32(p, strlen(vendor_string));
58 bytestream_put_buffer(p, vendor_string, strlen(vendor_string));
59 if (m) {
60 AVMetadataTag *tag = NULL;
61 bytestream_put_le32(p, count);
62 while ( (tag = av_metadata_get(m, "", tag, AV_METADATA_IGNORE_SUFFIX) ) ) {
63 unsigned int len1 = strlen(tag->key);
64 unsigned int len2 = strlen(tag->value);
65 bytestream_put_le32(p, len1+1+len2);
66 bytestream_put_buffer(p, tag->key, len1);
67 bytestream_put_byte(p, '=');
68 bytestream_put_buffer(p, tag->value, len2);
69 }
70 } else
71 bytestream_put_le32(p, 0);
72 return 0;
73}

Callers 2

ogg_write_vorbiscommentFunction · 0.85
flac_write_block_commentFunction · 0.85

Calls 2

bytestream_put_bufferFunction · 0.85
av_metadata_getFunction · 0.85

Tested by

no test coverage detected