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
66 const char *vendor_string,66 const char *vendor_string,
67 AVChapter **chapters, unsigned int nb_chapters)67 AVChapter **chapters, unsigned int nb_chapters)
68{68{
69 size_t vendor_string_length = strlen(vendor_string);
69 int cm_count = 0;70 int cm_count = 0;
70 avio_wl32(pb, strlen(vendor_string));71 avio_wl32(pb, vendor_string_length);
71 avio_write(pb, vendor_string, strlen(vendor_string));72 avio_write(pb, vendor_string, vendor_string_length);
72 if (chapters && nb_chapters) {73 if (chapters && nb_chapters) {
73 for (int i = 0; i < nb_chapters; i++) {74 for (int i = 0; i < nb_chapters; i++) {
74 cm_count += av_dict_count(chapters[i]->metadata) + 1;75 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