Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
F
ffmpeg
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
ffmpeg
Commits
559ce9c8
Commit
559ce9c8
authored
Mar 20, 2020
by
Carl Eugen Hoyos
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lavf/subviewerdec: Support higher sub-second precision.
Fixes ticket #8575.
parent
0123a0fd
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
3 deletions
+13
-3
subviewerdec.c
libavformat/subviewerdec.c
+13
-3
No files found.
libavformat/subviewerdec.c
View file @
559ce9c8
...
...
@@ -56,11 +56,21 @@ static int read_ts(const char *s, int64_t *start, int *duration)
int64_t
end
;
int
hh1
,
mm1
,
ss1
,
ms1
;
int
hh2
,
mm2
,
ss2
,
ms2
;
int
multiplier
=
1
;
if
(
sscanf
(
s
,
"%u:%u:%u.%2u,%u:%u:%u.%2u"
,
&
hh1
,
&
mm1
,
&
ss1
,
&
ms1
,
&
hh2
,
&
mm2
,
&
ss2
,
&
ms2
)
==
8
)
{
multiplier
=
10
;
}
else
if
(
sscanf
(
s
,
"%u:%u:%u.%1u,%u:%u:%u.%1u"
,
&
hh1
,
&
mm1
,
&
ss1
,
&
ms1
,
&
hh2
,
&
mm2
,
&
ss2
,
&
ms2
)
==
8
)
{
multiplier
=
100
;
}
if
(
sscanf
(
s
,
"%u:%u:%u.%u,%u:%u:%u.%u"
,
&
hh1
,
&
mm1
,
&
ss1
,
&
ms1
,
&
hh2
,
&
mm2
,
&
ss2
,
&
ms2
)
==
8
)
{
end
=
(
hh2
*
3600LL
+
mm2
*
60LL
+
ss2
)
*
100LL
+
ms2
;
*
start
=
(
hh1
*
3600LL
+
mm1
*
60LL
+
ss1
)
*
100LL
+
ms1
;
ms1
=
FFMIN
(
ms1
,
999
);
ms2
=
FFMIN
(
ms2
,
999
);
end
=
(
hh2
*
3600LL
+
mm2
*
60LL
+
ss2
)
*
1000LL
+
ms2
*
multiplier
;
*
start
=
(
hh1
*
3600LL
+
mm1
*
60LL
+
ss1
)
*
1000LL
+
ms1
*
multiplier
;
*
duration
=
end
-
*
start
;
return
0
;
}
...
...
@@ -84,7 +94,7 @@ static int subviewer_read_header(AVFormatContext *s)
return
res
;
if
(
avio_rb24
(
s
->
pb
)
!=
0xefbbbf
)
avio_seek
(
s
->
pb
,
-
3
,
SEEK_CUR
);
avpriv_set_pts_info
(
st
,
64
,
1
,
100
);
avpriv_set_pts_info
(
st
,
64
,
1
,
100
0
);
st
->
codecpar
->
codec_type
=
AVMEDIA_TYPE_SUBTITLE
;
st
->
codecpar
->
codec_id
=
AV_CODEC_ID_SUBVIEWER
;
...
...
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