History

avformat/vorbiscomment: Don't compute strlen twice

Andreas Rheinhardt committed 5 years ago

Commit 64020df1 parent dc34bf41 file · +3 −2Browse files

Unified · Split

libavformat/vorbiscomment.c+3−2
@@ -66,9 +66,10 @@ int ff_vorbiscomment_write(AVIOContext *pb, const AVDictionary *m, · 65 unmodified lines
6666 const char *vendor_string,
6767 AVChapter **chapters, unsigned int nb_chapters)
6868 {
69+ size_t vendor_string_length = strlen(vendor_string);
6970 int cm_count = 0;
70− avio_wl32(pb, strlen(vendor_string));
71− avio_write(pb, vendor_string, strlen(vendor_string));
71+ avio_wl32(pb, vendor_string_length);
72+ avio_write(pb, vendor_string, vendor_string_length);
7273 if (chapters && nb_chapters) {
7374 for (int i = 0; i < nb_chapters; i++) {
7475 cm_count += av_dict_count(chapters[i]->metadata) + 1;

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