[FFmpeg-devel] [PATCH] avformat/hlsenc: creation of hls variant streams with master playlist in a single hlsenc instance
Michael Niedermayer
michael at niedermayer.cc
Mon Oct 23 05:15:19 EEST 2017
On Sat, Oct 21, 2017 at 08:13:15AM +0000, Dixit, Vishwanath wrote:
> Hi,
[...]
> @@ -1324,17 +1345,183 @@ static const char * get_default_pattern_localtime_fmt(AVFormatContext *s)
> return (HAVE_LIBC_MSVCRT || !strftime(b, sizeof(b), "%s", p) || !strcmp(b, "%s")) ? "-%Y%m%d%H%M%S.ts" : "-%s.ts";
> }
>
> +static int format_name(char *name, int name_buf_len, int i)
> +{
> + char *p;
> + char extension[10] = {'\0'};
> +
> + p = strrchr(name, '.');
> + if (p) {
> + strcpy(extension, p);
> + *p = '\0';
> + }
> +
> + sprintf(name + strlen(name), POSTFIX_PATTERN, i);
please always use snprintf() it is safer
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
Avoid a single point of failure, be that a person or equipment.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20171023/ed3d5fa3/attachment.sig>
More information about the ffmpeg-devel
mailing list