Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc
Commits
bfb09d95
Commit
bfb09d95
authored
Dec 09, 2015
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
snapshot: use timespec_get() (fixes #14008)
parent
064fffbc
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
8 deletions
+7
-8
src/video_output/snapshot.c
src/video_output/snapshot.c
+7
-8
No files found.
src/video_output/snapshot.c
View file @
bfb09d95
...
@@ -29,7 +29,6 @@
...
@@ -29,7 +29,6 @@
#include <assert.h>
#include <assert.h>
#include <sys/stat.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <sys/types.h>
#include <sys/time.h>
#include <dirent.h>
#include <dirent.h>
#include <time.h>
#include <time.h>
...
@@ -180,20 +179,20 @@ int vout_snapshot_SaveImage(char **name, int *sequential,
...
@@ -180,20 +179,20 @@ int vout_snapshot_SaveImage(char **name, int *sequential,
free
(
filename
);
free
(
filename
);
}
}
}
else
{
}
else
{
struct
time
val
tv
;
struct
time
spec
ts
;
struct
tm
curtime
;
struct
tm
curtime
;
char
buffer
[
128
];
char
buffer
[
128
];
gettimeofday
(
&
tv
,
NULL
);
timespec_get
(
&
ts
,
TIME_UTC
);
if
(
localtime_r
(
&
t
v
.
tv_sec
,
&
curtime
)
==
NULL
)
if
(
localtime_r
(
&
t
s
.
tv_sec
,
&
curtime
)
==
NULL
)
gmtime_r
(
&
t
v
.
tv_sec
,
&
curtime
);
gmtime_r
(
&
t
s
.
tv_sec
,
&
curtime
);
if
(
strftime
(
buffer
,
sizeof
(
buffer
),
"%Y-%m-%d-%Hh%Mm%Ss"
,
if
(
strftime
(
buffer
,
sizeof
(
buffer
),
"%Y-%m-%d-%Hh%Mm%Ss"
,
&
curtime
)
==
0
)
&
curtime
)
==
0
)
strcpy
(
buffer
,
"error"
);
strcpy
(
buffer
,
"error"
);
if
(
asprintf
(
&
filename
,
"%s"
DIR_SEP
"%s%s%03u.%s"
,
if
(
asprintf
(
&
filename
,
"%s"
DIR_SEP
"%s%s%03
l
u.%s"
,
cfg
->
path
,
prefix
,
buffer
,
cfg
->
path
,
prefix
,
buffer
,
ts
.
tv_nsec
/
1000000
,
(
unsigned
)
tv
.
tv_usec
/
1000
,
cfg
->
format
)
<
0
)
cfg
->
format
)
<
0
)
filename
=
NULL
;
filename
=
NULL
;
}
}
free
(
prefix
);
free
(
prefix
);
...
...
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