[FFmpeg-devel] libavformat/hlsenc + configure: question about default strftime() format string

Bodecs Bela bodecsb at vivanet.hu
Fri Dec 30 16:05:56 EET 2016



2016.12.29. 3:33 keltezéssel, Steven Liu írta:
> 2016-12-29 8:32 GMT+08:00 Bodecs Bela <bodecsb at vivanet.hu>:
>
>> Dear All,
>>
>> in hlcenc.c, in the hls_write_header() function the default format string
>> for strftime() function contains %s specifier.
>>
>> const char *pattern_localtime_fmt = "-%s.ts";
>>
>> This %s specifier will insert the seconds since EPOCH. But %s is not
>> available on all system/environment.
>>
>> I have found this bug, but to retain current behavior, this situation is
>> manageable by a test-run of strftime() with %s and only if it fails then
>> alter the format string for something else.
>>
>> But I thought that It should be handled at preprocessing like:
>>
>> #if HAVE....
>> const char *pattern_localtime_fmt = "-%s.ts";
>> #else
>> const char *pattern_localtime_fmt = "-%Y%m%d%H%I%S.ts";
>> #endif
>>
>> I tried to find in config.h something similar like #define
>> HAVE_EPOCH_SECONDS 1, but did not find.
>>
>> My questions are the followings:
>>
>> 1. is there a pre-defined config parameter to use here?
>>
>> 2. If not, is there a prefered way:  a new config parameter on %s
>> availability or a function to test the %s parameter availability at runtime?
>>
>>
>> thank you in advance,
>>
>>
> You can refer to configure file HAVE_LIST to support this option.
I have investigated and concluded that %s support may change by 
installing new modul/kernel, so I stick to check %s availability at runtime.
I will send patch soon.
>> Bela Bodecs
>>
>> _______________________________________________
>> ffmpeg-devel mailing list
>> ffmpeg-devel at ffmpeg.org
>> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>>
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel



More information about the ffmpeg-devel mailing list