mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2024-12-11 17:55:21 +00:00
avcodec/jacosubdec: use time_internal.h, simplify code
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
013c3eb05c
commit
bab09864b4
@ -29,6 +29,7 @@
|
|||||||
#include "jacosub.h"
|
#include "jacosub.h"
|
||||||
#include "libavutil/avstring.h"
|
#include "libavutil/avstring.h"
|
||||||
#include "libavutil/bprint.h"
|
#include "libavutil/bprint.h"
|
||||||
|
#include "libavutil/time_internal.h"
|
||||||
|
|
||||||
#undef time
|
#undef time
|
||||||
|
|
||||||
@ -44,11 +45,7 @@ static int insert_datetime(AVBPrint *dst, const char *in, const char *arg)
|
|||||||
time_t now = time(0);
|
time_t now = time(0);
|
||||||
struct tm ltime;
|
struct tm ltime;
|
||||||
|
|
||||||
#if HAVE_LOCALTIME_R
|
|
||||||
localtime_r(&now, <ime);
|
localtime_r(&now, <ime);
|
||||||
#else
|
|
||||||
ltime = *localtime(&now);
|
|
||||||
#endif
|
|
||||||
strftime(buf, sizeof(buf), arg, <ime);
|
strftime(buf, sizeof(buf), arg, <ime);
|
||||||
av_bprintf(dst, "%s", buf);
|
av_bprintf(dst, "%s", buf);
|
||||||
return 0;
|
return 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user