avcodec/jacosubdec: use time_internal.h, simplify code
authorMichael Niedermayer <michaelni@gmx.at>
Sun, 2 Nov 2014 19:06:08 +0000 (20:06 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Sun, 2 Nov 2014 19:06:40 +0000 (20:06 +0100)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/jacosubdec.c

index ef999ca..2f94956 100644 (file)
@@ -29,6 +29,7 @@
 #include "jacosub.h"
 #include "libavutil/avstring.h"
 #include "libavutil/bprint.h"
+#include "libavutil/time_internal.h"
 
 #undef time
 
@@ -44,11 +45,7 @@ static int insert_datetime(AVBPrint *dst, const char *in, const char *arg)
     time_t now = time(0);
     struct tm ltime;
 
-#if HAVE_LOCALTIME_R
     localtime_r(&now, &ltime);
-#else
-    ltime = *localtime(&now);
-#endif
     strftime(buf, sizeof(buf), arg, &ltime);
     av_bprintf(dst, "%s", buf);
     return 0;