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
fa2df3a4
Commit
fa2df3a4
authored
Feb 21, 2016
by
Clément Bœsch
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lavfi/ass: use ass_process_chunk() instead of ass_process_data()
parent
6433618d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
1 deletion
+9
-1
vf_subtitles.c
libavfilter/vf_subtitles.c
+9
-1
No files found.
libavfilter/vf_subtitles.c
View file @
fa2df3a4
...
...
@@ -393,6 +393,8 @@ static av_cold int init_subtitles(AVFilterContext *ctx)
}
if
(
ass
->
charenc
)
av_dict_set
(
&
codec_opts
,
"sub_charenc"
,
ass
->
charenc
,
0
);
if
(
LIBAVCODEC_VERSION_INT
>=
AV_VERSION_INT
(
57
,
25
,
100
))
av_dict_set
(
&
codec_opts
,
"sub_text_format"
,
"ass"
,
0
);
ret
=
avcodec_open2
(
dec_ctx
,
dec
,
&
codec_opts
);
if
(
ret
<
0
)
goto
end
;
...
...
@@ -436,11 +438,17 @@ static av_cold int init_subtitles(AVFilterContext *ctx)
av_log
(
ctx
,
AV_LOG_WARNING
,
"Error decoding: %s (ignored)
\n
"
,
av_err2str
(
ret
));
}
else
if
(
got_subtitle
)
{
const
int64_t
start_time
=
av_rescale_q
(
sub
.
pts
,
AV_TIME_BASE_Q
,
av_make_q
(
1
,
1000
));
const
int64_t
duration
=
sub
.
end_display_time
;
for
(
i
=
0
;
i
<
sub
.
num_rects
;
i
++
)
{
char
*
ass_line
=
sub
.
rects
[
i
]
->
ass
;
if
(
!
ass_line
)
break
;
ass_process_data
(
ass
->
track
,
ass_line
,
strlen
(
ass_line
));
if
(
LIBAVCODEC_VERSION_INT
<
AV_VERSION_INT
(
57
,
25
,
100
))
ass_process_data
(
ass
->
track
,
ass_line
,
strlen
(
ass_line
));
else
ass_process_chunk
(
ass
->
track
,
ass_line
,
strlen
(
ass_line
),
start_time
,
duration
);
}
}
}
...
...
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