Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc-2-2
Commits
334303f4
Commit
334303f4
authored
Sep 22, 2013
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avcodec: specify which encoder failed to initialize (fixes #9418)
parent
a2d307e1
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
10 deletions
+18
-10
modules/codec/avcodec/encoder.c
modules/codec/avcodec/encoder.c
+18
-10
No files found.
modules/codec/avcodec/encoder.c
View file @
334303f4
...
...
@@ -758,10 +758,25 @@ int OpenEncoder( vlc_object_t *p_this )
if
(
p_enc
->
fmt_in
.
i_cat
!=
AUDIO_ES
||
(
p_context
->
channels
<=
2
&&
i_codec_id
!=
AV_CODEC_ID_MP2
&&
i_codec_id
!=
AV_CODEC_ID_MP3
)
)
errmsg:
{
msg_Err
(
p_enc
,
"cannot open encoder"
);
static
const
char
types
[][
12
]
=
{
[
UNKNOWN_ES
]
=
N_
(
"unknown"
),
[
VIDEO_ES
]
=
N_
(
"video"
),
[
AUDIO_ES
]
=
N_
(
"audio"
),
[
SPU_ES
]
=
N_
(
"subpicture"
),
};
const
char
*
type
=
types
[
0
];
union
{
vlc_fourcc_t
value
;
char
txt
[
4
];
}
fcc
=
{
.
value
=
p_enc
->
fmt_out
.
i_codec
};
if
(
likely
((
unsigned
)
p_enc
->
fmt_in
.
i_cat
<
sizeof
(
types
)
/
sizeof
(
types
[
0
])))
type
=
types
[
p_enc
->
fmt_in
.
i_cat
];
msg_Err
(
p_enc
,
"cannot open %4.4s %s encoder"
,
fcc
.
txt
,
type
);
dialog_Fatal
(
p_enc
,
_
(
"Streaming / Transcoding failed"
),
"%s"
,
_
(
"VLC could not open the encoder."
)
);
_
(
"VLC could not open the %4.4s %s encoder."
),
fcc
.
txt
,
vlc_gettext
(
type
)
);
av_dict_free
(
&
options
);
goto
error
;
}
...
...
@@ -810,14 +825,7 @@ int OpenEncoder( vlc_object_t *p_this )
ret
=
avcodec_open2
(
p_context
,
p_codec
,
options
?
&
options
:
NULL
);
vlc_avcodec_unlock
();
if
(
ret
)
{
msg_Err
(
p_enc
,
"cannot open encoder"
);
dialog_Fatal
(
p_enc
,
_
(
"Streaming / Transcoding failed"
),
"%s"
,
_
(
"VLC could not open the encoder."
)
);
av_dict_free
(
&
options
);
goto
error
;
}
goto
errmsg
;
}
av_dict_free
(
&
options
);
...
...
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