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
13bffa79
Commit
13bffa79
authored
Dec 23, 2019
by
Paul B Mahol
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avformat/sccdec: fix sub->pos values
parent
9da7536c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
2 deletions
+5
-2
sccdec.c
libavformat/sccdec.c
+5
-2
No files found.
libavformat/sccdec.c
View file @
13bffa79
...
...
@@ -78,13 +78,14 @@ static int scc_read_header(AVFormatContext *s)
st
->
codecpar
->
codec_id
=
AV_CODEC_ID_EIA_608
;
while
(
!
ff_text_eof
(
&
tr
))
{
const
int64_t
pos
=
ff_text_pos
(
&
tr
)
;
int64_t
current_pos
,
next_pos
;
char
*
saveptr
=
NULL
,
*
lline
;
int
hh1
,
mm1
,
ss1
,
fs1
,
i
;
int
hh2
,
mm2
,
ss2
,
fs2
;
AVPacket
*
sub
;
if
(
count
==
0
)
{
current_pos
=
ff_text_pos
(
&
tr
);
while
(
!
ff_text_eof
(
&
tr
))
{
len
=
ff_subtitles_read_line
(
&
tr
,
line
,
sizeof
(
line
));
if
(
len
>
13
)
...
...
@@ -99,6 +100,7 @@ static int scc_read_header(AVFormatContext *s)
ts_start
=
(
hh1
*
3600LL
+
mm1
*
60LL
+
ss1
)
*
1000LL
+
fs1
*
33
;
next_pos
=
ff_text_pos
(
&
tr
);
while
(
!
ff_text_eof
(
&
tr
))
{
len2
=
ff_subtitles_read_line
(
&
tr
,
line2
,
sizeof
(
line2
));
if
(
len2
>
13
)
...
...
@@ -135,10 +137,11 @@ try_again:
if
(
!
sub
)
return
AVERROR
(
ENOMEM
);
sub
->
pos
=
pos
;
sub
->
pos
=
current_
pos
;
sub
->
pts
=
ts_start
;
sub
->
duration
=
FFMAX
(
1200
,
ts_end
-
ts_start
);
memmove
(
line
,
line2
,
sizeof
(
line
));
current_pos
=
next_pos
;
line2
[
0
]
=
0
;
}
...
...
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