Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
F
ffmpeg.wasm-core
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
ffmpeg.wasm-core
Commits
b8d017ad
Commit
b8d017ad
authored
Jul 07, 2014
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avformat/segment: simplify localtime* use
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
8cda23f3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
7 deletions
+4
-7
segment.c
libavformat/segment.c
+4
-7
No files found.
libavformat/segment.c
View file @
b8d017ad
...
@@ -669,13 +669,6 @@ fail:
...
@@ -669,13 +669,6 @@ fail:
return
ret
;
return
ret
;
}
}
#if !HAVE_LOCALTIME_R
static
void
localtime_r
(
const
time_t
*
t
,
struct
tm
*
tm
)
{
*
tm
=
*
localtime
(
t
);
}
#endif
static
int
seg_write_packet
(
AVFormatContext
*
s
,
AVPacket
*
pkt
)
static
int
seg_write_packet
(
AVFormatContext
*
s
,
AVPacket
*
pkt
)
{
{
SegmentContext
*
seg
=
s
->
priv_data
;
SegmentContext
*
seg
=
s
->
priv_data
;
...
@@ -697,7 +690,11 @@ static int seg_write_packet(AVFormatContext *s, AVPacket *pkt)
...
@@ -697,7 +690,11 @@ static int seg_write_packet(AVFormatContext *s, AVPacket *pkt)
}
else
{
}
else
{
if
(
seg
->
use_clocktime
)
{
if
(
seg
->
use_clocktime
)
{
gettimeofday
(
&
now
,
NULL
);
gettimeofday
(
&
now
,
NULL
);
#if HAVE_LOCALTIME_R
localtime_r
(
&
now
.
tv_sec
,
&
ti
);
localtime_r
(
&
now
.
tv_sec
,
&
ti
);
#else
ti
=
*
localtime
(
&
now
.
tv_sec
);
#endif
usecs
=
(
int64_t
)(
ti
.
tm_hour
*
3600
+
ti
.
tm_min
*
60
+
ti
.
tm_sec
)
*
1000000
+
now
.
tv_usec
;
usecs
=
(
int64_t
)(
ti
.
tm_hour
*
3600
+
ti
.
tm_min
*
60
+
ti
.
tm_sec
)
*
1000000
+
now
.
tv_usec
;
wrapped_val
=
usecs
%
seg
->
time
;
wrapped_val
=
usecs
%
seg
->
time
;
if
(
seg
->
last_cut
!=
usecs
&&
wrapped_val
<
seg
->
last_val
)
{
if
(
seg
->
last_cut
!=
usecs
&&
wrapped_val
<
seg
->
last_val
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment