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
5686c448
Commit
5686c448
authored
Jun 06, 2018
by
Carl Eugen Hoyos
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ffmpeg: Fail if the user requested impossible subtitle encoding.
Fixes ticket #7239.
parent
cf81a9c0
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
0 deletions
+17
-0
ffmpeg.c
fftools/ffmpeg.c
+17
-0
No files found.
fftools/ffmpeg.c
View file @
5686c448
...
@@ -3485,6 +3485,23 @@ static int init_output_stream(OutputStream *ost, char *error, int error_len)
...
@@ -3485,6 +3485,23 @@ static int init_output_stream(OutputStream *ost, char *error, int error_len)
return
ret
;
return
ret
;
}
}
}
}
if
(
ist
&&
ist
->
dec
->
type
==
AVMEDIA_TYPE_SUBTITLE
&&
ost
->
enc
->
type
==
AVMEDIA_TYPE_SUBTITLE
)
{
int
input_props
=
0
,
output_props
=
0
;
AVCodecDescriptor
const
*
input_descriptor
=
avcodec_descriptor_get
(
dec
->
codec_id
);
AVCodecDescriptor
const
*
output_descriptor
=
avcodec_descriptor_get
(
ost
->
enc_ctx
->
codec_id
);
if
(
input_descriptor
)
input_props
=
input_descriptor
->
props
&
(
AV_CODEC_PROP_TEXT_SUB
|
AV_CODEC_PROP_BITMAP_SUB
);
if
(
output_descriptor
)
output_props
=
output_descriptor
->
props
&
(
AV_CODEC_PROP_TEXT_SUB
|
AV_CODEC_PROP_BITMAP_SUB
);
if
(
input_props
&&
output_props
&&
input_props
!=
output_props
)
{
snprintf
(
error
,
error_len
,
"Subtitle encoding currently only possible from text to text "
"or bitmap to bitmap"
);
return
AVERROR_INVALIDDATA
;
}
}
if
((
ret
=
avcodec_open2
(
ost
->
enc_ctx
,
codec
,
&
ost
->
encoder_opts
))
<
0
)
{
if
((
ret
=
avcodec_open2
(
ost
->
enc_ctx
,
codec
,
&
ost
->
encoder_opts
))
<
0
)
{
if
(
ret
==
AVERROR_EXPERIMENTAL
)
if
(
ret
==
AVERROR_EXPERIMENTAL
)
...
...
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