[FFmpeg-devel] [PATCH] avformat/hlsenc: added HLS encryption
Christian Suloway
csuloway at globaleagleent.com
Sat Jan 10 00:02:25 CET 2015
New version of the patch attached to address your comments.
Thanks,
Christian
On Jan 7, 2015, at 2:17 PM, Michael Niedermayer <michaelni at gmx.at> wrote:
> Please add a testcase/example to either the documentation or
> commit message
Example added to the commit message.
>> + ff_get_line(pb, hls->key_uri, sizeof(hls->key_uri));
>> + hls->key_uri[strcspn(hls->key_uri, "\r\n")] = '\0';
>> +
>> + ff_get_line(pb, hls->key_file, sizeof(hls->key_file));
>> + hls->key_file[strcspn(hls->key_file, "\r\n")] = '\0';
>> +
>> + ff_get_line(pb, hls->iv_string, sizeof(hls->iv_string));
>> + hls->iv_string[strcspn(hls->iv_string, "\r\n")] = '\0';
>
> in what case are the strcspn() needed ?
Replaced with terminating character check/replace, and combined with error check.
>> + if (!err)
>> + snprintf(iv_string, sizeof(iv_string), "%032llx", c->sequence);
>
> libavformat/hlsenc.c:407:13: warning: format ‘%llx’ expects argument of type ‘long long unsigned int’, but argument 4 has type ‘int64_t’ [-Wformat]
> libavformat/hlsenc.c:407:13: warning: format ‘%llx’ expects argument of type ‘long long unsigned int’, but argument 4 has type ‘int64_t’ [-Wformat]
Replaced with PRIx64 macro.
>> + filename_size = strlen(prefix) + strlen(oc->filename) + 1;
>> + filename = av_malloc(filename_size);
>> + if (!filename) {
>> + av_dict_free(&options);
>> + return AVERROR(ENOMEM);
>> + }
>> + av_strlcpy(filename, prefix, filename_size);
>> + av_strlcat(filename, oc->filename, filename_size);
>
> this looks like it can be simplified with av_asprintf()
Replaced with av_asprintf().
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-avformat-hlsenc-added-HLS-encryption.patch
Type: application/octet-stream
Size: 9812 bytes
Desc: 0001-avformat-hlsenc-added-HLS-encryption.patch
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20150109/345f11fa/attachment.obj>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: ATT00001.txt
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20150109/345f11fa/attachment.txt>
More information about the ffmpeg-devel
mailing list