diff options
author | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2021-08-23 07:52:54 +0200 |
---|---|---|
committer | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2021-08-27 10:47:23 +0200 |
commit | 64020dfe08f7f2212571a2c2ef10ea366a492a95 (patch) | |
tree | 165e68f872b69aee74afde79a4a2b9dbf77f3204 | |
parent | dc34bf45c5bf1518e9c1dae8f705e113f939da9e (diff) | |
download | ffmpeg-64020dfe08f7f2212571a2c2ef10ea366a492a95.tar.gz |
avformat/vorbiscomment: Don't compute strlen twice
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
-rw-r--r-- | libavformat/vorbiscomment.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/libavformat/vorbiscomment.c b/libavformat/vorbiscomment.c index a929634cc0..13ee065a44 100644 --- a/libavformat/vorbiscomment.c +++ b/libavformat/vorbiscomment.c @@ -66,9 +66,10 @@ int ff_vorbiscomment_write(AVIOContext *pb, const AVDictionary *m, const char *vendor_string, AVChapter **chapters, unsigned int nb_chapters) { + size_t vendor_string_length = strlen(vendor_string); int cm_count = 0; - avio_wl32(pb, strlen(vendor_string)); - avio_write(pb, vendor_string, strlen(vendor_string)); + avio_wl32(pb, vendor_string_length); + avio_write(pb, vendor_string, vendor_string_length); if (chapters && nb_chapters) { for (int i = 0; i < nb_chapters; i++) { cm_count += av_dict_count(chapters[i]->metadata) + 1; |