aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/segment.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-11-02 20:07:34 +0100
committerMichael Niedermayer <michaelni@gmx.at>2014-11-02 20:07:34 +0100
commit32a2876b12f6e839292b0ee699ff7bd0f11ed4d4 (patch)
tree36f773d5654d5c78452e7f64c3c3979e76020fec /libavformat/segment.c
parentbab09864b423bf177e8af6e465e1a01a241eac62 (diff)
downloadffmpeg-32a2876b12f6e839292b0ee699ff7bd0f11ed4d4.tar.gz
avformat/segment: use time_internal.h, simplify code
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/segment.c')
-rw-r--r--libavformat/segment.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/libavformat/segment.c b/libavformat/segment.c
index 9db2607018..4e0af7c158 100644
--- a/libavformat/segment.c
+++ b/libavformat/segment.c
@@ -39,6 +39,7 @@
#include "libavutil/parseutils.h"
#include "libavutil/mathematics.h"
#include "libavutil/time.h"
+#include "libavutil/time_internal.h"
#include "libavutil/timestamp.h"
typedef struct SegmentListEntry {
@@ -716,11 +717,7 @@ static int seg_write_packet(AVFormatContext *s, AVPacket *pkt)
if (seg->use_clocktime) {
int64_t avgt = av_gettime();
time_t sec = avgt / 1000000;
-#if HAVE_LOCALTIME_R
localtime_r(&sec, &ti);
-#else
- ti = *localtime(&sec);
-#endif
usecs = (int64_t)(ti.tm_hour*3600 + ti.tm_min*60 + ti.tm_sec) * 1000000 + (avgt % 1000000);
wrapped_val = usecs % seg->time;
if (seg->last_cut != usecs && wrapped_val < seg->last_val) {