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
02935c2c
Commit
02935c2c
authored
Dec 22, 2018
by
Marton Balint
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avformat/mxfdec: support subsecond precision of decoded timestamps
Signed-off-by:
Marton Balint
<
cus@passwd.hu
>
parent
d0e43cf1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
1 deletion
+4
-1
mxfdec.c
libavformat/mxfdec.c
+4
-1
No files found.
libavformat/mxfdec.c
View file @
02935c2c
...
...
@@ -2556,12 +2556,14 @@ fail_and_free:
static
int64_t
mxf_timestamp_to_int64
(
uint64_t
timestamp
)
{
struct
tm
time
=
{
0
};
int
msecs
;
time
.
tm_year
=
(
timestamp
>>
48
)
-
1900
;
time
.
tm_mon
=
(
timestamp
>>
40
&
0xFF
)
-
1
;
time
.
tm_mday
=
(
timestamp
>>
32
&
0xFF
);
time
.
tm_hour
=
(
timestamp
>>
24
&
0xFF
);
time
.
tm_min
=
(
timestamp
>>
16
&
0xFF
);
time
.
tm_sec
=
(
timestamp
>>
8
&
0xFF
);
msecs
=
(
timestamp
&
0xFF
)
*
4
;
/* Clip values for legacy reasons. Maybe we should return error instead? */
time
.
tm_mon
=
av_clip
(
time
.
tm_mon
,
0
,
11
);
...
...
@@ -2569,8 +2571,9 @@ static int64_t mxf_timestamp_to_int64(uint64_t timestamp)
time
.
tm_hour
=
av_clip
(
time
.
tm_hour
,
0
,
23
);
time
.
tm_min
=
av_clip
(
time
.
tm_min
,
0
,
59
);
time
.
tm_sec
=
av_clip
(
time
.
tm_sec
,
0
,
59
);
msecs
=
av_clip
(
msecs
,
0
,
999
);
return
(
int64_t
)
av_timegm
(
&
time
)
*
1000000
;
return
(
int64_t
)
av_timegm
(
&
time
)
*
1000000
+
msecs
*
1000
;
}
#define SET_STR_METADATA(pb, name, str) do { \
...
...
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