]> git.sesse.net Git - ffmpeg/commit
avformat/hlsenc: Avoid duplicating strings when parsing
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
Mon, 25 May 2020 17:22:19 +0000 (19:22 +0200)
committerAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
Thu, 28 May 2020 09:18:53 +0000 (11:18 +0200)
commit4fbcb69707409ecb7a9d314f254e67d1a6e732dc
tree0280196f4254118e8cc30465dc0738cb1b4b6f44
parentc1638bfae1e704f7fd9541892b61258b4f45f91a
avformat/hlsenc: Avoid duplicating strings when parsing

Up until now, the HLS muxer uses av_strtok() to split an input string
controlling parameters of the VariantStreams and then duplicates
parts of this string containing parameters such as the language or the
name of the VariantStream. But these parts are proper zero-terminated
strings of their own that are never modified lateron, so one can simply
use the substring as-is without creating a copy. This commit implements
this.

The same also happened for the string controlling the closed caption
groups.

Furthermore, add const to indicate that the pointers to these substrings
are not used to modify them and also to indicate that these strings are
not allocated on their own.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
libavformat/hlsenc.c