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
013b7007
Commit
013b7007
authored
Dec 15, 2012
by
Stefano Sabatini
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ffplay: provide some feedback in case the codec cannot be set
parent
1cbb11cd
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
5 deletions
+11
-5
ffplay.c
ffplay.c
+11
-5
No files found.
ffplay.c
View file @
013b7007
...
...
@@ -2300,6 +2300,7 @@ static int stream_component_open(VideoState *is, int stream_index)
AVFormatContext
*
ic
=
is
->
ic
;
AVCodecContext
*
avctx
;
AVCodec
*
codec
;
const
char
*
forced_codec_name
=
NULL
;
AVDictionary
*
opts
;
AVDictionaryEntry
*
t
=
NULL
;
...
...
@@ -2310,12 +2311,17 @@ static int stream_component_open(VideoState *is, int stream_index)
codec
=
avcodec_find_decoder
(
avctx
->
codec_id
);
switch
(
avctx
->
codec_type
){
case
AVMEDIA_TYPE_AUDIO
:
is
->
last_audio_stream
=
stream_index
;
if
(
audio_codec_name
)
codec
=
avcodec_find_decoder_by_name
(
audio_codec_name
);
break
;
case
AVMEDIA_TYPE_SUBTITLE
:
is
->
last_subtitle_stream
=
stream_index
;
if
(
subtitle_codec_name
)
codec
=
avcodec_find_decoder_by_name
(
subtitle_codec_name
);
break
;
case
AVMEDIA_TYPE_VIDEO
:
is
->
last_video_stream
=
stream_index
;
if
(
video_codec_name
)
codec
=
avcodec_find_decoder_by_name
(
video_codec_name
);
break
;
}
if
(
!
codec
)
case
AVMEDIA_TYPE_AUDIO
:
is
->
last_audio_stream
=
stream_index
;
forced_codec_name
=
audio_codec_name
;
break
;
case
AVMEDIA_TYPE_SUBTITLE
:
is
->
last_subtitle_stream
=
stream_index
;
forced_codec_name
=
subtitle_codec_name
;
break
;
case
AVMEDIA_TYPE_VIDEO
:
is
->
last_video_stream
=
stream_index
;
forced_codec_name
=
video_codec_name
;
break
;
}
if
(
forced_codec_name
)
codec
=
avcodec_find_decoder_by_name
(
forced_codec_name
);
if
(
!
codec
)
{
if
(
forced_codec_name
)
fprintf
(
stderr
,
"No codec could be found with name '%s'
\n
"
,
forced_codec_name
);
else
fprintf
(
stderr
,
"No codec could be found with id %d
\n
"
,
avctx
->
codec_id
);
return
-
1
;
}
avctx
->
codec_id
=
codec
->
id
;
avctx
->
workaround_bugs
=
workaround_bugs
;
...
...
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